changeset 2752:1ca3b314301d trunk

[svn] - add /SENDTRACK which can DCC the current track to a user - denote script as being in the public domain
author nenolod
date Fri, 11 May 2007 21:27:02 -0700
parents e5c1674fa767
children aadc6fd97cc7
files ChangeLog contrib/xchat-audacious.py src/audacious/build_stamp.c
diffstat 3 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 11 21:21:09 2007 -0700
+++ b/ChangeLog	Fri May 11 21:27:02 2007 -0700
@@ -1,3 +1,11 @@
+2007-05-12 04:21:09 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [4528]
+  - add XCHAT.eat_all
+  
+  trunk/contrib/xchat-audacious.py |    5 +++++
+  1 file changed, 5 insertions(+)
+
+
 2007-05-12 04:20:27 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [4526]
   - map to right handlers
--- a/contrib/xchat-audacious.py	Fri May 11 21:21:09 2007 -0700
+++ b/contrib/xchat-audacious.py	Fri May 11 21:27:02 2007 -0700
@@ -5,6 +5,9 @@
 # To consider later:
 #   - support org.freedesktop.MediaPlayer (MPRIS)?
 #
+# This script is in the public domain.
+#   $Id: xchat-audacious.py 4530 2007-05-12 04:27:02Z nenolod $
+#
 
 __module_name__ = "xchat-audacious"
 __module_version__ = "1.0"
@@ -52,11 +55,21 @@
 	bus.get_object('org.atheme.audacious', '/org/atheme/audacious').Play()
 	return xchat.EAT_ALL
 
+def command_send(word, word_eol, userdata):
+	if len(word) < 1:
+		print "You must provide a user to send the track to."
+		return xchat.EAT_ALL
+
+	aud = bus.get_object('org.atheme.audacious', '/org/atheme/audacious')
+	xchat.command("DCC SEND %s %s" % (word[0], aud.SongFilename(aud.Position()))
+	return xchat.EAT_ALL
+
 xchat.hook_command("NP", command_np, help="Displays current playing song.")
 xchat.hook_command("NEXT", command_next, help="Advances in Audacious' playlist.")
 xchat.hook_command("PREV", command_prev, help="Goes backwards in Audacious' playlist.")
 xchat.hook_command("PAUSE", command_pause, help="Toggles paused status.")
 xchat.hook_command("STOP", command_stop, help="Stops playback.")
 xchat.hook_command("PLAY", command_play, help="Begins playback.")
+xchat.hook_command("SENDTRACK", command_send, help="Sends the currently playing track to a user.")
 
-print "xchat-audacious $Id: xchat-audacious.py 4528 2007-05-12 04:21:09Z nenolod $ loaded"
+print "xchat-audacious $Id: xchat-audacious.py 4530 2007-05-12 04:27:02Z nenolod $ loaded"
--- a/src/audacious/build_stamp.c	Fri May 11 21:21:09 2007 -0700
+++ b/src/audacious/build_stamp.c	Fri May 11 21:27:02 2007 -0700
@@ -1,2 +1,2 @@
 #include <glib.h>
-const gchar *svn_stamp = "20070512-4526";
+const gchar *svn_stamp = "20070512-4528";