Changeset 456 for bmp-musepack/trunk/libmpc.h
- Timestamp:
- 11/07/09 23:31:32 (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
bmp-musepack/trunk/libmpc.h
r455 r456 1 /*2 * Copyright (c) 2005, The Musepack Development Team3 * All rights reserved.4 *5 * Redistribution and use in source and binary forms, with or without6 * modification, are permitted provided that the following conditions are7 * met:8 *9 * * Redistributions of source code must retain the above copyright10 * notice, this list of conditions and the following disclaimer.11 *12 * * Redistributions in binary form must reproduce the above13 * copyright notice, this list of conditions and the following14 * disclaimer in the documentation and/or other materials provided15 * with the distribution.16 *17 * * Neither the name of the The Musepack Development Team nor the18 * names of its contributors may be used to endorse or promote19 * products derived from this software without specific prior20 * written permission.21 *22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.33 */34 35 1 #ifndef XMMS_MUSEPACK 36 2 #define XMMS_MUSEPACK … … 40 6 { 41 7 #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> 45 10 } 46 11 … … 49 14 #include <stdio.h> 50 15 #include <stdlib.h> 51 #include <pthread.h>52 16 #include <unistd.h> 53 17 #include <math.h> … … 65 29 #include <taglib/mpcfile.h> 66 30 67 #include "equalizer.h" 68 69 #ifndef M_LN10 70 #define M_LN10 2.3025850929940456840179914546843642 71 #endif 72 73 typedef struct PluginConfig 31 struct PluginConfig 74 32 { 75 33 gboolean clipPrevention; … … 77 35 gboolean replaygain; 78 36 gboolean albumGain; 79 gboolean isEq;80 37 }; 81 38 82 typedefstruct Widgets39 struct Widgets 83 40 { 84 41 GtkWidget* aboutBox; … … 99 56 }; 100 57 101 typedefstruct MpcDecoder58 struct MpcDecoder 102 59 { 103 char*isError;104 doubleoffset;60 gchar* isError; 61 long long offset; 105 62 bool isOutput; 106 63 bool isAlive; … … 108 65 }; 109 66 110 typedefstruct TrackInfo67 struct TrackInfo 111 68 { 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; 117 74 }; 118 75 119 typedefstruct MpcInfo76 struct MpcInfo 120 77 { 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; 129 86 }; 130 87 131 extern "C" InputPlugin * get_iplugin_info(void);132 133 static void mpcOpenPlugin();134 static void mpcAboutBox();135 static void mpcConfigBox();136 88 static void toggleSwitch(GtkWidget*, gpointer); 137 89 static 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);157 90 static 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 *); 91 static void* decodeStream(InputPlayback*); 170 92 171 93 #ifdef MPC_FIXED_POINT … … 186 108 int clipMax = (1 << (pSize - 1)) - 1; 187 109 int floatScale = 1 << (pSize - 1); 188 for (unsigned n = 0; n < pLength; n++)110 for (unsigned n = 0; n < 2 * pLength; n++) 189 111 { 190 112 int val;
Note: See TracChangeset
for help on using the changeset viewer.