Mercurial > audlegacy
comparison contrib/xchat-audacious.py @ 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 |
comparison
equal
deleted
inserted
replaced
2751:e5c1674fa767 | 2752:1ca3b314301d |
---|---|
2 # X-Chat Audacious for Audacious 1.4 and later | 2 # X-Chat Audacious for Audacious 1.4 and later |
3 # This uses the native Audacious D-Bus interface. | 3 # This uses the native Audacious D-Bus interface. |
4 # | 4 # |
5 # To consider later: | 5 # To consider later: |
6 # - support org.freedesktop.MediaPlayer (MPRIS)? | 6 # - support org.freedesktop.MediaPlayer (MPRIS)? |
7 # | |
8 # This script is in the public domain. | |
9 # $Id: xchat-audacious.py 4530 2007-05-12 04:27:02Z nenolod $ | |
7 # | 10 # |
8 | 11 |
9 __module_name__ = "xchat-audacious" | 12 __module_name__ = "xchat-audacious" |
10 __module_version__ = "1.0" | 13 __module_version__ = "1.0" |
11 __module_description__ = "Get NP information from Audacious" | 14 __module_description__ = "Get NP information from Audacious" |
50 | 53 |
51 def command_play(word, word_eol, userdata): | 54 def command_play(word, word_eol, userdata): |
52 bus.get_object('org.atheme.audacious', '/org/atheme/audacious').Play() | 55 bus.get_object('org.atheme.audacious', '/org/atheme/audacious').Play() |
53 return xchat.EAT_ALL | 56 return xchat.EAT_ALL |
54 | 57 |
58 def command_send(word, word_eol, userdata): | |
59 if len(word) < 1: | |
60 print "You must provide a user to send the track to." | |
61 return xchat.EAT_ALL | |
62 | |
63 aud = bus.get_object('org.atheme.audacious', '/org/atheme/audacious') | |
64 xchat.command("DCC SEND %s %s" % (word[0], aud.SongFilename(aud.Position())) | |
65 return xchat.EAT_ALL | |
66 | |
55 xchat.hook_command("NP", command_np, help="Displays current playing song.") | 67 xchat.hook_command("NP", command_np, help="Displays current playing song.") |
56 xchat.hook_command("NEXT", command_next, help="Advances in Audacious' playlist.") | 68 xchat.hook_command("NEXT", command_next, help="Advances in Audacious' playlist.") |
57 xchat.hook_command("PREV", command_prev, help="Goes backwards in Audacious' playlist.") | 69 xchat.hook_command("PREV", command_prev, help="Goes backwards in Audacious' playlist.") |
58 xchat.hook_command("PAUSE", command_pause, help="Toggles paused status.") | 70 xchat.hook_command("PAUSE", command_pause, help="Toggles paused status.") |
59 xchat.hook_command("STOP", command_stop, help="Stops playback.") | 71 xchat.hook_command("STOP", command_stop, help="Stops playback.") |
60 xchat.hook_command("PLAY", command_play, help="Begins playback.") | 72 xchat.hook_command("PLAY", command_play, help="Begins playback.") |
73 xchat.hook_command("SENDTRACK", command_send, help="Sends the currently playing track to a user.") | |
61 | 74 |
62 print "xchat-audacious $Id: xchat-audacious.py 4528 2007-05-12 04:21:09Z nenolod $ loaded" | 75 print "xchat-audacious $Id: xchat-audacious.py 4530 2007-05-12 04:27:02Z nenolod $ loaded" |