[Konversation-devel] [Bug 138836] the media script lacks support for Audacious
Peter Simonsson
peter.simonsson at gmail.com
Thu Jul 1 16:20:29 CEST 2010
https://bugs.kde.org/show_bug.cgi?id=138836
--- Comment #3 from Peter Simonsson <peter simonsson gmail com> 2010-07-01 16:20:11 ---
commit 84ea76455b9ee77d54e7a604bdba99594803d9e0
Author: Peter Simonsson <peter.simonsson at 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")
]
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Konversation-devel
mailing list