* *** IMPORTANT:
* *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched
* OUT error[0,max_order-1] error for each order
- *
+ *
* Example: if max_order is 9, the LP coefficients for order 9 will be
* in lp_coeff[8][0,8], the LP coefficients for order 8 will be
* in lp_coeff[7][0,7], etc.
}
/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*
+/*
* WATCHOUT - this is meant to be very lightweight an not even dependent
* on libFLAC, so there are a couple places where FLAC__* variables are
* duplicated here. Look for 'DUPLICATE:' in comments.
#define IN_VER 0x100
-typedef struct
+typedef struct
{
int version; // module type (IN_VER)
char *description; // description of module, with version string
char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
// May be altered from Config, so the user can select what they want
-
- int is_seekable; // is this stream seekable?
+
+ int is_seekable; // is this stream seekable?
int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
void (*Config)(HWND hwndParent); // configuration dialog
void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used
int (*InfoBox)(char *file, HWND hwndParent);
-
+
int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc
// playback stuff
int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
// volume stuff
void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume
void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan
-
+
// in-window builtin vis stuff
void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
// simple vis supplying mode
- void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
+ void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
// sets the spec data directly from PCM data
// quick and easy way to get vis working :)
// needs at least 576 samples :)
void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
- // call this in Play() to tell the vis plug-ins the current output params.
+ // call this in Play() to tell the vis plug-ins the current output params.
void (*VSASetInfo)(int nch, int srate);
- // dsp plug-in processing:
+ // dsp plug-in processing:
// (filled in by winamp, called by input plug)
// returns 1 if active (which means that the number of samples returned by dsp_dosamples
// could be greater than went in.. Use it to estimate if you'll have enough room in the
// output buffer
- int (*dsp_isactive)();
+ int (*dsp_isactive)();
- // returns number of samples to output. This can be as much as twice numsamples.
+ // returns number of samples to output. This can be as much as twice numsamples.
// be sure to allocate enough buffer for samples, then.
int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
#define OUT_VER 0x10
-typedef struct
+typedef struct
{
int version; // module version (OUT_VER)
char *description; // description of module, with version string
int id; // module id. each input module gets its own. non-nullsoft modules should
- // be >= 65536.
+ // be >= 65536.
HWND hMainWindow; // winamp's main window (filled in by winamp)
HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp)
- void (*Config)(HWND hwndParent); // configuration dialog
+ void (*Config)(HWND hwndParent); // configuration dialog
void (*About)(HWND hwndParent); // about dialog
void (*Init)(); // called when loaded
void (*Quit)(); // called when unloaded
- int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
+ int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
// returns >=0 on success, <0 on failure
- // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
+ // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
// ... so don't expect the max latency returned to be what you asked for.
// returns max latency in ms (0 for diskwriters, etc)
- // bufferlenms and prebufferms must be in ms. 0 to use defaults.
+ // bufferlenms and prebufferms must be in ms. 0 to use defaults.
// prebufferms must be <= bufferlenms
void (*Close)(); // close the ol' output device.
- int (*Write)(char *buf, int len);
- // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
+ int (*Write)(char *buf, int len);
+ // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
// 1 returns not able to write (yet). Non-blocking, always.
- int (*CanWrite)(); // returns number of bytes possible to write at a given time.
+ int (*CanWrite)(); // returns number of bytes possible to write at a given time.
// Never will decrease unless you call Write (or Close, heh)
int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
void (*SetVolume)(int volume); // volume is 0-255
void (*SetPan)(int pan); // pan is -128 to 128
- void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms)
+ void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms)
// (used for seeking)
int (*GetOutputTime)(); // returns played time in MS
/* Winamp 3 Player core api v0.1
** (c)2000 nullsoft jcf/ct/dk
-** Notes:
-** Keep in mind that this header file is subject to change prior to the
-** release of Winamp 3. The ability to configure plug-ins has yet to be
-** added and is the first and foremost concern of the engineering team.
+** Notes:
+** Keep in mind that this header file is subject to change prior to the
+** release of Winamp 3. The ability to configure plug-ins has yet to be
+** added and is the first and foremost concern of the engineering team.
*/
#ifndef __CORE_API_H
{
public:
/* GetReader
- ** Allows your Input Source and Output Filter plugins to request a reader from Winamp,
+ ** Allows your Input Source and Output Filter plugins to request a reader from Winamp,
** so you don't have to worry about opening files or streams
*/
virtual WReader *GetReader(char *url)=0;
** the useful information into member elements for quick access by other functions
*/
virtual int Open(char *url) { return 1; }
-
+
/* GetTitle
** Called by Winamp to get the decoded title about the file opened
** i.e. id3 title name, etc...
** returns -1 if length is undefined/infinite
*/
virtual int GetLength(void) { return -1; };
-
+
/* GetMetaData
** Fetches metadata by attribute name (Artist, Album, Bitrate, etc...)
** attribute names are non case-sensitive.
** returns size of data
*/
- virtual int GetMetaData(char *name, char *data, int data_len) { if (data&&data_len>0) *data=0; return 0; }
-
+ virtual int GetMetaData(char *name, char *data, int data_len) { if (data&&data_len>0) *data=0; return 0; }
+
/* ~WInputInfo
** WInputInfo virtual destructor
- */
+ */
virtual ~WInputInfo() { };
};
-/* WINAMP Output Filter NOTIFY MESSAGES
+/* WINAMP Output Filter NOTIFY MESSAGES
** Messages returned to notify Output Filter plug-ins of events
*/
typedef enum {
-
+
/* WOFNM_FILETITLECHANGE
- ** Sent when the song changes
+ ** Sent when the song changes
** param1=new filename song
** param2=new title song
*/
WOFNM_FILETITLECHANGE=1024,
-
+
/* WOFNM_ENDOFDECODE
** Sent when decoding ends
*/
-class WOutputFilter
+class WOutputFilter
{
protected:
/* WOutputFilter
** WOutputFilter constructor
- */
+ */
WOutputFilter() { m_next=NULL; };
public:
/* FlushSamples
** Flushes output buffers so that all is written
*/
- virtual void FlushSamples(bool *killswitch) { };
+ virtual void FlushSamples(bool *killswitch) { };
/* Restart
** Called by Winamp after a seek
*/
- virtual void Restart(void) { }
+ virtual void Restart(void) { }
/* GetLatency
** Returns < 0 for a final output latency, > 0 for an additive
*/
- virtual int GetLatency(void) { return 0; }
+ virtual int GetLatency(void) { return 0; }
/* Pause
** Suspends output
** Sets the volume (0 to 255)
** return 1 if volume successfully modified
*/
- virtual int SetVolume(int volume) { return 0; }
+ virtual int SetVolume(int volume) { return 0; }
/* SetPan
** Sets Left-Right sound balance (-127 to 127)
** Sets the volume (0 to 255)
** Return 1 if volume has been set
*/
- virtual int SetVolume(int volume) { return 0; };
+ virtual int SetVolume(int volume) { return 0; };
/* SetPan
** Sets Left-Right sound balance (-127 to 127)
/* SetPosition
** Sets position in ms. returns 0 on success, 1 if seek impossible
*/
- virtual int SetPosition(int)=0;
+ virtual int SetPosition(int)=0;
/* Pause
** Suspends input
-class WReader
+class WReader
{
protected:
** WReader constructor
*/
WReader() { }
-
+
public:
/* m_player
/* Open
** Used to open a file, return 0 on success
*/
- virtual int Open(char *url, bool *killswitch)=0;
+ virtual int Open(char *url, bool *killswitch)=0;
/* Read
** Returns number of BYTES read (if < length then eof or killswitch)
*/
- virtual int Read(char *buffer, int length, bool *killswitch)=0;
-
+ virtual int Read(char *buffer, int length, bool *killswitch)=0;
+
/* GetLength
** Returns length of the entire file in BYTES, return -1 on unknown/infinite (as for a stream)
*/
- virtual int GetLength(void)=0;
-
+ virtual int GetLength(void)=0;
+
/* CanSeek
** Returns 1 if you can skip ahead in the file, 0 if not
*/
virtual int CanSeek(void)=0;
-
+
/* Seek
** Jump to a certain absolute position
*/
virtual int Seek(int position, bool *killswitch)=0;
-
+
/* GetHeader
** Retrieve header. Used in read_http to retrieve the HTTP header
*/
#define OF_VER 0x100
-typedef struct
+typedef struct
{
/* version
** Version revision number
*/
int version;
-
+
/* description
** Text description of the reader plug-in
*/
char *description;
-
+
/* create
** Function pointer to create a reader module
*/
WReader *(*create)();
-
+
/* ismine
** Determines whether or not a file should be read by this plug-in
*/
int (*ismine)(char *url);
-
+
} reader_source;
-typedef struct
+typedef struct
{
/* version
** Version revision number
- */
+ */
int version;
/* description
** Text description of the input plug-in
- */
+ */
char *description;
/* extension_list
** Defines all the supported filetypes by this input plug-in
** In semicolon delimited format ("ext;desc;ext;desc" etc).
- */
- char *extension_list;
+ */
+ char *extension_list;
/* ismine
** called before extension checks, to allow detection of tone://,http://, etc
** Determines whether or not a file type should be decoded by this plug-in
- */
+ */
int (*ismine)(char *filename);
/* create
** Function pointer to create a decoder module
- */
+ */
WInputSource *(*create)(void);
/* createinfo
** Function pointer to create a decoder module information
- */
+ */
WInputInfo *(*createinfo)(void);
} input_source;
-typedef struct
+typedef struct
{
/* version
** Version revision number
*/
int version;
-
+
/* description
** Text description of the output plug-in
- */
+ */
char *description;
-
+
/* create
** Function pointer to create an Output Filter
*/
file_info_.length_in_msec = -1;
}
-
+
/***********************************************************************
* local routines
**********************************************************************/
file_info->abort_flag = true;
}
-
+
/***********************************************************************
* C-level interface
**********************************************************************/
static int C_level__FLAC_is_mine_(char *filename)
{
- return 0;
+ return 0;
}
static WInputSource *C_level__FLAC_create_()