diff src/xs_sidplay.h @ 660:b0743dc9165d

Change tabs to 4 spaces, everywhere.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 02 Apr 2008 22:10:05 +0300
parents acaba070cf49
children 9321ffa2ea7e
line wrap: on
line diff
--- a/src/xs_sidplay.h	Wed Apr 02 21:29:26 2008 +0300
+++ b/src/xs_sidplay.h	Wed Apr 02 22:10:05 2008 +0300
@@ -28,55 +28,55 @@
  */
 xs_tuneinfo_t *TFUNCTION(const gchar *sidFilename)
 {
-	xs_tuneinfo_t *pResult;
-	TTUNEINFO myInfo;
-	TTUNE *myTune;
-	guint8 *buf = NULL;
-	size_t bufSize = 0;
+    xs_tuneinfo_t *pResult;
+    TTUNEINFO myInfo;
+    TTUNE *myTune;
+    guint8 *buf = NULL;
+    size_t bufSize = 0;
 
-	/* Load file */
-	if (!sidFilename) return NULL;
+    /* Load file */
+    if (!sidFilename) return NULL;
 
-	if (xs_fload_buffer(sidFilename, &buf, &bufSize) != 0)
-		return NULL;
-	
-	/* Check if the tune exists and is readable */
-	if ((myTune = new TTUNE(buf, bufSize)) == NULL) {
-		g_free(buf);
-		return NULL;
-	}
-	g_free(buf);
+    if (xs_fload_buffer(sidFilename, &buf, &bufSize) != 0)
+        return NULL;
+    
+    /* Check if the tune exists and is readable */
+    if ((myTune = new TTUNE(buf, bufSize)) == NULL) {
+        g_free(buf);
+        return NULL;
+    }
+    g_free(buf);
 
-	if (!myTune->getStatus()) {
-		delete myTune;
-		return NULL;
-	}
+    if (!myTune->getStatus()) {
+        delete myTune;
+        return NULL;
+    }
 
-	/* Get general tune information */
+    /* Get general tune information */
 #ifdef XS_SIDPLAY1_H
-	myTune->getInfo(myInfo);
+    myTune->getInfo(myInfo);
 #endif
 #ifdef XS_SIDPLAY2_H
-	myInfo = myTune->getInfo();
+    myInfo = myTune->getInfo();
 #endif
 
-	/* Allocate tuneinfo structure and set information */
-	pResult = xs_tuneinfo_new(sidFilename,
-		myInfo.songs, myInfo.startSong,
-		myInfo.infoString[0], myInfo.infoString[1], myInfo.infoString[2],
-		myInfo.loadAddr, myInfo.initAddr, myInfo.playAddr,
-		myInfo.dataFileLen, myInfo.formatString, myInfo.sidModel);
-	
-	/* NOTICE! libSIDPlay[12] headers specifically state that sidModel,
-	 * songSpeed and clockSpeed are "undefined" before song initialization,
-	 * but in practice sidModel is known after getInfo() invocation...
-	 * This of course does not take the sub-tune specific changes into account,
-	 * but at least we have a reasonable guesstimate.
-	 */
+    /* Allocate tuneinfo structure and set information */
+    pResult = xs_tuneinfo_new(sidFilename,
+        myInfo.songs, myInfo.startSong,
+        myInfo.infoString[0], myInfo.infoString[1], myInfo.infoString[2],
+        myInfo.loadAddr, myInfo.initAddr, myInfo.playAddr,
+        myInfo.dataFileLen, myInfo.formatString, myInfo.sidModel);
+    
+    /* NOTICE! libSIDPlay[12] headers specifically state that sidModel,
+     * songSpeed and clockSpeed are "undefined" before song initialization,
+     * but in practice sidModel is known after getInfo() invocation...
+     * This of course does not take the sub-tune specific changes into account,
+     * but at least we have a reasonable guesstimate.
+     */
 
-	delete myTune;
+    delete myTune;
 
-	return pResult;
+    return pResult;
 }
 
 
@@ -84,68 +84,68 @@
  */
 gboolean TFUNCTION2(xs_status_t *myStatus)
 {
-	TTUNEINFO myInfo;
-	TTUNE *myTune;
-	TENGINE *myEngine;
-	xs_tuneinfo_t *i;
-	
-	/* Check if we have required structures initialized */
-	if (!myStatus || !myStatus->tuneInfo || !myStatus->sidEngine)
-		return FALSE;
+    TTUNEINFO myInfo;
+    TTUNE *myTune;
+    TENGINE *myEngine;
+    xs_tuneinfo_t *i;
+    
+    /* Check if we have required structures initialized */
+    if (!myStatus || !myStatus->tuneInfo || !myStatus->sidEngine)
+        return FALSE;
 
-	myEngine = (TENGINE *) myStatus->sidEngine;
-	myTune = myEngine->currTune;
-	if (!myTune)
-		return FALSE;
+    myEngine = (TENGINE *) myStatus->sidEngine;
+    myTune = myEngine->currTune;
+    if (!myTune)
+        return FALSE;
 
-	/* Get currently playing tune information */
+    /* Get currently playing tune information */
 #ifdef XS_SIDPLAY1_H
-	myTune->getInfo(myInfo);
+    myTune->getInfo(myInfo);
 #endif
 #ifdef XS_SIDPLAY2_H
-	myInfo = myTune->getInfo();
+    myInfo = myTune->getInfo();
 #endif
 
-	/* NOTICE! Here we assume that libSIDPlay[12] headers define
-	 * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ...
-	 */
-	i = myStatus->tuneInfo;
-	i->sidModel = myInfo.sidModel;
+    /* NOTICE! Here we assume that libSIDPlay[12] headers define
+     * SIDTUNE_SIDMODEL_* similarly to our enums in xs_config.h ...
+     */
+    i = myStatus->tuneInfo;
+    i->sidModel = myInfo.sidModel;
 
-	if ((myStatus->currSong > 0) && (myStatus->currSong <= i->nsubTunes)) {
-		gint tmpSpeed = -1;
-		
-		switch (myInfo.clockSpeed) {
-		case SIDTUNE_CLOCK_PAL:
-			tmpSpeed = XS_CLOCK_PAL;
-			break;
-		case SIDTUNE_CLOCK_NTSC:
-			tmpSpeed = XS_CLOCK_NTSC;
-			break;
-		case SIDTUNE_CLOCK_ANY:
-			tmpSpeed = XS_CLOCK_ANY;
-			break;
-		case SIDTUNE_CLOCK_UNKNOWN:
-			switch (myInfo.songSpeed) {
-			case SIDTUNE_SPEED_VBI:
-				tmpSpeed = XS_CLOCK_VBI;
-				break;
-			case SIDTUNE_SPEED_CIA_1A:
-				tmpSpeed = XS_CLOCK_CIA;
-				break;
-			default:
-				tmpSpeed = myInfo.songSpeed;
-				break;
-			}
-		default:
-			tmpSpeed = myInfo.clockSpeed;
-			break;
-		}
-			
-		i->subTunes[myStatus->currSong - 1].tuneSpeed = tmpSpeed;
-	}
+    if ((myStatus->currSong > 0) && (myStatus->currSong <= i->nsubTunes)) {
+        gint tmpSpeed = -1;
+        
+        switch (myInfo.clockSpeed) {
+        case SIDTUNE_CLOCK_PAL:
+            tmpSpeed = XS_CLOCK_PAL;
+            break;
+        case SIDTUNE_CLOCK_NTSC:
+            tmpSpeed = XS_CLOCK_NTSC;
+            break;
+        case SIDTUNE_CLOCK_ANY:
+            tmpSpeed = XS_CLOCK_ANY;
+            break;
+        case SIDTUNE_CLOCK_UNKNOWN:
+            switch (myInfo.songSpeed) {
+            case SIDTUNE_SPEED_VBI:
+                tmpSpeed = XS_CLOCK_VBI;
+                break;
+            case SIDTUNE_SPEED_CIA_1A:
+                tmpSpeed = XS_CLOCK_CIA;
+                break;
+            default:
+                tmpSpeed = myInfo.songSpeed;
+                break;
+            }
+        default:
+            tmpSpeed = myInfo.clockSpeed;
+            break;
+        }
+            
+        i->subTunes[myStatus->currSong - 1].tuneSpeed = tmpSpeed;
+    }
 
-	return TRUE;
+    return TRUE;
 }
 
 /* Undefine these */