Summary: | the media script lacks support for Audacious | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Stephan Sokolow <kde_bugzilla_2> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.0.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Patch to add Audacious to the media script |
Description
Stephan Sokolow
2006-12-15 06:25:53 UTC
Created attachment 18937 [details]
Patch to add Audacious to the media script
Thanks for the patch, commited to rev 615866, will be in 1.1. commit 84ea76455b9ee77d54e7a604bdba99594803d9e0 Author: Peter Simonsson <peter.simonsson@gmail.com> Date: Fri Dec 22 23:46:15 2006 +0000 add support for audacious to media, patch Stephan Sokolow FEATURE: 138836 svn path=/trunk/extragear/network/konversation/; revision=615866 diff --git a/scripts/media b/scripts/media index f7daf70..ff7c271 100755 --- a/scripts/media +++ b/scripts/media @@ -44,7 +44,7 @@ formatVariables={'audio': 'is listening to', 'video': 'is watching'} ## If you add a new player, you must add it here or it won't get checked when in audio-only or video-only modes. playerRankings= { 'video' :['kaffeine','kmplayer', 'noatun', 'kdetv'], - 'audio' :['amarok', 'juk', 'noatun', 'kscd', 'kaffeine', 'kmplayer', 'xmms', 'yammi'] + 'audio' :['amarok', 'juk', 'noatun', 'kscd', 'kaffeine', 'kmplayer', 'Audacious', 'xmms', 'yammi'] } ## Title, album and artist fields to be quoted depending on contents @@ -273,6 +273,20 @@ try: except ImportError: XmmsPlayer=Player +class AudaciousPlayer(Player): + def __init__(self, display_name): + Player.__init__(self, display_name) + + def isRunning(self): + self.running = not os.system('audtool current-song') + return self.running + + def getData(self): + if self.isRunning() and not os.system('audtool playback-playing'): + # get the title of the currently playing track + return (self.reEncodeString(os.popen('audtool current-song').read().strip()),'','') + + def playing(playerList, mode=None): for i in playerList: s=i.get(mode) @@ -334,7 +348,7 @@ DCOPPlayer("Kaffeine","kaffeine","KaffeineIface title","KaffeineIface artist","K KMPLayer("KMPlayer","kmplayer","kmplayer-mainwindow#1 caption",playerType="video audio"), DCOPPlayer("KsCD","kscd","CDPlayer currentTrackTitle","CDPlayer currentArtist","CDPlayer currentAlbum"), DCOPPlayer("kdetv","kdetv","KdetvIface channelName",playerType='video'), -XmmsPlayer('XMMS'), +AudaciousPlayer('Audacious'), XmmsPlayer('XMMS'), DCOPPlayer("Yammi","yammi","YammiPlayer songTitle","YammiPlayer songArtist","YammiPlayer songAlbum") ] |