Ignore:
Timestamp:
11/07/09 23:31:32 (15 years ago)
Author:
r2d
Message:
  • update for audacious 2.1.0
  • changed build system to cmake
File:
1 copied

Legend:

Unmodified
Added
Removed
  • bmp-musepack/trunk/libmpc.h

    r455 r456  
    1 /*
    2  * Copyright (c) 2005, The Musepack Development Team
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are
    7  * met:
    8  *
    9  *     * Redistributions of source code must retain the above copyright
    10  *       notice, this list of conditions and the following disclaimer.
    11  *
    12  *     * Redistributions in binary form must reproduce the above
    13  *       copyright notice, this list of conditions and the following
    14  *       disclaimer in the documentation and/or other materials provided
    15  *       with the distribution.
    16  *
    17  *     * Neither the name of the The Musepack Development Team nor the
    18  *       names of its contributors may be used to endorse or promote
    19  *       products derived from this software without specific prior
    20  *       written permission.
    21  *
    22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    26  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    33  */
    34 
    351#ifndef XMMS_MUSEPACK
    362#define XMMS_MUSEPACK
     
    406{
    417#include <audacious/plugin.h>
    42 #include <audacious/util.h>
    43 #include <audacious/configdb.h>
    44 #include <audacious/strings.h>
     8#include <audacious/output.h>
     9#include <audacious/i18n.h>
    4510}
    4611
     
    4914#include <stdio.h>
    5015#include <stdlib.h>
    51 #include <pthread.h>
    5216#include <unistd.h>
    5317#include <math.h>
     
    6529#include <taglib/mpcfile.h>
    6630
    67 #include "equalizer.h"
    68 
    69 #ifndef M_LN10
    70 #define M_LN10    2.3025850929940456840179914546843642
    71 #endif
    72 
    73 typedef struct PluginConfig
     31struct PluginConfig
    7432{
    7533    gboolean clipPrevention;
     
    7735    gboolean replaygain;
    7836    gboolean albumGain;
    79     gboolean isEq;
    8037};
    8138
    82 typedef struct Widgets
     39struct Widgets
    8340{
    8441    GtkWidget* aboutBox;
     
    9956};
    10057
    101 typedef struct MpcDecoder
     58struct MpcDecoder
    10259{
    103     char*      isError;
    104     double     offset;
     60    gchar*     isError;
     61    long long  offset;
    10562    bool       isOutput;
    10663    bool       isAlive;
     
    10865};
    10966
    110 typedef struct TrackInfo
     67struct TrackInfo
    11168{
    112     int   bitrate;
    113     char* display;
    114     int   length;
    115     int   sampleFreq;
    116     int   channels;
     69    gint   bitrate;
     70    gchar* display;
     71    gint   length;
     72    gint   sampleFreq;
     73    gint   channels;
    11774};
    11875
    119 typedef struct MpcInfo
     76struct MpcInfo
    12077{
    121     char*    title;
    122     char*    artist;
    123     char*    album;
    124     char*    comment;
    125     char*    genre;
    126     char*    date;
    127     unsigned track;
    128     unsigned year;
     78    gchar*    title;
     79    gchar*    artist;
     80    gchar*    album;
     81    gchar*    comment;
     82    gchar*    genre;
     83    gchar*    date;
     84    unsigned  track;
     85    unsigned  year;
    12986};
    13087
    131 extern "C" InputPlugin * get_iplugin_info(void);
    132 
    133 static void       mpcOpenPlugin();
    134 static void       mpcAboutBox();
    135 static void       mpcConfigBox();
    13688static void       toggleSwitch(GtkWidget*, gpointer);
    13789static void       saveConfigBox(GtkWidget*, gpointer);
    138 static int        mpcIsOurFile(char*);
    139 static void       mpcPlay(char*);
    140 static void       mpcStop();
    141 static void       mpcPause(short);
    142 static void       mpcSeek(int);
    143 static void       mpcSetEq(int, float, float*);
    144 static int        mpcGetTime();
    145 static void       mpcClosePlugin();
    146 static void       mpcGetSongInfo(char*, char**, int*);
    147 static void       freeTags(MpcInfo&);
    148 static MpcInfo    getTags(const char*);
    149 static void       mpcFileInfoBox(char*);
    150 static void       mpcGtkPrintLabel(GtkWidget*, char*, ...);
    151 static GtkWidget* mpcGtkTagLabel(char*, int, int, int, int, GtkWidget*);
    152 static GtkWidget* mpcGtkTagEntry(int, int, int, int, int, GtkWidget*);
    153 static GtkWidget* mpcGtkLabel(GtkWidget*);
    154 static GtkWidget* mpcGtkButton(char*, GtkWidget*);
    155 static void       removeTags(GtkWidget*, gpointer);
    156 static void       saveTags(GtkWidget*, gpointer);
    15790static void       closeInfoBox(GtkWidget*, gpointer);
    158 static char*      mpcGenerateTitle(const MpcInfo&, const char*);
    159 static void       lockAcquire();
    160 static void       lockRelease();
    161 static void*      decodeStream(void*);
    162 static int        processBuffer(MPC_SAMPLE_FORMAT*, char*, mpc_demux&);
    163 static void*      endThread(char*, FILE*, bool);
    164 static bool       isAlive();
    165 static void       setAlive(bool);
    166 static double     getOffset();
    167 static void       setOffset(double);
    168 static bool       isPause();
    169 static void       setReplaygain(mpc_demux *);
     91static void*      decodeStream(InputPlayback*);
    17092
    17193#ifdef MPC_FIXED_POINT
     
    186108    int clipMax    = (1 << (pSize - 1)) - 1;
    187109    int floatScale =  1 << (pSize - 1);
    188     for (unsigned n = 0; n < pLength; n++)
     110    for (unsigned n = 0; n < 2 * pLength; n++)
    189111    {
    190112        int val;
Note: See TracChangeset for help on using the changeset viewer.