changeset 2233:0de647993c2a

- make use of AUDDBG - eliminate warnings
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sun, 16 Dec 2007 18:18:03 +0900
parents 9d2d7061caed
children ef61e0c66000 2769f4aaa2fd
files src/wavpack/libwavpack.cxx src/wavpack/tags.cxx src/wavpack/tags.h src/wavpack/ui.cxx
diffstat 4 files changed, 50 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/src/wavpack/libwavpack.cxx	Sat Dec 15 01:17:05 2007 +0900
+++ b/src/wavpack/libwavpack.cxx	Sun Dec 16 18:18:03 2007 +0900
@@ -1,3 +1,5 @@
+// #define AUD_DEBUG 1
+
 #include <string>
 
 #include <assert.h>
@@ -24,12 +26,6 @@
 #define M_LN10   2.3025850929940456840179914546843642
 #endif
 
-#ifdef DEBUG
-# define DBG(format, args...) fprintf(stderr, format, ## args)
-#else
-# define DBG(format, args...)
-#endif
-
 #define BUFFER_SIZE 256 // read buffer size, in samples
 
 static void wv_load_config();
@@ -42,7 +38,7 @@
 static int wv_get_time(InputPlayback *);
 static void wv_get_song_info(char *, char **, int *);
 static char *generate_title(const char *, WavpackContext *ctx);
-static double isSeek;
+static int isSeek;
 static short paused;
 static bool killDecodeThread;
 static bool AudioError;
@@ -305,11 +301,10 @@
 static void *
 DecodeThread(InputPlayback *playback)
 {
-    ape_tag tag;
+    int bps;
+#ifdef AUD_DEBUG
     char *filename = playback->filename;
-    int bps_updateCounter = 0;
-    int bps;
-    int i;
+#endif
     WavpackDecoder d(&mod);
 
     if (!d.attach_to_play(playback)) {
@@ -317,25 +312,26 @@
         return end_thread();
     }
     bps = WavpackGetBytesPerSample(d.ctx) * d.num_channels;
-    DBG("reading %s at %d rate with %d channels\n", filename, d.sample_rate, d.num_channels);
+    AUDDBG("reading %s at %d rate with %d channels\n", filename, d.sample_rate, d.num_channels);
 
     if (!d.open_audio()) {
-        DBG("error opening audio channel\n");
+        AUDDBG("error opening audio channel\n");
         killDecodeThread = true;
         AudioError = true;
         openedAudio = false;
     }
     else {
-        DBG("opened audio channel\n");
+        AUDDBG("opened audio channel\n");
         openedAudio = true;
     }
     unsigned status;
+#if 0
     char *display = generate_title(filename, d.ctx);
     int length = (int) (1000 * WavpackGetNumSamples(d.ctx));
-
+#endif
     while (!killDecodeThread) {
         if (isSeek != -1) {
-            DBG("seeking to position %d\n", isSeek);
+            AUDDBG("seeking to position %d\n", isSeek);
             WavpackSeekSample(d.ctx, (int)(isSeek * d.sample_rate));
             isSeek = -1;
         }
@@ -477,12 +473,14 @@
     }
 
     int sample_rate = WavpackGetSampleRate(d.ctx);
+#ifdef AUD_DEBUG
     int num_channels = WavpackGetNumChannels(d.ctx);
-    DBG("reading %s at %d rate with %d channels\n", filename, sample_rate, num_channels);
+#endif
+    AUDDBG("reading %s at %d rate with %d channels\n", filename, sample_rate, num_channels);
 
     *length = (int)(WavpackGetNumSamples(d.ctx) / sample_rate) * 1000,
     *title = generate_title(filename, d.ctx);
-    DBG("title for %s = %s\n", filename, *title);
+    AUDDBG("title for %s = %s\n", filename, *title);
 }
 
 static int
--- a/src/wavpack/tags.cxx	Sat Dec 15 01:17:05 2007 +0900
+++ b/src/wavpack/tags.cxx	Sun Dec 16 18:18:03 2007 +0900
@@ -9,6 +9,35 @@
 #include <audacious/plugin.h>
 #include "tags.h"
 
+static const char*  GenreList [] = {
+    "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
+    "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
+    "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska",
+    "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient",
+    "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical",
+    "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise",
+    "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative",
+    "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
+    "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
+    "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap",
+    "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave",
+    "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal",
+    "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll",
+    "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion",
+    "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
+    "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock",
+    "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour",
+    "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony",
+    "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club",
+    "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul",
+    "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House",
+    "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
+    "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", "Christian Gangsta",
+    "Heavy Metal", "Black Metal", "Crossover", "Contemporary C",
+    "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
+    "SynthPop"
+};
+
 struct APETagFooterStruct {
     unsigned char ID[8];
     unsigned char Version[4];
--- a/src/wavpack/tags.h	Sat Dec 15 01:17:05 2007 +0900
+++ b/src/wavpack/tags.h	Sun Dec 16 18:18:03 2007 +0900
@@ -20,35 +20,6 @@
     int     _genre;
 } ape_tag;
 
-static const char*  GenreList [] = {
-    "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
-    "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
-    "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska",
-    "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient",
-    "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical",
-    "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise",
-    "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative",
-    "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
-    "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
-    "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap",
-    "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave",
-    "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal",
-    "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll",
-    "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion",
-    "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
-    "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock",
-    "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour",
-    "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony",
-    "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club",
-    "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul",
-    "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House",
-    "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
-    "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", "Christian Gangsta",
-    "Heavy Metal", "Black Metal", "Crossover", "Contemporary C",
-    "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
-    "SynthPop"
-};
-
 int utf8ToUnicode ( const char* lpMultiByteStr, wchar_t* lpWideCharStr, int cmbChars );
 
 int GetTageType ( FILE *fp );
--- a/src/wavpack/ui.cxx	Sat Dec 15 01:17:05 2007 +0900
+++ b/src/wavpack/ui.cxx	Sun Dec 16 18:18:03 2007 +0900
@@ -1,3 +1,5 @@
+// #define AUD_DEBUG 1
+
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
@@ -21,8 +23,6 @@
 #define M_LN10   2.3025850929940456840179914546843642
 #endif
 
-#define DBG(format, args...) fprintf(stderr, format, ## args)
-
 void load_tag(ape_tag *tag, WavpackContext *ctx);
 gboolean clipPreventionEnabled;
 gboolean dynBitrateEnabled;
@@ -118,10 +118,12 @@
         printf("wavpack: Error opening file: \"%s: %s\"\n", fn, error_buff);
         return;
     }
+#ifdef AUD_DEBUG
     int sample_rate = WavpackGetSampleRate(ctx);
     int num_channels = WavpackGetNumChannels(ctx);
+#endif
     load_tag(&tag, ctx);
-    DBG("opened %s at %d rate with %d channels\n", fn, sample_rate, num_channels);
+    AUDDBG("opened %s at %d rate with %d channels\n", fn, sample_rate, num_channels);
 
     filename = g_strdup(fn);
     static GtkWidget *info_frame, *info_box, *bitrate_label, *rate_label;