So I finally made the leap to a single media player. Long gone are the days of VLC + MPlayer + Xine-UI + XMMS + whatever... why bother? MPlayer (or more properly stated, its 'stock' GUI) has come well far enough that it serves as an all-in-one without repute.
So... enter my issue.
Every time I click on a music of movie file, bang, a new unique instance of the MPlayer GUI is launched, leaving me with two songs playing at once, or a song and a movie, etc... etc...
So, I putz around through the manpage, looking for an answer. There is none; and the wiki states that it is a 'known issue'.
The spin-off Gnome MPlayer front end (command is gnome-mplayer rather than gmplayer), has a 'single instance' flag that can be used, however it simply blocks you from opening a second file, rather then enqueing and auto-playing the second file clicked (whilst stopping the first one). So, it was of no help.
Then, it dawned on me... simple is simple is simple is... stupid?
gmplayer-hack.sh
Code:
#!/bin/bash
# MPLAYER GUI HACK FOR SINGLE INSTANCES WITH SELF START
#
item_to_play=$1
killall -9 gmplayer
gmplayer $item_to_play &
#
Then simply edit your audio and video file auto launches to use /usr/bin/gmplayer-hack.sh rather than /usr/bin/gmplayer
I then proceeded to smack myself on the forehead and become ashamed for not having thought of it earlier.
I post this here for posterity, as hopefully someone else looking for the "mplayer gui prevent multiple instance or instances" fix will find it, as I searched Google to no avail for a good half hour before realizing the folly.
Enjoy,
- Vince.