# HG changeset patch # User nenolod # Date 1169789391 28800 # Node ID 1dc1d36d0347997169267eab8080f09f8b653ce4 # Parent 6f4094cc3859fc335a56ae43b295a9c1ef5bebce [svn] - add hooks: playback begin, playback end, playlist reached end diff -r 6f4094cc3859 -r 1dc1d36d0347 ChangeLog --- a/ChangeLog Thu Jan 25 21:19:44 2007 -0800 +++ b/ChangeLog Thu Jan 25 21:29:51 2007 -0800 @@ -1,3 +1,11 @@ +2007-01-26 05:19:44 +0000 William Pitcock + revision [3822] + - allow for hooks to be automatically registered if they are needed + + trunk/src/audacious/hook.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + + 2007-01-26 04:50:15 +0000 Yoshiki Yazawa revision [3820] enhancement to popup information settings diff -r 6f4094cc3859 -r 1dc1d36d0347 src/audacious/playback.c --- a/src/audacious/playback.c Thu Jan 25 21:19:44 2007 -0800 +++ b/src/audacious/playback.c Thu Jan 25 21:29:51 2007 -0800 @@ -51,9 +51,9 @@ #include "libaudacious/urldecode.h" #include "util.h" - #include "playback.h" +#include "hook.h" /* FIXME: yuck!! this shouldn't be here... */ void @@ -140,6 +140,8 @@ playlist_check_pos_current(playlist); mainwin_set_info_text(); + + hook_call("playback begin", entry); } void diff -r 6f4094cc3859 -r 1dc1d36d0347 src/audacious/playlist.c --- a/src/audacious/playlist.c Thu Jan 25 21:19:44 2007 -0800 +++ b/src/audacious/playlist.c Thu Jan 25 21:29:51 2007 -0800 @@ -67,6 +67,8 @@ #include "debug.h" +#include "hook.h" + typedef gint (*PlaylistCompareFunc) (PlaylistEntry * a, PlaylistEntry * b); typedef void (*PlaylistSaveFunc) (FILE * file); @@ -1341,6 +1343,8 @@ if ((cfg.no_playlist_advance && !cfg.repeat) || cfg.stopaftersong) ip_data.stop = FALSE; + hook_call("playback finish", playlist->position); + PLAYLIST_LOCK(playlist->mutex); if ((playlist_position_before_jump != NULL) && playlist->queue == NULL) @@ -1379,6 +1383,7 @@ if (!cfg.repeat) { PLAYLIST_UNLOCK(playlist->mutex); + hook_call("playlist reached end", playlist->position); mainwin_clear_song_info(); mainwin_set_info_text(); return;