diff src/audacious/playlist.c @ 2407:1dc1d36d0347 trunk

[svn] - add hooks: playback begin, playback end, playlist reached end
author nenolod
date Thu, 25 Jan 2007 21:29:51 -0800
parents 825c3715b90f
children b380e84148bb
line wrap: on
line diff
--- 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;