# HG changeset patch # User nenolod # Date 1154586829 25200 # Node ID 5dbe7cfdcaf55216f30b3c36d40cd92fdec714ee # Parent 285215fd312302102d15d475fade0908cb30c5bf [svn] - support the notion of a watchdog function to keep things bound to the proper playlist entry. (half there) diff -r 285215fd3123 -r 5dbe7cfdcaf5 ChangeLog --- a/ChangeLog Wed Aug 02 22:57:08 2006 -0700 +++ b/ChangeLog Wed Aug 02 23:33:49 2006 -0700 @@ -1,3 +1,12 @@ +2006-08-03 05:57:08 +0000 William Pitcock + revision [1864] + - better support cuesheets outside of your directory + + + Changes: Modified: + +11 -14 trunk/Plugins/Input/cue/cuesheet.c + + 2006-08-03 05:41:00 +0000 William Pitcock revision [1862] - remove dependency on the client library. diff -r 285215fd3123 -r 5dbe7cfdcaf5 Plugins/Input/cue/cuesheet.c --- a/Plugins/Input/cue/cuesheet.c Wed Aug 02 22:57:08 2006 -0700 +++ b/Plugins/Input/cue/cuesheet.c Wed Aug 02 23:33:49 2006 -0700 @@ -25,7 +25,6 @@ #define MAX_CUE_LINE_LENGTH 1000 #define MAX_CUE_TRACKS 1000 -static void init(void); static void cache_cue_file(gchar *f); static void free_cue_info(void); static void fix_cue_argument(char *line); @@ -38,19 +37,18 @@ static TitleInput *get_tuple(gchar *uri); static TitleInput *get_tuple_uri(gchar *uri); +static gint watchdog_func(gpointer unused); + static gchar *cue_performer = NULL; static gchar *cue_title = NULL; static gchar *cue_file = NULL; static gint last_cue_track = 0; static gint cur_cue_track = 0; -static gint entry_lock = 0; static struct { gchar *performer; gchar *title; gint index; } cue_tracks[MAX_CUE_TRACKS]; -static gint previous_song = -1; -static gint previous_length = -2; static gint timeout_tag = 0; static InputPlugin *real_ip = NULL; @@ -205,6 +203,7 @@ if (real_ip != NULL) real_ip->stop(); + gtk_timeout_remove(timeout_tag); free_cue_info(); real_ip->set_info = NULL; @@ -215,7 +214,6 @@ static void set_info_override(gchar * unused, gint length, gint rate, gint freq, gint nch) { gchar *title; - (void) unused; /* annoying. */ if (playlist_position->tuple == NULL) @@ -255,6 +253,8 @@ } cur_cue_track = track; + + timeout_tag = gtk_timeout_add(100, watchdog_func, NULL); } InputPlugin *get_iplugin_info(void) @@ -263,6 +263,20 @@ return &cue_ip; } +/******************************************************* watchdog */ + +static gint watchdog_func(gpointer unused) +{ + gint time = get_output_time(); + + if (time < cue_tracks[cur_cue_track].index) + playlist_prev(); + else if (cur_cue_track != last_cue_track && (time > cue_tracks[cur_cue_track + 1].index)) + playlist_next(); + + return TRUE; +} + /******************************************************** cuefile */ static void free_cue_info(void)