# HG changeset patch # User nenolod # Date 1178929246 25200 # Node ID a67712c750694dae9c3f73eaa3852c10f5eb4404 # Parent 953001c668aedfc76796a8b8e5524d10dfa76f00 [svn] - add an xchat script which wraps our DBus API using dbus-python. diff -r 953001c668ae -r a67712c75069 ChangeLog --- a/ChangeLog Fri May 11 16:27:54 2007 -0700 +++ b/ChangeLog Fri May 11 17:20:46 2007 -0700 @@ -1,3 +1,12 @@ +2007-05-11 23:27:54 +0000 Giacomo Lozito + revision [4504] + - added auddrct.c/h, a migration api for plugins that once used xmms_remote; to be completed + trunk/src/audacious/Makefile | 2 + trunk/src/audacious/auddrct.c | 115 ++++++++++++++++++++++++++++++++++++++++++ + trunk/src/audacious/auddrct.h | 36 +++++++++++++ + 3 files changed, 153 insertions(+) + + 2007-05-11 20:02:49 +0000 William Pitcock revision [4502] - call SongFrames not SongLength diff -r 953001c668ae -r a67712c75069 contrib/xchat-audacious.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/xchat-audacious.py Fri May 11 17:20:46 2007 -0700 @@ -0,0 +1,35 @@ +# +# X-Chat Audacious for Audacious 1.4 and later +# This uses the native Audacious D-Bus interface. +# +# To consider later: +# - support org.freedesktop.MediaPlayer (MPRIS)? +# + +__module_name__ = "xchat-audacious" +__module_version__ = "1.0" +__module_description__ = "Get NP information from Audacious" + +from dbus import Bus, Interface +import xchat + +# connect to DBus +bus = Bus(Bus.TYPE_SESSION) + +def command_np(word, word_eol, userdata): + aud = bus.get_object('org.atheme.audacious', '/org/atheme/audacious') + + # this seems to be best, probably isn't! + length = "stream" + if aud.SongLength(aud.Position()) > 0: + length = "%d:%02d" % (aud.SongLength(aud.Position()) / 60, + aud.SongLength(aud.Position()) % 60) + + xchat.command("SAY [%s | %d:%02d/%s]" % ( + aud.SongTitle(aud.Position()), + aud.Time() / 1000 / 60, aud.Time() / 1000 % 60, + length)) + + return xchat.EAT_ALL + +xchat.hook_command("NP", command_np, help="Displays current playing song.") diff -r 953001c668ae -r a67712c75069 src/audacious/build_stamp.c --- a/src/audacious/build_stamp.c Fri May 11 16:27:54 2007 -0700 +++ b/src/audacious/build_stamp.c Fri May 11 17:20:46 2007 -0700 @@ -1,2 +1,2 @@ #include -const gchar *svn_stamp = "20070511-4502"; +const gchar *svn_stamp = "20070511-4504";