Index: bmp-musepack/trunk/libmpc.h
===================================================================
--- bmp-musepack/trunk/src/libmpc.h	(revision 455)
+++ bmp-musepack/trunk/libmpc.h	(revision 456)
@@ -1,36 +1,2 @@
-/*
- * Copyright (c) 2005, The Musepack Development Team
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *
- *     * Redistributions in binary form must reproduce the above
- *       copyright notice, this list of conditions and the following
- *       disclaimer in the documentation and/or other materials provided
- *       with the distribution.
- *
- *     * Neither the name of the The Musepack Development Team nor the
- *       names of its contributors may be used to endorse or promote
- *       products derived from this software without specific prior
- *       written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
 #ifndef XMMS_MUSEPACK
 #define XMMS_MUSEPACK
@@ -40,7 +6,6 @@
 {
 #include <audacious/plugin.h>
-#include <audacious/util.h>
-#include <audacious/configdb.h>
-#include <audacious/strings.h>
+#include <audacious/output.h>
+#include <audacious/i18n.h>
 }
 
@@ -49,5 +14,4 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <pthread.h>
 #include <unistd.h>
 #include <math.h>
@@ -65,11 +29,5 @@
 #include <taglib/mpcfile.h>
 
-#include "equalizer.h"
-
-#ifndef M_LN10
-#define M_LN10    2.3025850929940456840179914546843642
-#endif
-
-typedef struct PluginConfig
+struct PluginConfig
 {
     gboolean clipPrevention;
@@ -77,8 +35,7 @@
     gboolean replaygain;
     gboolean albumGain;
-    gboolean isEq;
 };
 
-typedef struct Widgets
+struct Widgets
 {
     GtkWidget* aboutBox;
@@ -99,8 +56,8 @@
 };
 
-typedef struct MpcDecoder
+struct MpcDecoder
 {
-    char*      isError;
-    double     offset;
+    gchar*     isError;
+    long long  offset;
     bool       isOutput;
     bool       isAlive;
@@ -108,64 +65,29 @@
 };
 
-typedef struct TrackInfo
+struct TrackInfo
 {
-    int   bitrate;
-    char* display;
-    int   length;
-    int   sampleFreq;
-    int   channels;
+    gint   bitrate;
+    gchar* display;
+    gint   length;
+    gint   sampleFreq;
+    gint   channels;
 };
 
-typedef struct MpcInfo
+struct MpcInfo
 {
-    char*    title;
-    char*    artist;
-    char*    album;
-    char*    comment;
-    char*    genre;
-    char*    date;
-    unsigned track;
-    unsigned year;
+    gchar*    title;
+    gchar*    artist;
+    gchar*    album;
+    gchar*    comment;
+    gchar*    genre;
+    gchar*    date;
+    unsigned  track;
+    unsigned  year;
 };
 
-extern "C" InputPlugin * get_iplugin_info(void);
-
-static void       mpcOpenPlugin();
-static void       mpcAboutBox();
-static void       mpcConfigBox();
 static void       toggleSwitch(GtkWidget*, gpointer);
 static void       saveConfigBox(GtkWidget*, gpointer);
-static int        mpcIsOurFile(char*);
-static void       mpcPlay(char*);
-static void       mpcStop();
-static void       mpcPause(short);
-static void       mpcSeek(int);
-static void       mpcSetEq(int, float, float*);
-static int        mpcGetTime();
-static void       mpcClosePlugin();
-static void       mpcGetSongInfo(char*, char**, int*);
-static void       freeTags(MpcInfo&);
-static MpcInfo    getTags(const char*);
-static void       mpcFileInfoBox(char*);
-static void       mpcGtkPrintLabel(GtkWidget*, char*, ...);
-static GtkWidget* mpcGtkTagLabel(char*, int, int, int, int, GtkWidget*);
-static GtkWidget* mpcGtkTagEntry(int, int, int, int, int, GtkWidget*);
-static GtkWidget* mpcGtkLabel(GtkWidget*);
-static GtkWidget* mpcGtkButton(char*, GtkWidget*);
-static void       removeTags(GtkWidget*, gpointer);
-static void       saveTags(GtkWidget*, gpointer);
 static void       closeInfoBox(GtkWidget*, gpointer);
-static char*      mpcGenerateTitle(const MpcInfo&, const char*);
-static void       lockAcquire();
-static void       lockRelease();
-static void*      decodeStream(void*);
-static int        processBuffer(MPC_SAMPLE_FORMAT*, char*, mpc_demux&);
-static void*      endThread(char*, FILE*, bool);
-static bool       isAlive();
-static void       setAlive(bool);
-static double     getOffset();
-static void       setOffset(double);
-static bool       isPause();
-static void       setReplaygain(mpc_demux *);
+static void*      decodeStream(InputPlayback*);
 
 #ifdef MPC_FIXED_POINT
@@ -186,5 +108,5 @@
     int clipMax    = (1 << (pSize - 1)) - 1;
     int floatScale =  1 << (pSize - 1);
-    for (unsigned n = 0; n < pLength; n++)
+    for (unsigned n = 0; n < 2 * pLength; n++)
     {
         int val;
