diff src/xs_sidplay.h @ 527:fe8b41abd923

Now everything necessary should be using the VFS functions.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 20 Feb 2007 18:09:04 +0000
parents fa95d942f226
children eafcd84a8c59
line wrap: on
line diff
--- a/src/xs_sidplay.h	Tue Feb 20 16:53:05 2007 +0000
+++ b/src/xs_sidplay.h	Tue Feb 20 18:09:04 2007 +0000
@@ -25,19 +25,27 @@
 /* This function gets most of the information, though we do miss some
  * (those variables that are only set by libSIDPlay when tune is initialized).
  * Rest of the information is acquired in TFUNCTION2()
- *
- * NOTICE! FIXME?! It might be faster to use a SID-parser of our own here,
- * thought it might make us bit incompatible ...
  */
 t_xs_tuneinfo *TFUNCTION(gchar *sidFilename)
 {
 	t_xs_tuneinfo *pResult;
 	TTUNEINFO myInfo;
 	TTUNE *myTune;
+	guint8 *buf = NULL;
+	size_t bufSize = 0;
 
+	/* 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(sidFilename)) == NULL)
+	if ((myTune = new TTUNE(buf, bufSize)) == NULL) {
+		g_free(buf);
 		return NULL;
+	}
+	g_free(buf);
 
 	if (!myTune->getStatus()) {
 		delete myTune;