changeset 28:15250dd0c326

Removed obsolete file
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 07 Jun 2003 22:52:00 +0000
parents a5e583031c41
children 831a1b1f1508
files src/xmms-sid.cc src/xs_about.c src/xs_title.h
diffstat 3 files changed, 60 insertions(+), 101 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmms-sid.cc	Sat Jun 07 17:41:05 2003 +0000
+++ b/src/xmms-sid.cc	Sat Jun 07 22:52:00 2003 +0000
@@ -4,7 +4,6 @@
    Main source file
 
    Written by Matti "ccr" Hamalainen <ccr@tnsp.org>
-   (few bits may still be by Willem Monsuwe)
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -21,29 +20,27 @@
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
+#include <pthread.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <xmms/plugin.h>
+#include <xmms/util.h>
 #include "xmms-sid.h"
 #include "xs_config.h"
 #include "xs_length.h"
 #include "xs_title.h"
+
+extern "C++" {
 #include <sidplay/player.h>
 #include <sidplay/myendian.h>
 #include <sidplay/fformat.h>
-
-extern "C" {
-#include <pthread.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-
-#include <xmms/plugin.h>
-#include <xmms/util.h>
 }
 
 
 /*
- *	Global variables
+ * Global variables
  */
 static struct emuConfig	xs_emuConf;
 static emuEngine	xs_emuEngine;
@@ -66,6 +63,18 @@
 {
  XSDEBUG("xs_init()\n");
 
+ /* Initialize and get configuration */
+ memset(&xs_cfg, 0, sizeof(xs_cfg));
+
+ xs_get_configure();
+
+ xs_status.s_error = 0;
+ xs_status.s_playing = 0;
+ xs_status.s_songs = 0;
+ xs_status.s_allownext = 1;	// Initialize to TRUE to allow first song
+ xs_status.s_tune = NULL;
+ xs_status.s_fname = NULL;
+
  /* Try to initialize libSIDPlay */
  if (!xs_emuEngine)
 	{
@@ -79,17 +88,6 @@
 	return;
 	}
 
- /* Initialize and get configuration */
- memset(&xs_cfg, 0, sizeof(xs_cfg));
- xs_get_configure();
-
- xs_status.s_error = 0;
- xs_status.s_playing = 0;
- xs_status.s_songs = 0;
- xs_status.s_allownext = 1;	// Initialize to TRUE to allow first song
- xs_status.s_tune = NULL;
- xs_status.s_fname = NULL;
-
  /* Read song-length database */
  if (xs_songlen_init() < 0)
 	{
@@ -114,15 +112,17 @@
  /* Stop playing */
  xs_plugin_ip.stop();
 
+ /* Close sub-song control window */
+
  /* Free allocated memory */
  xs_songlen_close();
 
- // FIXME FIXME: STIL-entries, songlendb
+// FIXME FIXME: STIL-entries
 }
 
 
 /*
- *	Check whether the given file is handled by this plugin
+ * Check whether the given file is handled by this plugin
  */
 gint xs_is_our_file(char *fileName)
 {
@@ -133,8 +133,8 @@
 	return FALSE;
 
  /* Try to detect via libSIDPlay's detection routine, if required */
- if (xs_cfg.detectMagic) {
-
+ if (xs_cfg.detectMagic)
+	{
 	sidTune *testTune = new sidTune(fileName);
 
 	if (!testTune) return FALSE;
@@ -166,18 +166,18 @@
 
 
 /*
- *	Playing thread loop function
+ * Main playing thread loop
  */
 static void *xs_play_loop(void *argPointer)
 {
- gchar		plr_data[XS_BUFSIZE];
- struct sidTuneInfo plr_sidInf;
- gchar		*plr_tune_title = NULL;
- gint		plr_fxlen;
- enum AFormat	plr_fmt;
- gint		plr_tune_num;
- gint32		plr_tune_len;
-	
+ guchar			plr_data[XS_BUFSIZE];
+ struct sidTuneInfo	plr_sidInf;
+ gchar			*plr_tune_title = NULL;
+ gint			plr_fxlen;
+ enum AFormat		plr_fmt;
+ gint			plr_tune_num;
+ gint32			plr_tune_len;
+
 
  /* Don't allow next song to be set yet */
  pthread_mutex_lock(&xs_mutex);
@@ -320,7 +320,7 @@
 
 
 /*
- *	Start playing the given file
+ * Start playing the given file
  */
 void xs_play_file(char *fileName)
 {
@@ -339,6 +339,7 @@
 
  XSDEBUG("tune ok, status %i\n", xs_status.s_playing);
 
+
  /* Get current configuration */
  xs_emuEngine.getConfig(xs_emuConf);
 
@@ -370,6 +371,7 @@
 		return;
  }
 
+
  /* Memory mode settings */
  switch (xs_cfg.memoryMode) {
 	case XMMS_SID_MPU_BANK_SWITCHING:
@@ -409,21 +411,26 @@
 
 
  /* Configure rest of the emulation */
- xs_emuConf.bitsPerSample = xs_cfg.fmtBitsPerSample;
- xs_emuConf.frequency = xs_cfg.fmtFrequency;
- xs_emuConf.sampleFormat = SIDEMU_SIGNED_PCM;
- xs_emuConf.mos8580 = xs_cfg.mos8580;
- xs_emuConf.emulateFilter = xs_cfg.emulateFilter;
- xs_emuConf.filterFs = xs_cfg.filterFs;
- xs_emuConf.filterFm = xs_cfg.filterFm;
- xs_emuConf.filterFt = xs_cfg.filterFt;
+ xs_emuConf.bitsPerSample	= xs_cfg.fmtBitsPerSample;
+ xs_emuConf.frequency		= xs_cfg.fmtFrequency;
+ xs_emuConf.sampleFormat	= SIDEMU_SIGNED_PCM;
+ xs_emuConf.mos8580		= xs_cfg.mos8580;
+ xs_emuConf.emulateFilter	= xs_cfg.emulateFilter;
+ xs_emuConf.filterFs		= xs_cfg.filterFs;
+ xs_emuConf.filterFm		= xs_cfg.filterFm;
+ xs_emuConf.filterFt		= xs_cfg.filterFt;
 
  XSDEBUG("configuring engine..\n");
 
+
  /* Now set the emulator configuration */
  xs_emuEngine.setConfig(xs_emuConf);
  newTune->getInfo(sidInf);
 
+
+ /* Initialize status information */
+ XSDEBUG("starting thread!\n");
+
  pthread_mutex_lock(&xs_mutex);
  xs_status.s_error = 0;
  xs_status.s_playing = sidInf.startSong;
@@ -431,8 +438,6 @@
  xs_status.s_tune = newTune;
  pthread_mutex_unlock(&xs_mutex);
 
- XSDEBUG("starting thread!\n");
-
  /* Start the playing thread! */
  if (pthread_create(&xs_decode_thread, NULL, xs_play_loop, NULL) < 0)
 	{
--- a/src/xs_about.c	Sat Jun 07 17:41:05 2003 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*  
-   xmms-sid - SIDPlay input plugin for X MultiMedia System (XMMS)
-
-   Aboutbox dialog
-   
-   Written by Matti "ccr" Hamalainen <mhamalai@ratol.fi>
-   (Created with Glade, the Gtk+ interface builder, but edited
-   by hand afterwards to make it work here)
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "xmms-sid.h"
-#include <gtk/gtk.h>
-#include "xmms-sid-logo.xpm"
-
-
-static GtkWidget *xs_aboutwin = NULL;
-
-int xs_aboutwin_ok(void)
-{
- gtk_widget_destroy(xs_aboutwin);
- return 0;
-}
-
-
-/*
- * Execute the aboutbox
- */
-void xs_aboutbox(void)
-{
- /* Check if there already is an open about window */
- if (xs_aboutwin != NULL)
- 	{
-	gdk_window_raise(xs_aboutwin->window);
-	return;
-	}
-
- /* No, create one ... */	
-}
-
--- a/src/xs_title.h	Sat Jun 07 17:41:05 2003 +0000
+++ b/src/xs_title.h	Sat Jun 07 22:52:00 2003 +0000
@@ -1,10 +1,17 @@
 #ifndef XS_TITLE_H
 #define XS_TITLE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Functions
  */
 gchar	*xs_filetitle_get(void *, gint);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* XS_TITLE_H */