Mercurial > hg > xmms-sid
diff src/xmms-sid.c @ 78:ab522ab65c85
Various fixes and improvements
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 03 Oct 2003 03:11:05 +0000 |
parents | 653c9b0d1320 |
children | b6966a2447bc |
line wrap: on
line diff
--- a/src/xmms-sid.c Fri Sep 19 23:55:01 2003 +0000 +++ b/src/xmms-sid.c Fri Oct 03 03:11:05 2003 +0000 @@ -98,28 +98,10 @@ */ static GtkWidget *xs_ctrlwin = NULL; static pthread_t xs_decode_thread; -static pthread_mutex_t xs_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t xs_mutex = PTHREAD_MUTEX_INITIALIZER; struct t_xs_cfg xs_cfg; t_xs_status xs_status; -t_xs_player *xs_player; - - -/* - * Create sub-song control window - */ -void xs_ctrlwin_open(void) -{ - /* Create sub-song control window */ - if (xs_ctrlwin != NULL) - { - if (xs_cfg.alwaysRaise) - gdk_window_raise(xs_ctrlwin->window); - return; - } - - xs_ctrlwin = create_xs_ctrlwin(); - gtk_widget_show(xs_ctrlwin); -} +t_xs_player *xs_player = NULL; /* @@ -179,8 +161,6 @@ /* Initialize STIL structures */ -// xs_ctrlwin_open(); - // FIXME FIXME FIx ME XSDEBUG("OK\n"); @@ -200,8 +180,6 @@ xs_player->plrDeleteSID(&xs_status); xs_player->plrClose(&xs_status); - /* Close sub-song control window */ - /* Free allocated memory */ xs_songlen_close(); @@ -216,6 +194,7 @@ gint xs_is_our_file(gchar *pcFileName) { char *pcExt; + assert(xs_player); /* Check the filename */ if (pcFileName == NULL) @@ -295,14 +274,13 @@ /* Get song information for current subtune */ songLength = xs_songlen_get(myStatus.currFileName, myStatus.currSong); -/* xs_plugin_ip.set_info( - myTuneInfo.titleStr, + myStatus.currFileName, (songLength > 0) ? (songLength * 1000) : -1, - 1000 * myTuneInfo.songSpeed, + 1000 * xs_player->plrGetTuneSpeed(&xs_status), audioFreq, audioChannels); -*/ + /* Open the audio output */ if (!xs_plugin_ip.output->open_audio(audioFmt, audioFreq, audioChannels)) @@ -470,14 +448,22 @@ */ void xs_seek(gint iTime) { + if (xs_cfg.subsongControl == XS_SSC_POPUP) + { + /* User wants to use the pop-up */ + } + /* If we have song-position patch, check settings */ #ifdef HAVE_SONG_POSITION - pthread_mutex_lock(&xs_mutex); + if (xs_cfg.subsongControl == XS_SSC_PATCH) + { + pthread_mutex_lock(&xs_mutex); - if ((iTime > 0) && (iTime <= xs_status.nSongs) && xs_status.isPlaying) - xs_status.currSong = iTime; + if ((iTime > 0) && (iTime <= xs_status.nSongs) && xs_status.isPlaying) + xs_status.currSong = iTime; - pthread_mutex_unlock(&xs_mutex); + pthread_mutex_unlock(&xs_mutex); + } #endif } @@ -495,11 +481,14 @@ if (!xs_status.isPlaying) return -1; - /* Obsolete? */ + /* Let's see what we do */ #ifdef HAVE_SONG_POSITION - pthread_mutex_lock(&xs_mutex); - set_song_position(xs_status.currSong, 1, xs_status.nSongs); - pthread_mutex_unlock(&xs_mutex); + if (xs_cfg.subsongControl == XS_SSC_PATCH) + { + pthread_mutex_lock(&xs_mutex); + set_song_position(xs_status.currSong, 1, xs_status.nSongs); + pthread_mutex_unlock(&xs_mutex); + } #endif /* Else, return output time reported by audio output plugin */