diff src/xs_sidplay2.cc @ 87:94497283affa

Various fixes and improvements
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Oct 2003 10:38:03 +0000
parents ab522ab65c85
children 63cf9b2ddadf
line wrap: on
line diff
--- a/src/xs_sidplay2.cc	Sat Oct 04 08:21:01 2003 +0000
+++ b/src/xs_sidplay2.cc	Sun Oct 05 10:38:03 2003 +0000
@@ -58,9 +58,9 @@
 /*
  * Check if we can play the given file
  */
-gboolean xs_sidplay2_isourfile(gchar *pcFileName)
+gboolean xs_sidplay2_isourfile(gchar *pcFilename)
 {
- SidTune *testTune = new SidTune(pcFileName);
+ SidTune *testTune = new SidTune(pcFilename);
 
  if (!testTune) return FALSE;
  if (!testTune->getStatus())
@@ -96,9 +96,7 @@
 	}
 
  /* Initialize builder object */
- /*
-	FIXME! we need to select builder by configuration!
- */
+ XSDEBUG("init builder #%i\n", xs_cfg.sid2Builder);
 #ifdef HAVE_RESID_BUILDER
  if (xs_cfg.sid2Builder == XS_BLD_RESID)
 	{
@@ -205,15 +203,16 @@
 }
 
 
-gboolean xs_sidplay2_loadsid(t_xs_status *myStatus, gchar *pcFileName)
+gboolean xs_sidplay2_loadsid(t_xs_status *myStatus, gchar *pcFilename)
 {
  t_xs_sidplay2 *myPlayer = (t_xs_sidplay2 *) myStatus->player;
- SidTuneInfo tuneInfo;
  assert(myStatus);
 
  /* Try to get the tune */
- if (!pcFileName) return FALSE;
- if (!myPlayer->currTune->load(pcFileName)) return FALSE;
+ if (!pcFilename) return FALSE;
+XSDEBUG("paski #1\n");
+ if (!myPlayer->currTune->load(pcFilename)) return FALSE;
+XSDEBUG("paski #2\n");
 
  /* Get current configuration */
  myPlayer->currConfig = myPlayer->currEng->config();
@@ -293,6 +292,8 @@
 #endif
 #endif
 
+XSDEBUG("paski #3\n");
+
  /* Now set the emulator configuration */
  if (myPlayer->currEng->config(myPlayer->currConfig) < 0)
 	{
@@ -300,10 +301,7 @@
 	return FALSE;
 	}
 
- /* Initialize status information */
- myPlayer->currTune->getInfo(tuneInfo);
- myStatus->currSong	= tuneInfo.startSong;
- myStatus->nSongs	= tuneInfo.songs;
+XSDEBUG("paski #4\n");
 
  return TRUE;
 }
@@ -314,34 +312,20 @@
  */
 void xs_sidplay2_deletesid(t_xs_status *myStatus)
 {
- t_xs_sidplay2 *myPlayer;
  assert(myStatus);
 
-/*
- myPlayer = (t_xs_sidplay2 *) myStatus->player;
- if (!myPlayer) return;
-
- if (myPlayer->currTune)
-	{
-	delete myPlayer->currTune;
-	myPlayer->currTune = NULL;
-	}
-*/
+ /* With the current scheme of handling sidtune-loading, we don't do anything here. */
 }
 
 
-gint xs_sidplay2_gettunespeed(t_xs_status *myStatus)
-{
- return 0;
-}
-
 /*
  * Return song information
  */
-void xs_sidplay2_getsidinfo(gchar *songFileName, gchar **songTitle, gint *songLength)
-{
-}
-
+#define TFUNCTION1	xs_sidplay2_filetitle
+#define TFUNCTION2	xs_sidplay2_getsidinfo
+#define TTUNEINFO	SidTuneInfo
+#define TTUNE		SidTune
+#include "xs_sidplay.h"
 
 }	/* extern "C" */
 #endif	/* HAVE_SIDPLAY2 */