# HG changeset patch # User Matti Hamalainen # Date 1103706423 0 # Node ID 2316e524d67bd66c0a2e2098e5de4ee860d2bde4 # Parent d7b7d49b52fe0679a33380704e42ea522d6b4366 Improved comments. diff -r d7b7d49b52fe -r 2316e524d67b src/xmms-sid.c --- a/src/xmms-sid.c Wed Dec 22 08:33:02 2004 +0000 +++ b/src/xmms-sid.c Wed Dec 22 09:07:03 2004 +0000 @@ -266,6 +266,8 @@ XS_MUTEX_LOCK(xs_status); memcpy(&myStatus, &xs_status, sizeof(t_xs_status)); myTune = xs_status.tuneInfo; + + XS_MUTEX_UNLOCK(xs_status); /* Allocate audio buffer */ @@ -390,7 +392,7 @@ XSDEBUG("subtune ended/stopped\n"); - /* Close audio */ + /* Close audio output plugin */ if (audioOpen) { XSDEBUG("close audio #1\n"); @@ -399,11 +401,15 @@ } /* Now determine if we continue by selecting other subtune or something */ - if (!myStatus.isPlaying) doPlay = FALSE; + if (!myStatus.isPlaying) + { + /* FIXME FIX ME! !! subtunet joo ja tuota eli */ + doPlay = FALSE; + } } xs_err_exit: - /* Close audio */ + /* Close audio output plugin */ if (audioOpen) { XSDEBUG("close audio #2\n"); @@ -414,13 +420,17 @@ g_free(audioBuffer); #endif - /* Exit the playing thread */ - XSDEBUG("exiting thread, bye.\n"); - + /* Set playing status to false (stopped), thus when + * XMMS next calls xs_get_time(), it can return appropriate + * value "not playing" status and XMMS knows to move to + * next entry in the playlist .. or whatever it wishes. + */ XS_MUTEX_LOCK(xs_status); xs_status.isPlaying = FALSE; XS_MUTEX_UNLOCK(xs_status); + /* Exit the playing thread */ + XSDEBUG("exiting thread, bye.\n"); pthread_exit(NULL); } @@ -438,7 +448,8 @@ XSDEBUG("play '%s'\n", pcFilename); /* Get tune information */ - if ((xs_status.tuneInfo = xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) + if ((xs_status.tuneInfo = + xs_status.sidPlayer->plrGetSIDInfo(pcFilename)) == NULL) return; /* Initialize the tune */ @@ -465,6 +476,10 @@ xs_status.sidPlayer->plrDeleteSID(&xs_status); } + /* Okay, here the playing thread has started up and we + * return from here to XMMS. Rest is up to XMMS's GUI + * and playing thread. + */ XSDEBUG("systems should be up?\n"); } @@ -474,7 +489,8 @@ * Here we set the playing status to stop and wait for playing * thread to shut down. In any "correctly" done plugin, this is * also the function where you close the output-plugin, but since - * XMMS-SID's special behaviour, we don't do that here. + * XMMS-SID has special behaviour (audio opened/closed in the + * playing thread), we don't do that here. * * Finally tune and other memory allocations are free'd. */ @@ -482,8 +498,10 @@ { XSDEBUG("STOP_REQ\n"); + /* Close the sub-tune control window, if any */ xs_subctrl_close(); + /* Lock xs_status and stop playing thread */ XS_MUTEX_LOCK(xs_status); if (xs_status.isPlaying) { @@ -496,6 +514,9 @@ XS_MUTEX_UNLOCK(xs_status); } + /* Status is now stopped, update the sub-tune + * controller in fileinfo window (if open) + */ xs_fileinfo_update(); /* Free tune information */ @@ -510,6 +531,10 @@ */ void xs_pause(short pauseState) { + XS_MUTEX_LOCK(xs_status); + /* pause... */ + XS_MUTEX_UNLOCK(xs_status); + xs_subctrl_close(); xs_fileinfo_update(); xs_plugin_ip.output->pause(pauseState); diff -r d7b7d49b52fe -r 2316e524d67b src/xs_about.c --- a/src/xs_about.c Wed Dec 22 08:33:02 2004 +0000 +++ b/src/xs_about.c Wed Dec 22 09:07:03 2004 +0000 @@ -147,7 +147,7 @@ gtk_container_add (GTK_CONTAINER (about_scrwin), about_text); gtk_widget_set_usize (about_text, -2, 100); gtk_text_insert (GTK_TEXT (about_text), NULL, NULL, NULL, - "\n\n\n" + "\n" "(C) Copyright 1999-2004\n" "\tTecnic Software productions (TNSP)\n" "\n"