import sys
try:
import xmms
except:
print 0
else:
if xmms.control.is_playing():
current = xmms.control.get_playlist_pos()
title = xmms.control.get_playlist_title(current)
print title
else:
print 0
And modified two functions in music.tcl:
proc TreatSongXMMS {} {
after 0 {::music::exec_async [list "python" [file join $::music::musicpluginpath "infoxmms"]]}
return 0
}
proc GetSongXMMS {} {
if { [catch {split $::music::actualsong "\n"} song] } {
return 0
}
if {$song == "0"} {
return 0
} else {
return $song
}
}
It works just fine without using much CPU time and hanging the messenger.
No comments:
Post a Comment