You are not logged in.

#1 2007-03-16 15:39:00

Aziere
Member
Registered: 2007-03-16
Posts: 23

Console mp3 player, single process, thunar custom command... [SOLVED]

Couldn't come up with a better topic title. Sorry.

Anyways, I'm having a bit of a problem with console mp3 players.
I want to use Thunar (I use XFCE4) to start mp3 files just by clicking on them. That's simple to fix.
What I'm having a problem with though, is having the player start another song when I click on another.
Mplayer and various others just start another process, which is not what I want.
And some others queue up the songs, which isn't what I want either.
And those that actually can do that, they can't play the song on repeat, so that doesn't work for me either.

I've tried every console player in all repositories I could find, none did what I wanted. So I've thought about two perhaps possible solutions. First is using killall to close the player and start it again. But Thunar's "open with" commands can't handle operators as far as I've seen. Maybe calling a bash script would be possible, but can it use %f from thunar? Though, I know nothing about scripting, so I can't really fix that on my own. The second solution is using XMMS or any other GUI player which I know all those functions work in, but hiding the interface, can that be done?

Summary:
I want to use thunar to start playing mp3 files in the background, easily switching to another song by clicking on another.

Greatly appreciated if someone can find a solution to my problem.

Last edited by Aziere (2007-03-18 09:20:11)

Offline

#2 2007-03-16 16:47:32

stb
Member
Registered: 2007-03-13
Posts: 40

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

How about a script? I do not know thunar, but it should give your script a list of files you selected. For a player I suggest cmus, which can be controlled externally via cmus-remote. So, write down a script like

if [ cmus_is_not_running ]; then
    cmus --do_what_you_want
else
    cmus-remote --do_what_you_want
done

I believe there are many other players which can be controlled from external.

Offline

#3 2007-03-16 21:04:07

dystoptic
Member
Registered: 2007-02-09
Posts: 20

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

In xmms you can deselect in Preferences/Options/Allow multiple instances.

As far as I know for mplayer/vlc there is under linux no similar trick available. There you have to use a scripting.

Offline

#4 2007-03-16 21:10:58

nogoma
Member
From: Cranston, RI
Registered: 2006-03-01
Posts: 217

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

If you use mpd, you can call 'mpc clear' then 'mpc add <file>' and then 'mpc play' to play the song. Just wrap that up into a script, and presto.


-nogoma
---
Code Happy, Code Ruby!
http://www.last.fm/user/nogoma/

Offline

#5 2007-03-17 10:48:30

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

With mp3blaster you can add items to the playlist with space and play them right away with enter. And in the playlist you can play them right away too. IIRC.

Offline

#6 2007-03-17 12:19:21

Stalwart
Member
From: Latvia, Riga
Registered: 2005-10-18
Posts: 445
Website

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

mocp is one more good ncurses player


IRC: Stalwart @ FreeNode
Skype ID: thestalwart
WeeChat-devel nightly packages for i686

Offline

#7 2007-03-18 09:19:42

Aziere
Member
Registered: 2007-03-16
Posts: 23

Re: Console mp3 player, single process, thunar custom command... [SOLVED]

I decided to create a script around mplayer after all. Although it ended up different than what I intended, I feel it's pretty useful as it is.

#!/bin/bash
if [ "$(pidof mplayer)" ]
then
        killall mplayer
fi
mplayer "$1"

Marking the topic as solved now.

Offline

Board footer

Powered by FluxBB