Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (7) </ 1 2 3 4 5 [6] 7 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: XMMS Improvements, Additional plug-in for WMA< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 22 2006,04:46 QUOTE

I think it is related to that, since xmms needs to be finished with its business before you should kill it, but I don't know how to get its pid without backgrounding it.


Code Sample
xmms "$i" &
xmmspid=$!
wait for xmms to finish writing (how to tell?)
kill $xmmspid


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
lesliek Offline





Group: Members
Posts: 91
Joined: Feb. 2006
Posted: May 22 2006,05:28 QUOTE

Does "pidof xmms" get xmms's pid(s) without backgrounding xmms?

I opened xmms by clicking on its icon on the desktop. I then opened a terminal, typed pidof xmms and pressed Enter and got as output: 1189 1190 1191 1192.

Of course, I may not be understanding what backgrounding is.

The kill-process.sh I mentioned earlier relied on pidof, but when I tried to adapt it, I got nowhere.
Back to top
Profile PM 
jot Offline





Group: Members
Posts: 15
Joined: May 2006
Posted: May 22 2006,13:26 QUOTE

Quote (mikshaw @ May 22 2006,00:46)
Code Sample
xmms "$i" &
xmmspid=$!
wait for xmms to finish writing (how to tell?)
kill $xmmspid

I didn't know how to check when xmms finished writing and
that's why I suggested xmmsctrl and this little script:

Code Sample


#!/bin/sh

# check if xmms if running and quit if it is running
xmmsctrl running && xmmsctrl quit

<change output plugin command goes here>

if [ "$1" = "" ]; then
FILEDIR="path/to/wma/dir/or/single/wma"
else
FILEDIR="$@"

# launch xmms
xmmsctrl launch

# this command will load single file or files from a directory to xmms

xmmsctrl dir "$FILEDIR"
# multiple dirs : xmmsctrl dir BEGIN dir1 dir2 END
# maybe without BEGIN and END it'll also work

# now you have to tell xmms to start playing/converting
xmmsctrl play

# this loop checks if xmms is playing/converting
# and if yes it checks the playlist length in seconds
# and sleeps for that amount of seconds

while `xmmsctrl playing`
do
P=0
 for i in `xmmsctrl print "%*S%n"`  # checks the length of playlist in seconds
 do
   P=$(( P + $i ))
 done
sleep $P
done

# when the loop ends it means that xmms stopped playing/converting and now you can kill xmms with this command:

xmmsctrl quit

<restore config file command goes here>

# if you have xmmsctrl in your PATH environemental (?) variable
# you can add some lines to this script to change the xmms config file and it should convert your wma's

# You can also consider putting this somewhere in the beginning :

sed -i 's/shuffle=TRUE/shuffle=FALSE/;s/repeat=TRUE/repeat=FALSE/' ~/.xmms/config



I've also created some .tar.gz's with output plugins and xmmsctrl to install via mydsl, they can be found here

If someone finds them useful and can put them in a more persistant location, please do so.

Thank You for your attention :)
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: May 22 2006,14:57 QUOTE

Quote (lesliek @ May 22 2006,01:28)
Does "pidof xmms" get xmms's pid(s) without backgrounding xmms?

I opened xmms by clicking on its icon on the desktop. I then opened a terminal, typed pidof xmms and pressed Enter and got as output: 1189 1190 1191 1192.

Of course, I may not be understanding what backgrounding is.

Backgrounding is necessary from a script if you need to continue on to do something else while the previous command is still running.  In this case, xmms must be put into the background (xmms &) so that the next command (pidof xmms) can run. Otherwise pidof will not run until xmms is closed, and then it's too late to get its pid.  You successfully got the pid when you did it manually because you opened a new shell while xmms was running, but you can't do that from a script unless you background xmms.  As I said before, xmms isn't the most appropriate tool with which to do a batch process, since it requires interaction with the user (unless you add more software as jot suggested).

jot: submit mydsl extensions to extensions(at)damnsmalllinux(dot)org


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
lesliek Offline





Group: Members
Posts: 91
Joined: Feb. 2006
Posted: May 22 2006,21:55 QUOTE

The penny's finally dropped for me about my trying to kill xmms. (I think I can hear, even here in Australia, mikshaw and jot both shouting "About bloody time!")

I've now got xmmsctrl installed, though I cheated a bit to do so. I downloaded an RPM containing it to my computer which runs Fedora. (The RPM was actually created for Mandriva.) I then extracted all the files from the RPM using a built-in extractor in Fedora. I found xmmsctrl among the extracted files and copied just that to my computer running DSL. It works.

With xmmsctrl working, I hope I'll be able to bring this saga to an end later today.

Once again, thanks to mikshaw and to jot.
Back to top
Profile PM 
33 replies since Nov. 27 2005,21:03 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (7) </ 1 2 3 4 5 [6] 7 >/
reply to topic new topic new poll
Quick Reply: XMMS Improvements

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code