changeset 254:cdf9756d1528 trunk

[svn] Port to NewVFS file probe.
author chainsaw
date Sat, 18 Nov 2006 11:00:22 -0800
parents ab24cfe495e0
children 902605dec467
files ChangeLog src/musepack/libmpc.cxx src/musepack/libmpc.h
diffstat 3 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Nov 18 10:02:24 2006 -0800
+++ b/ChangeLog	Sat Nov 18 11:00:22 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-18 18:02:24 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [524]
+  Port to NewVFS file probe & add explicit cast to silence warning, thanks to spb.
+  trunk/src/wavpack/Makefile       |    2 ++
+  trunk/src/wavpack/libwavpack.cxx |   23 +++++++++++------------
+  2 files changed, 13 insertions(+), 12 deletions(-)
+
+
 2006-11-18 18:01:53 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [522]
   Port to NewVFS file probe.
--- a/src/musepack/libmpc.cxx	Sat Nov 18 10:02:24 2006 -0800
+++ b/src/musepack/libmpc.cxx	Sat Nov 18 11:00:22 2006 -0800
@@ -15,7 +15,7 @@
     mpcOpenPlugin,  //Open Plugin               [CALLBACK]
     mpcAboutBox,    //Show About box            [CALLBACK]
     mpcConfigBox,   //Show Configure box        [CALLBACK]
-    mpcIsOurFile,   //Check if it's our file    [CALLBACK]
+    NULL,           //Check if it's our file    [DEPRECATED]
     NULL,           //Scan the directory        [UNUSED]
     mpcPlay,        //Play                      [CALLBACK]
     mpcStop,        //Stop                      [CALLBACK]
@@ -33,7 +33,10 @@
     mpcGetSongInfo, //Get Title String callback [CALLBACK]
     mpcFileInfoBox, //Show File Info Box        [CALLBACK]
     NULL,           //Output Plugin Handle      OutputPlugin output
-    mpcGetSongTuple,
+    mpcGetSongTuple,//Acquire tuple for song    [CALLBACK]
+    NULL,
+    NULL,
+    mpcIsOurFD,
 };
 
 extern "C"
@@ -271,19 +274,13 @@
     gtk_widget_destroy (widgets.configBox);
 }
 
-static int mpcIsOurFile(char* p_Filename)
+static int mpcIsOurFD(char* p_Filename, VFSFile* file)
 {
-   VFSFile *file;
-   gchar magic[3];
-   if ((file = vfs_fopen(p_Filename, "rb"))) {
-       vfs_fread(magic, 1, 3, file);
-       if (!strncmp(magic, "MP+", 3)) {
-            vfs_fclose(file);
-            return 1;
-       }
-       vfs_fclose(file);
-   }
-   return 0;
+    gchar magic[3];
+    vfs_fread(magic, 1, 3, file);
+    if (!strncmp(magic, "MP+", 3))
+        return 1;
+    return 0;
 }
 
 static void mpcPlay(char* p_Filename)
--- a/src/musepack/libmpc.h	Sat Nov 18 10:02:24 2006 -0800
+++ b/src/musepack/libmpc.h	Sat Nov 18 11:00:22 2006 -0800
@@ -102,7 +102,7 @@
 static void       mpcConfigBox();
 static void       toggleSwitch(GtkWidget*, gpointer);
 static void       saveConfigBox(GtkWidget*, gpointer);
-static int        mpcIsOurFile(char*);
+static int        mpcIsOurFD(char*,VFSFile* file);
 static void       mpcPlay(char*);
 static void       mpcStop();
 static void       mpcPause(short);