runsisi's

technical notes

audacious 2.2 ape插件patch

2018-12-20 runsisi#desktop

和上篇文章一样,只不过是适合 audacious 2.2 版本。

diff -Nur audacious-mac-0.3.10.orig/src/mac.cpp audacious-mac-0.3.10.modified/src/mac.cpp
--- audacious-mac-0.3.10.orig/src/mac.cpp    2007-10-15 17:21:33.000000000 +0800
+++ audacious-mac-0.3.10.modified/src/mac.cpp    2010-02-06 21:38:34.276458793 +0800
@@ -11,7 +11,7 @@
 #include <glib.h>
 
 const gchar *fmts[] = { "mac", "ape", "apl", NULL };
-
+//modified by runsisi@163.com
 InputPlugin mac_plugin_info =
 {
     NULL,
@@ -21,32 +21,28 @@
     NULL,
     mac_about,
     NULL,
+    NULL,
     FALSE,
+    FALSE,
+    (gchar**)fmts,
+    NULL,
     NULL,
+    mac_is_our_file_from_vfs,
     NULL,
     mac_play_file,
     mac_stop,
     mac_pause,
-    mac_seek, 
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    mac_seek,
+    mac_mseek,
     NULL,
     NULL,
     NULL,
     NULL,
     NULL,
     mac_file_info_box,
-    NULL,
     mac_get_song_tuple,
     NULL,
-    NULL,
-    mac_is_our_file_from_vfs,
-    (gchar **)fmts,
-    mac_mseek,
 };
-
 InputPlugin *mac_plugin_infolist[] = { &mac_plugin_info, NULL };
 
 SIMPLE_INPUT_PLUGIN(mac_plugin_info, mac_plugin_infolist)
@@ -295,7 +291,7 @@
              GTK_SIGNAL_FUNC(gtk_widget_destroyed), &aboutbox);
 }
 
-int mac_is_our_file_from_vfs(gchar *filename, VFSFile *file)
+int mac_is_our_file_from_vfs(const gchar *filename, VFSFile *file)
 {
     gchar magic[4];
     const gchar *ext;
@@ -383,7 +379,7 @@
     mac_mseek(playback, time * 1000);
 }
 
-Tuple *mac_get_song_tuple(gchar *uriname)
+Tuple *mac_get_song_tuple(const gchar *uriname)
 {
     int nRetVal = 0;
     char *filename;
diff -Nur audacious-mac-0.3.10.orig/src/mac.h audacious-mac-0.3.10.modified/src/mac.h
--- audacious-mac-0.3.10.orig/src/mac.h    2007-09-08 20:04:35.000000000 +0800
+++ audacious-mac-0.3.10.modified/src/mac.h    2010-02-06 21:16:39.478580938 +0800
@@ -44,10 +44,10 @@
 #ifdef __cplusplus
 extern "C"{
 #endif
-
+//modified by runsisi@163.com
 static void mac_about();
 
-static int mac_is_our_file_from_vfs(gchar *filename, VFSFile *file);
+static int mac_is_our_file_from_vfs(const gchar *filename, VFSFile *file);
 
 static void mac_play_file(InputPlayback *data);
 
@@ -59,9 +59,9 @@
 
 static void mac_seek(InputPlayback *data, int time);
 
-static Tuple *mac_get_song_tuple(gchar *filename);
+static Tuple *mac_get_song_tuple(const gchar *filename);
 
-void mac_file_info_box(char *filename);
+void mac_file_info_box(const char *filename);
 
 #ifdef __cplusplus
 }