changeset 387:7f0e78f42032 trunk

[svn] Disable adplug if the includes are missing (or in a very lame place). Stop blowing holes in my ship.
author chainsaw
date Tue, 03 Jan 2006 14:25:32 -0800
parents 1f278b7d6f58
children 14e3cf397729
files Plugins/Input/aac/src/aac_utils.c Plugins/Input/aac/src/fileinfo.c Plugins/Input/aac/src/libmp4.c Plugins/Input/aac/src/tagging.h Plugins/Input/adplug/core/adplug.cpp Plugins/Input/adplug/core/database.cpp Plugins/Input/adplug/core/database.h Plugins/Input/adplug/core/dmo.cpp Plugins/Input/adplug/core/fprovide.cpp Plugins/Input/adplug/core/fprovide.h configure.ac
diffstat 11 files changed, 69 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/aac/src/aac_utils.c	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/aac/src/aac_utils.c	Tue Jan 03 14:25:32 2006 -0800
@@ -65,10 +65,6 @@
     if(!g_strncasecmp(header, "ID3", 3)){
       break;
     }
-    if(!((header[0]==0xFF)&&((header[1]& 0xF6)==0xF0))){
-      printf("error : Bad 1st header, file may be corrupt !\n");
-      break;
-    }
     if(!frameCount){
       id=header[1]&0x08;
       if(((*seekTable) = malloc(SEEK_TABLE_CHUNK * sizeof(unsigned long)))==0){
--- a/Plugins/Input/aac/src/fileinfo.c	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/aac/src/fileinfo.c	Tue Jan 03 14:25:32 2006 -0800
@@ -91,6 +91,7 @@
     return src - start;
 }
 
+#if 0
 static void
 set_entry_tag(GtkEntry * entry, gchar * tag, gint length)
 {
@@ -124,6 +125,7 @@
 {
     gtk_button_clicked(GTK_BUTTON(save));
 }
+#endif
 
 static gint
 genre_comp_func(gconstpointer a, gconstpointer b)
@@ -150,6 +152,7 @@
     return TRUE;
 }
 
+#if 0
 static void
 label_set_text(GtkWidget * label, gchar * str, ...)
 {
@@ -162,6 +165,7 @@
 
     gtk_label_set_text(GTK_LABEL(label), tempstr);
 }
+#endif
 
 static void
 change_buttons(GtkObject * object)
@@ -312,7 +316,6 @@
 
         pango_attr_list_unref(attrs);
 
-#if 0
         label = gtk_label_new(_("Genre:"));
         gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
         gtk_label_set_attributes(GTK_LABEL(label), attrs);
@@ -326,7 +329,7 @@
             for (i = 0; i < GENRE_MAX; i++)
                 genre_list =
                     g_list_prepend(genre_list,
-                                   (gchar *) mpg123_id3_genres[i]);
+                                   (gchar *) audmp4_id3_genres[i]);
             genre_list = g_list_prepend(genre_list, "");
             genre_list = g_list_sort(genre_list, genre_comp_func);
         }
@@ -335,7 +338,6 @@
         gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 6, 5, 6,
                          GTK_FILL | GTK_EXPAND | GTK_SHRINK,
                          GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5);
-#endif
 
         boxx = gtk_hbutton_box_new();
         gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_SPREAD);
@@ -369,10 +371,8 @@
                                  G_CALLBACK(change_buttons), save);
         g_signal_connect_swapped(G_OBJECT(tracknum_entry), "changed",
                                  G_CALLBACK(change_buttons), save);
-#if 0
         g_signal_connect_swapped(G_OBJECT(GTK_COMBO(genre_combo)->entry), "changed",
                                  G_CALLBACK(change_buttons), save);
-#endif
         g_signal_connect(G_OBJECT(window), "key_press_event",
                          G_CALLBACK(fileinfo_keypress_cb), NULL);
     }
@@ -397,10 +397,8 @@
     gtk_entry_set_text(GTK_ENTRY(tracknum_entry), "");
     gtk_entry_set_text(GTK_ENTRY(comment_entry), "");
 
-#if 0
     gtk_list_select_item(GTK_LIST(GTK_COMBO(genre_combo)->list),
                          g_list_index(genre_list, ""));
-#endif
 
     gtk_widget_set_sensitive(id3_frame,
                              vfs_is_writeable(filename));
--- a/Plugins/Input/aac/src/libmp4.c	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/aac/src/libmp4.c	Tue Jan 03 14:25:32 2006 -0800
@@ -12,11 +12,13 @@
 */
 
 #include <glib.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <string.h>
 #include <stdlib.h>
 #include "faad.h"
 #include "mp4.h"
+#include "tagging.h"
 
 #include <audacious/plugin.h>
 #include <audacious/output.h>
@@ -28,6 +30,53 @@
 #define MP4_ABOUT	"Written by ciberfred"
 #define BUFFER_SIZE	FAAD_MIN_STREAMSIZE*64
 
+const char *audmp4_id3_genres[GENRE_MAX] = {
+    N_("Blues"), N_("Classic Rock"), N_("Country"), N_("Dance"),
+    N_("Disco"), N_("Funk"), N_("Grunge"), N_("Hip-Hop"),
+    N_("Jazz"), N_("Metal"), N_("New Age"), N_("Oldies"),
+    N_("Other"), N_("Pop"), N_("R&B"), N_("Rap"), N_("Reggae"),
+    N_("Rock"), N_("Techno"), N_("Industrial"), N_("Alternative"),
+    N_("Ska"), N_("Death Metal"), N_("Pranks"), N_("Soundtrack"),
+    N_("Euro-Techno"), N_("Ambient"), N_("Trip-Hop"), N_("Vocal"),
+    N_("Jazz+Funk"), N_("Fusion"), N_("Trance"), N_("Classical"),
+    N_("Instrumental"), N_("Acid"), N_("House"), N_("Game"),
+    N_("Sound Clip"), N_("Gospel"), N_("Noise"), N_("AlternRock"),
+    N_("Bass"), N_("Soul"), N_("Punk"), N_("Space"),
+    N_("Meditative"), N_("Instrumental Pop"),
+    N_("Instrumental Rock"), N_("Ethnic"), N_("Gothic"),
+    N_("Darkwave"), N_("Techno-Industrial"), N_("Electronic"),
+    N_("Pop-Folk"), N_("Eurodance"), N_("Dream"),
+    N_("Southern Rock"), N_("Comedy"), N_("Cult"),
+    N_("Gangsta Rap"), N_("Top 40"), N_("Christian Rap"),
+    N_("Pop/Funk"), N_("Jungle"), N_("Native American"),
+    N_("Cabaret"), N_("New Wave"), N_("Psychedelic"), N_("Rave"),
+    N_("Showtunes"), N_("Trailer"), N_("Lo-Fi"), N_("Tribal"),
+    N_("Acid Punk"), N_("Acid Jazz"), N_("Polka"), N_("Retro"),
+    N_("Musical"), N_("Rock & Roll"), N_("Hard Rock"), N_("Folk"),
+    N_("Folk/Rock"), N_("National Folk"), N_("Swing"),
+    N_("Fast-Fusion"), N_("Bebob"), N_("Latin"), N_("Revival"),
+    N_("Celtic"), N_("Bluegrass"), N_("Avantgarde"),
+    N_("Gothic Rock"), N_("Progressive Rock"),
+    N_("Psychedelic Rock"), N_("Symphonic Rock"), N_("Slow Rock"),
+    N_("Big Band"), N_("Chorus"), N_("Easy Listening"),
+    N_("Acoustic"), N_("Humour"), N_("Speech"), N_("Chanson"),
+    N_("Opera"), N_("Chamber Music"), N_("Sonata"), N_("Symphony"),
+    N_("Booty Bass"), N_("Primus"), N_("Porn Groove"),
+    N_("Satire"), N_("Slow Jam"), N_("Club"), N_("Tango"),
+    N_("Samba"), N_("Folklore"), N_("Ballad"), N_("Power Ballad"),
+    N_("Rhythmic Soul"), N_("Freestyle"), N_("Duet"),
+    N_("Punk Rock"), N_("Drum Solo"), N_("A Cappella"),
+    N_("Euro-House"), N_("Dance Hall"), N_("Goa"),
+    N_("Drum & Bass"), N_("Club-House"), N_("Hardcore"),
+    N_("Terror"), N_("Indie"), N_("BritPop"), N_("Negerpunk"),
+    N_("Polsk Punk"), N_("Beat"), N_("Christian Gangsta Rap"),
+    N_("Heavy Metal"), N_("Black Metal"), N_("Crossover"),
+    N_("Contemporary Christian"), N_("Christian Rock"),
+    N_("Merengue"), N_("Salsa"), N_("Thrash Metal"),
+    N_("Anime"), N_("JPop"), N_("Synthpop")
+};
+
+
 static void	mp4_init(void);
 static void	mp4_about(void);
 static void	mp4_play(char *);
@@ -190,6 +239,7 @@
 {
 }
 
+#if 0
 static void	mp4_getSongInfo(char *filename)
 {
   if(mp4cfg.file_type == FILE_MP4)
@@ -197,6 +247,7 @@
   else if(mp4cfg.file_type == FILE_AAC)
     ;
 }
+#endif
 
 static gchar   *mp4_get_song_title(char *filename)
 {
--- a/Plugins/Input/aac/src/tagging.h	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/aac/src/tagging.h	Tue Jan 03 14:25:32 2006 -0800
@@ -25,6 +25,7 @@
 #include <unistd.h>
 
 #include <mp4.h>
+#include "xmms-id3.h"
 
 /* XXX: We will need the same for AAC eventually */
 extern gchar *audmp4_get_artist(MP4FileHandle);
@@ -33,4 +34,7 @@
 extern gchar *audmp4_get_genre(MP4FileHandle);
 extern gint   audmp4_get_year(MP4FileHandle);
 
+#define GENRE_MAX 0x94
+extern const char *audmp4_id3_genres[GENRE_MAX];
+
 #endif
--- a/Plugins/Input/adplug/core/adplug.cpp	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/adplug.cpp	Tue Jan 03 14:25:32 2006 -0800
@@ -20,7 +20,7 @@
  */
 
 #include <string>
-#include <libbinio/binfile.h>
+#include <binfile.h>
 
 #include "adplug.h"
 #include "debug.h"
--- a/Plugins/Input/adplug/core/database.cpp	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/database.cpp	Tue Jan 03 14:25:32 2006 -0800
@@ -21,8 +21,8 @@
  * Copyright (c) 2002, 2003 Simon Peter <dn.tlp@gmx.net>
  */
 
-#include <libbinio/binio.h>
-#include <libbinio/binfile.h>
+#include <binio.h>
+#include <binfile.h>
 #include <string.h>
 
 #include "database.h"
--- a/Plugins/Input/adplug/core/database.h	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/database.h	Tue Jan 03 14:25:32 2006 -0800
@@ -26,7 +26,7 @@
 
 #include <iostream>
 #include <string>
-#include <libbinio/binio.h>
+#include <binio.h>
 
 class CAdPlugDatabase
 {
--- a/Plugins/Input/adplug/core/dmo.cpp	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/dmo.cpp	Tue Jan 03 14:25:32 2006 -0800
@@ -26,7 +26,7 @@
 */
 
 #include <string.h>
-#include <libbinio/binstr.h>
+#include <binstr.h>
 
 #include "dmo.h"
 #include "debug.h"
--- a/Plugins/Input/adplug/core/fprovide.cpp	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/fprovide.cpp	Tue Jan 03 14:25:32 2006 -0800
@@ -20,8 +20,8 @@
  */
 
 #include <string.h>
-#include <libbinio/binio.h>
-#include <libbinio/binfile.h>
+#include <binio.h>
+#include <binfile.h>
 
 #include "fprovide.h"
 
--- a/Plugins/Input/adplug/core/fprovide.h	Tue Jan 03 13:22:40 2006 -0800
+++ b/Plugins/Input/adplug/core/fprovide.h	Tue Jan 03 14:25:32 2006 -0800
@@ -23,7 +23,7 @@
 #define H_ADPLUG_FILEPROVIDER
 
 #include <string>
-#include <libbinio/binio.h>
+#include <binio.h>
 
 class CFileProvider
 {
--- a/configure.ac	Tue Jan 03 13:22:40 2006 -0800
+++ b/configure.ac	Tue Jan 03 14:25:32 2006 -0800
@@ -318,6 +318,7 @@
 
 if test "$enable_adplug" = "yes"; then
     AC_CHECK_LIB([binio],[main],[have_adplug=yes],[have_adplug=no])
+    AC_CHECK_HEADER(<binio.h>,,[have_adplug=no])
 else
     AC_MSG_RESULT([*** AdPlug plugin disabled per user request ***])
     have_adplug="no"