Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,7 @@
* Removed incorrect manifest file which causes issues loading the plug-in on some systems
* Now built with VS2008 so now depends on 5.57+ due to msvcr90.dll dependency (cuts size)
* Changed localisation system to directly use api_language
* Added %type%, %family% (used mainly by the installer) and %gain% to complement the other replaygain options
* Removed config dialog as not applicable now with new defaults and also if we're following Winamp's settings
* Changed some of the stringtable resource (adds new strings, removes deprecated strings and some minor tweaks)
* Changed some of the options for the plug-in project (including using lng_generator directly)

View file

@ -0,0 +1,152 @@
#ifndef NULLSOFT_WINAMP_IN2H
#define NULLSOFT_WINAMP_IN2H
// Input plugin interface
#include "out.h"
// If you want your input plugin to support unicode then define the following which will then
// adjust required functions to their unicode variants. This is supported from Winamp 5.3+.
#define IN_UNICODE 0x0F000000
#ifdef UNICODE_INPUT_PLUGIN
#define in_char wchar_t
#define IN_VER (IN_UNICODE | 0x100)
#else
#define in_char char
#define IN_VER 0x100
#endif
#define IN_MODULE_FLAG_USES_OUTPUT_PLUGIN 1
// By default Winamp assumes your input plugin wants to use Winamp's EQ, and doesn't do replay gain
// if you handle any of these yourself (EQ, Replay Gain adjustments), then set these flags accordingly
// Set this if you want to implement your own EQ inplace of using Winamp's native implementation.
#define IN_MODULE_FLAG_EQ 2
// Set this if you adjusted volume for replay gain. For tracks with no replay gain metadata then you
// should clear this flag UNLESS you handle "non_replaygain" gain adjustment yourself then keep it.
#define IN_MODULE_FLAG_REPLAYGAIN 8
// Use this if you queried for the replay gain preamp parameter and used it. This is new to 5.54 clients.
#define IN_MODULE_FLAG_REPLAYGAIN_PREAMP 16
typedef struct
{
int version; // module type (IN_VER)
char *description; // description of module, with version string
HWND hMainWindow; // Winamp's main window (filled in by winamp - is a valid HWND on 5.1+ clients)
HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp)
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 UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
// note that this has turned into a "flags" field see IN_MODULE_FLAG_*
void (*Config)(HWND hwndParent); // configuration dialog
void (*About)(HWND hwndParent); // about dialog
void (*Init)(); // called at program init
void (*Quit)(); // called at program quit
#define GETFILEINFO_TITLE_LENGTH 2048
// If file == NULL then the currently playing file is used (assumes you've cached it as required)
void (*GetFileInfo)(const in_char *file, in_char *title, int *length_in_ms);
#define INFOBOX_EDITED 0
#define INFOBOX_UNCHANGED 1
int (*InfoBox)(const in_char *file, HWND hwndParent);
int (*IsOurFile)(const in_char *fn); // called before extension checks, to allow detection of mms://, etc
// playback stuff
int (*Play)(const in_char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
void (*Pause)(); // pause stream
void (*UnPause)(); // unpause stream
int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not
void (*Stop)(); // stop (unload) stream
// time stuff
int (*GetLength)(); // get length in ms
int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime()
void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal your thread to seek, which seeks and calls outMod->Flush()..
// 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()
// call after opening audio device with max latency in ms and samplerate
void (*SAVSADeInit)(); // call in Stop()
// simple vis supplying mode
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 :)
// advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec)) use when calling SAAdd()
int (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
// vis stuff (plug-in)
// simple vis supplying mode
void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data quick and easy way
// to get vis working :) needs at least 576 samples :)
// advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
int (*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.
void (*VSASetInfo)(int srate, int nch); // <-- Correct (benski, dec 2005).. old declaration had the params backwards
// dsp plug-in processing:
// (filled in by winamp, calld 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)();
// 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);
// eq stuff
void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.
// info setting (filled in by winamp)
void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
Out_Module *outMod; // filled in by winamp, optionally used :)
} In_Module;
// These are the return values to be used with the uninstall plugin export function:
// __declspec(dllexport) int winampUninstallPlugin(HINSTANCE hDllInst, HWND hwndDlg, int param)
// which determines if Winamp can uninstall the plugin immediately or on winamp restart.
// If this is not exported then Winamp will assume an uninstall with reboot is the only way.
//
#define IN_PLUGIN_UNINSTALL_NOW 0x1
#define IN_PLUGIN_UNINSTALL_REBOOT 0x0
//
// Uninstall support was added from 5.0+ and uninstall now support from 5.5+ though note
// that it is down to you to ensure that if uninstall now is returned that it will not
// cause a crash i.e. don't use if you've been subclassing the main window.
//
// The HWND passed in the calling of winampUninstallPlugin(..) is the preference page HWND.
//
// For a input plugin to be correctly detected by Winamp you need to ensure that
// the exported winampGetInModule2(..) is exported as an undecorated function
// e.g.
// #ifdef __cplusplus
// extern "C" {
// #endif
// __declspec(dllexport) In_Module *winampGetInModule2(){ return &plugin; }
// #ifdef __cplusplus
// }
// #endif
//
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,49 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by wavpack.rc
//
#define IDS_DISABLED 106
#define IDS_USE_TRACK 107
#define IDS_USE_ALBUM 108
#define IDS_JUST_CLIP 109
#define IDS_SOFT_CLIP 110
#define IDS_PREVENT_CLIP 111
#define IDS_ABOUT 112
#define IDS_FORMAT 113
#define IDS_ENCODER_VERSION 114
#define IDS_SOURCE 115
#define IDS_MULTICHANNEL 116
#define IDS_MONO 117
#define IDS_STEREO 118
#define IDS_HYBRID 119
#define IDS_LOSSLESS 120
#define IDS_LOSSY 121
#define IDS_INTS 122
#define IDS_FLOATS 123
#define IDS_MODES 124
#define IDS_FAST 125
#define IDS_HIGH 126
#define IDS_VHIGH 127
#define IDS_EXTRA 128
#define IDS_BITRATE 129
#define IDS_RATIO 130
#define IDS_KBPS 131
#define IDS_MD5 132
#define IDS_DESCRIPTION 133
#define IDS_STRING134 134
#define IDS_FILETYPE 134
#define IDS_ABOUT_MESSAGE 135
#define IDS_FAMILY_STRING 136
#define IDS_GUID 65535
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 136
#define _APS_NEXT_COMMAND_VALUE 40002
#define _APS_NEXT_CONTROL_VALUE 1027
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View file

@ -0,0 +1,73 @@
#ifndef NULLSOFT_AGAVE_SVC_ALBUMARTPROVIDER_H
#define NULLSOFT_AGAVE_SVC_ALBUMARTPROVIDER_H
#include "../../bfc/dispatch.h"
#include "../../bfc/std_mkncc.h" // for MKnCC()
enum
{
ALBUMARTPROVIDER_SUCCESS = 0,
ALBUMARTPROVIDER_FAILURE = 1,
ALBUMARTPROVIDER_READONLY = 2,
ALBUMARTPROVIDER_TYPE_EMBEDDED = 0, // contained within another file (e.g. inside id3v2 tag)
ALBUMARTPROVIDER_TYPE_DATABASE = 1, // cached in a database somewhere (e.g. ipod artwork DB)
ALBUMARTPROVIDER_TYPE_FOLDER = 2, // sitting on a folder somewhere (e.g. folder.jpg)
};
class svc_albumArtProvider : public Dispatchable
{
protected:
svc_albumArtProvider() {}
~svc_albumArtProvider() {}
public:
static FOURCC getServiceType() { return svc_albumArtProvider::SERVICETYPE; }
bool IsMine(const wchar_t *filename);
int ProviderType();
// implementation note: use WASABI_API_MEMMGR to alloc bits and mimetype, so that the recipient can free through that
int GetAlbumArtData(const wchar_t *filename, const wchar_t *type, void **bits, size_t *len, wchar_t **mimeType);
int SetAlbumArtData(const wchar_t *filename, const wchar_t *type, void *bits, size_t len, const wchar_t *mimeType);
int DeleteAlbumArt(const wchar_t *filename, const wchar_t *type);
DISPATCH_CODES
{
SVC_ALBUMARTPROVIDER_PROVIDERTYPE = 0,
SVC_ALBUMARTPROVIDER_GETALBUMARTDATA = 10,
SVC_ALBUMARTPROVIDER_ISMINE = 20,
SVC_ALBUMARTPROVIDER_SETALBUMARTDATA = 30,
SVC_ALBUMARTPROVIDER_DELETEALBUMART = 40,
};
enum
{
SERVICETYPE = MK3CC('a','a','p')
};
};
inline bool svc_albumArtProvider::IsMine(const wchar_t *filename)
{
return _call(SVC_ALBUMARTPROVIDER_ISMINE, false, filename);
}
inline int svc_albumArtProvider::ProviderType()
{
return _call(SVC_ALBUMARTPROVIDER_PROVIDERTYPE, (int)ALBUMARTPROVIDER_TYPE_EMBEDDED);
}
inline int svc_albumArtProvider::GetAlbumArtData(const wchar_t *filename, const wchar_t *type, void **bits, size_t *len, wchar_t **mimeType)
{
return _call(SVC_ALBUMARTPROVIDER_GETALBUMARTDATA, (int)ALBUMARTPROVIDER_FAILURE, filename, type, bits, len, mimeType);
}
inline int svc_albumArtProvider::SetAlbumArtData(const wchar_t *filename, const wchar_t *type, void *bits, size_t len, const wchar_t *mimeType)
{
return _call(SVC_ALBUMARTPROVIDER_SETALBUMARTDATA, (int)ALBUMARTPROVIDER_FAILURE, filename, type, bits, len, mimeType);
}
inline int svc_albumArtProvider::DeleteAlbumArt(const wchar_t *filename, const wchar_t *type)
{
return _call(SVC_ALBUMARTPROVIDER_DELETEALBUMART, (int)ALBUMARTPROVIDER_FAILURE, filename, type);
}
#endif

View file

@ -0,0 +1,123 @@
#ifndef NULLSOFT_AGAVE_API_CONFIG_H
#define NULLSOFT_AGAVE_API_CONFIG_H
#include "../../bfc/dispatch.h"
#include "ifc_configgroup.h"
enum
{
CONFIG_SUCCESS = 0,
CONFIG_FAILURE = 1,
CONFIG_GROUPNOTFOUND = 2,
CONFIG_ITEMNOTFOUND = 3,
};
class api_config : public Dispatchable
{
protected:
api_config() {}
~api_config() {}
public:
ifc_configgroup *GetGroup(GUID groupGUID);
void RegisterGroup(ifc_configgroup *newGroup);
/* Shortcut methods */
bool GetBool(GUID groupGUID, const wchar_t *configItem, bool defaultValue);
uintptr_t GetUnsigned(GUID groupGUID, const wchar_t *configItem, uintptr_t defaultValue);
intptr_t GetInt(GUID groupGUID, const wchar_t *configItem, intptr_t defaultValue);
float GetFloat(GUID groupGUID, const wchar_t *configItem, float defaultValue);
const wchar_t *GetString(GUID groupGUID, const wchar_t *configItem, const wchar_t *defaultValue);
ifc_configitem *GetItem(GUID groupGUID, const wchar_t *configItem);
public:
DISPATCH_CODES
{
API_CONFIG_GETGROUP = 10,
API_CONFIG_REGISTERGROUP = 20,
};
};
inline ifc_configgroup *api_config::GetGroup(GUID groupGUID)
{
return _call(API_CONFIG_GETGROUP, (ifc_configgroup *)0, groupGUID);
}
inline void api_config::RegisterGroup(ifc_configgroup *newGroup)
{
_voidcall(API_CONFIG_REGISTERGROUP, newGroup);
}
inline bool api_config::GetBool(GUID groupGUID, const wchar_t *configItem, bool defaultValue)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
ifc_configitem *item = group->GetItem(configItem);
if (item)
return item->GetBool();
}
return defaultValue;
}
inline uintptr_t api_config::GetUnsigned(GUID groupGUID, const wchar_t *configItem, uintptr_t defaultValue)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
ifc_configitem *item = group->GetItem(configItem);
if (item)
return item->GetUnsigned();
}
return defaultValue;
}
inline intptr_t api_config::GetInt(GUID groupGUID, const wchar_t *configItem, intptr_t defaultValue)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
ifc_configitem *item = group->GetItem(configItem);
if (item)
return item->GetInt();
}
return defaultValue;
}
inline float api_config::GetFloat(GUID groupGUID, const wchar_t *configItem, float defaultValue)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
ifc_configitem *item = group->GetItem(configItem);
if (item)
return item->GetFloat();
}
return defaultValue;
}
inline const wchar_t *api_config::GetString(GUID groupGUID, const wchar_t *configItem, const wchar_t *defaultValue)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
ifc_configitem *item = group->GetItem(configItem);
if (item)
return item->GetString();
}
return defaultValue;
}
inline ifc_configitem *api_config::GetItem(GUID groupGUID, const wchar_t *configItem)
{
ifc_configgroup *group = GetGroup(groupGUID);
if (group)
{
return group->GetItem(configItem);
}
return 0;
}
// {AEFBF8BE-E0AA-4318-8CC1-4353410B64DC}
static const GUID AgaveConfigGUID =
{ 0xaefbf8be, 0xe0aa, 0x4318, { 0x8c, 0xc1, 0x43, 0x53, 0x41, 0xb, 0x64, 0xdc } };
#endif

View file

@ -0,0 +1,35 @@
#ifndef NULLSOFT_AGAVE_IFC_CONFIGGROUP_H
#define NULLSOFT_AGAVE_IFC_CONFIGGROUP_H
#include "../../bfc/dispatch.h"
#include "../../bfc/platform/types.h"
#include "../../bfc/platform/guid.h"
#include "ifc_configitem.h"
class ifc_configgroup : public Dispatchable
{
protected:
ifc_configgroup() {}
~ifc_configgroup() {}
public:
ifc_configitem *GetItem(const wchar_t *name);
GUID GetGUID();
public:
DISPATCH_CODES
{
IFC_CONFIGGROUP_GETITEM = 10,
IFC_CONFIGGROUP_GETGUID = 20,
};
};
inline ifc_configitem *ifc_configgroup::GetItem(const wchar_t *name)
{
return _call(IFC_CONFIGGROUP_GETITEM, (ifc_configitem *)0, name);
}
inline GUID ifc_configgroup::GetGUID()
{
return _call(IFC_CONFIGGROUP_GETGUID, (GUID)INVALID_GUID);
}
#endif

View file

@ -0,0 +1,200 @@
#ifndef NULLSOFT_AGAVE_IFC_CONFIGITEM_H
#define NULLSOFT_AGAVE_IFC_CONFIGITEM_H
#include "../../bfc/dispatch.h"
#include <stddef.h>
/*
notes:
The Set() functions are "public-facing", meaning that they can be called by anyone. If you want to make your config item read-only,
then simply don't implement these. You can always make "private" Set functions in your implementation.
SetStringInternal and GetStringInternal are written for use with classes to load and save from INI files (or XML files or whatever).
It's up to you to figure out a clever way to encode yourself.
*/
enum
{
CONFIG_ITEM_TYPE_STRING = 0,
CONFIG_ITEM_TYPE_INT = 1,
CONFIG_ITEM_TYPE_UNSIGNED =2,
CONFIG_ITEM_TYPE_BOOL =3,
CONFIG_ITEM_TYPE_BINARY =4,
CONFIG_ITEM_TYPE_INT_ARRAY = 5,
};
class ifc_configitem : public Dispatchable
{
protected:
ifc_configitem() {}
~ifc_configitem() {}
public:
const wchar_t *GetName();
int GetType();
const wchar_t *GetString();
void SetString(const wchar_t *stringValue);
intptr_t GetInt();
void SetInt(intptr_t intValue);
uintptr_t GetUnsigned();
void SetUnsigned(uintptr_t unsignedValue);
bool GetBool();
void SetBool(bool boolValue);
float GetFloat();
void SetFloat(float floatValue);
size_t GetBinarySize();
size_t GetBinaryData(void *data, size_t bytes); // returns bytes written
void SetBinaryData(void *data, size_t bytes);
size_t GetIntArrayElements();
size_t GetIntArray(intptr_t *array, size_t elements); // returns elements written
void SetIntArray(intptr_t *array, size_t elements);
const wchar_t *GetStringInternal(); // gets a string suitable for saving in an INI file or XML
void SetStringInternal(const wchar_t *internalString);
public:
DISPATCH_CODES
{
IFC_CONFIGITEM_GETNAME = 10,
IFC_CONFIGITEM_GETTYPE = 20,
IFC_CONFIGITEM_GETSTRING= 30,
IFC_CONFIGITEM_SETSTRING= 40,
IFC_CONFIGITEM_GETINT= 50,
IFC_CONFIGITEM_SETINT= 60,
IFC_CONFIGITEM_GETUNSIGNED= 70,
IFC_CONFIGITEM_SETUNSIGNED= 80,
IFC_CONFIGITEM_GETBOOL= 90,
IFC_CONFIGITEM_SETBOOL= 100,
IFC_CONFIGITEM_GETBINARYSIZE= 110,
IFC_CONFIGITEM_GETBINARYDATA= 120,
IFC_CONFIGITEM_SETBINARYDATA= 130,
IFC_CONFIGITEM_GETINTARRAYELEMENTS= 140,
IFC_CONFIGITEM_GETINTARRAY= 150,
IFC_CONFIGITEM_SETINTARRAY= 160,
IFC_CONFIGITEM_GETSTRINGINTERNAL= 170,
IFC_CONFIGITEM_SETSTRINGINTERNAL= 180,
IFC_CONFIGITEM_GETFLOAT= 190,
IFC_CONFIGITEM_SETFLOAT= 200,
};
};
inline const wchar_t *ifc_configitem::GetName()
{
return _call(IFC_CONFIGITEM_GETNAME, (const wchar_t *)0);
}
inline int ifc_configitem::GetType()
{
return _call(IFC_CONFIGITEM_GETTYPE, (int)0);
}
inline const wchar_t *ifc_configitem::GetString()
{
return _call(IFC_CONFIGITEM_GETSTRING, (const wchar_t *)0);
}
inline void ifc_configitem::SetString(const wchar_t *stringValue)
{
_voidcall(IFC_CONFIGITEM_SETSTRING, stringValue);
}
inline intptr_t ifc_configitem::GetInt()
{
return _call(IFC_CONFIGITEM_GETINT, (intptr_t)0);
}
#pragma warning(push)
#pragma warning(disable: 4244)
inline void ifc_configitem::SetInt(intptr_t intValue)
{
_voidcall(IFC_CONFIGITEM_SETINT, intValue);
}
#pragma warning(pop)
inline uintptr_t ifc_configitem::GetUnsigned()
{
return _call(IFC_CONFIGITEM_GETUNSIGNED, (uintptr_t)0);
}
inline void ifc_configitem::SetUnsigned(uintptr_t unsignedValue)
{
_voidcall(IFC_CONFIGITEM_SETUNSIGNED, unsignedValue);
}
inline bool ifc_configitem::GetBool()
{
return _call(IFC_CONFIGITEM_GETBOOL, (bool)false);
}
inline void ifc_configitem::SetBool(bool boolValue)
{
_voidcall(IFC_CONFIGITEM_SETBOOL, boolValue);
}
inline size_t ifc_configitem::GetBinarySize()
{
return _call(IFC_CONFIGITEM_GETBINARYSIZE, (size_t)0);
}
inline size_t ifc_configitem::GetBinaryData(void *data, size_t bytes)
{
return _call(IFC_CONFIGITEM_GETBINARYDATA, (size_t)0, data, bytes);
}
inline void ifc_configitem::SetBinaryData(void *data, size_t bytes)
{
_voidcall(IFC_CONFIGITEM_SETBINARYDATA, data, bytes);
}
inline size_t ifc_configitem::GetIntArrayElements()
{
return _call(IFC_CONFIGITEM_GETINTARRAYELEMENTS, (size_t)0);
}
inline size_t ifc_configitem::GetIntArray(intptr_t *array, size_t elements)
{
return _call(IFC_CONFIGITEM_GETINTARRAY, (size_t)0, array, elements);
}
inline void ifc_configitem::SetIntArray(intptr_t *array, size_t elements)
{
_voidcall(IFC_CONFIGITEM_SETINTARRAY, array, elements);
}
inline const wchar_t *ifc_configitem::GetStringInternal()
{
return _call(IFC_CONFIGITEM_GETSTRINGINTERNAL, (const wchar_t *)0);
}
inline void ifc_configitem::SetStringInternal(const wchar_t *internalString)
{
_voidcall(IFC_CONFIGITEM_SETSTRINGINTERNAL, internalString);
}
inline float ifc_configitem::GetFloat()
{
return _call(IFC_CONFIGITEM_GETFLOAT, (float)0);
}
inline void ifc_configitem::SetFloat(float floatValue)
{
_voidcall(IFC_CONFIGITEM_SETFLOAT, floatValue);
}
#endif

View file

@ -0,0 +1,315 @@
#ifndef NULLSOFT_API_LANGUAGE_H
#define NULLSOFT_API_LANGUAGE_H
#include "../../bfc/dispatch.h"
#include "lang.h"
#include <locale.h>
#if (_MSC_VER <= 1200)
struct threadlocaleinfostruct;
struct threadmbcinfostruct;
typedef struct threadlocaleinfostruct * pthreadlocinfo;
typedef struct threadmbcinfostruct * pthreadmbcinfo;
typedef struct localeinfo_struct
{
pthreadlocinfo locinfo;
pthreadmbcinfo mbcinfo;
} _locale_tstruct, *_locale_t;
#endif
class api_language : public Dispatchable
{
protected:
api_language() {}
~api_language() {}
public:
char *GetString(HINSTANCE hinst, HINSTANCE owner, UINT uID, char *str=NULL, size_t maxlen=0);
wchar_t *GetStringW(HINSTANCE hinst, HINSTANCE owner, UINT uID, wchar_t *str=NULL, size_t maxlen=0);
char *GetStringFromGUID(const GUID guid, HINSTANCE owner, UINT uID, char *str=NULL, size_t maxlen=0);
wchar_t *GetStringFromGUIDW(const GUID guid, HINSTANCE owner, UINT uID, wchar_t *str=NULL, size_t maxlen=0);
HINSTANCE FindDllHandleByGUID(GUID guid);
HINSTANCE FindDllHandleByString(const char* str);
HINSTANCE FindDllHandleByStringW(const wchar_t* str);
HINSTANCE StartLanguageSupport(HINSTANCE hinstance, const GUID guid);
const wchar_t *GetLanguageFolder();
#define LANG_IDENT_STR 0
#define LANG_LANG_CODE 1
#define LANG_COUNTRY_CODE 2
const wchar_t *GetLanguageIdentifier(int mode);
HWND CreateLDialogParam(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param);
INT_PTR LDialogBoxParam(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param);
HMENU LoadLMenu(HINSTANCE localised, HINSTANCE original, UINT id);
HWND CreateLDialogParamW(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param);
INT_PTR LDialogBoxParamW(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param);
HMENU LoadLMenuW(HINSTANCE localised, HINSTANCE original, UINT id);
void* LoadResourceFromFile(HINSTANCE hinst, HINSTANCE owner, LPCTSTR lpType, LPCTSTR lpName, DWORD* size);
void* LoadResourceFromFileW(HINSTANCE hinst, HINSTANCE owner, LPCWSTR lpType, LPCWSTR lpName, DWORD* size);
HACCEL LoadAcceleratorsA(HINSTANCE hinst, HINSTANCE owner, LPCSTR lpTableName);
HACCEL LoadAcceleratorsW(HINSTANCE hinst, HINSTANCE owner, LPCWSTR lpTableName);
// Implemented in 5.58+
// When called this will attempt to set the locale used for numeric representation
// to that of the user running the current Winamp instance as long as the language
// and country identifiers match those reported within the language pack (if used)
//
// If you're running under a different thread then this will need to be called as
// the locale is set on a per thread basis which generally means anything under the
// Winamp process will be handled correctly unless a UI aspect is running under a
// different thread. Internally this is called within winamp.exe and vis_milk2.dll
BOOL UseUserNumericLocale();
// Get_C_NumericLocale() is a wrapper for _create_locale(LC_NUMERIC, "C") which can
// then be used in _atof_l(..), _sscanf_l(..) or other locale based functions when
// you need to process numbers without localisation handling ie the "C" locale.
// This function is provided for convenience unless you want to do it all manually.
_locale_t Get_C_NumericLocale();
public:
DISPATCH_CODES
{
API_LANGUAGE_GETSTRING = 10,
API_LANGUAGE_GETSTRINGW = 11,
API_LANGUAGE_GETSTRINGFROMGUID = 12,
API_LANGUAGE_GETSTRINGFROMGUIDW = 13,
API_LANGUAGE_GETHINSTANCEBYGUID = 20,
API_LANGUAGE_GETHINSTANCEBYNAME = 21,
API_LANGUAGE_GETHINSTANCEBYNAMEW = 22,
API_LANGUAGE_STARTUP = 30,
API_LANGUAGE_SHUTDOWN = 31,
API_LANGUAGE_GETLANGUAGEFOLDER=40,
API_LANGUAGE_CREATELDIALOGPARAM=50,
API_LANGUAGE_LDIALOGBOXPARAM=51,
API_LANGUAGE_LOADLMENU=52,
API_LANGUAGE_CREATELDIALOGPARAMW=53,
API_LANGUAGE_LDIALOGBOXPARAMW=54,
API_LANGUAGE_LOADLMENUW=55,
API_LANGUAGE_GETLANGUAGEIDENTIFIER=60,
API_LANGUAGE_LOADRESOURCEFROMFILE=70,
API_LANGUAGE_LOADRESOURCEFROMFILEW=71,
API_LANGUAGE_LOADACCELERATORSA=80,
API_LANGUAGE_LOADACCELERATORSW=81,
// Implemented in 5.58+
// See UseUserNumericLocale notes
API_LANGUAGE_USEUSERNUMERICLOCALE=90,
API_LANGUAGE_GET_C_NUMERICLOCALE=91,
};
};
inline char *api_language::GetString(HINSTANCE hinst, HINSTANCE owner, UINT uID, char *str, size_t maxlen)
{
return _call(API_LANGUAGE_GETSTRING, (char * )0, hinst, owner, uID, str, maxlen);
}
inline wchar_t *api_language::GetStringW(HINSTANCE hinst, HINSTANCE owner, UINT uID, wchar_t *str, size_t maxlen)
{
return _call(API_LANGUAGE_GETSTRINGW, (wchar_t * )0, hinst, owner, uID, str, maxlen);
}
inline char *api_language::GetStringFromGUID(const GUID guid, HINSTANCE owner, UINT uID, char *str, size_t maxlen)
{
return _call(API_LANGUAGE_GETSTRINGFROMGUID, (char * )0, guid, owner, uID, str, maxlen);
}
inline wchar_t *api_language::GetStringFromGUIDW(const GUID guid, HINSTANCE owner, UINT uID, wchar_t *str, size_t maxlen)
{
return _call(API_LANGUAGE_GETSTRINGFROMGUIDW, (wchar_t * )0, guid, owner, uID, str, maxlen);
}
inline HINSTANCE api_language::FindDllHandleByGUID(const GUID guid)
{
return _call(API_LANGUAGE_GETHINSTANCEBYGUID, (HINSTANCE )0, guid);
}
inline HINSTANCE api_language::FindDllHandleByString(const char* str)
{
return _call(API_LANGUAGE_GETHINSTANCEBYNAME, (HINSTANCE )0, str);
}
inline HINSTANCE api_language::FindDllHandleByStringW(const wchar_t* str)
{
return _call(API_LANGUAGE_GETHINSTANCEBYNAMEW, (HINSTANCE )0, str);
}
inline HINSTANCE api_language::StartLanguageSupport(HINSTANCE hinstance, const GUID guid)
{
return _call(API_LANGUAGE_STARTUP, (HINSTANCE )0, hinstance, guid);
}
inline const wchar_t *api_language::GetLanguageFolder()
{
return _call(API_LANGUAGE_GETLANGUAGEFOLDER, (const wchar_t *)0);
}
inline HWND api_language::CreateLDialogParam(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param)
{
return _call(API_LANGUAGE_CREATELDIALOGPARAM, (HWND)0, localised, original, id, parent, proc, param);
}
inline INT_PTR api_language::LDialogBoxParam(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param)
{
return _call(API_LANGUAGE_LDIALOGBOXPARAM, (INT_PTR)0, localised, original, id, parent, proc, param);
}
inline HMENU api_language::LoadLMenu(HINSTANCE localised, HINSTANCE original, UINT id)
{
return _call(API_LANGUAGE_LOADLMENU, (HMENU)0, localised, original, id);
}
inline HWND api_language::CreateLDialogParamW(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param)
{
return _call(API_LANGUAGE_CREATELDIALOGPARAMW, (HWND)0, localised, original, id, parent, proc, param);
}
inline INT_PTR api_language::LDialogBoxParamW(HINSTANCE localised, HINSTANCE original, UINT id, HWND parent, DLGPROC proc, LPARAM param)
{
return _call(API_LANGUAGE_LDIALOGBOXPARAMW, (INT_PTR)0, localised, original, id, parent, proc, param);
}
inline HMENU api_language::LoadLMenuW(HINSTANCE localised, HINSTANCE original, UINT id)
{
return _call(API_LANGUAGE_LOADLMENUW, (HMENU)0, localised, original, id);
}
inline const wchar_t *api_language::GetLanguageIdentifier(int mode)
{
return _call(API_LANGUAGE_GETLANGUAGEIDENTIFIER, (const wchar_t *)0, mode);
}
inline void *api_language::LoadResourceFromFile(HINSTANCE hinst, HINSTANCE owner, LPCTSTR lpType, LPCTSTR lpName, DWORD* size)
{
return _call(API_LANGUAGE_LOADRESOURCEFROMFILE, (void*)0, hinst, owner, lpType, lpName, size);
}
inline void *api_language::LoadResourceFromFileW(HINSTANCE hinst, HINSTANCE owner, LPCWSTR lpType, LPCWSTR lpName, DWORD* size)
{
return _call(API_LANGUAGE_LOADRESOURCEFROMFILEW, (void*)0, hinst, owner, lpType, lpName, size);
}
inline HACCEL api_language::LoadAcceleratorsA(HINSTANCE hinst, HINSTANCE owner, LPCSTR lpTableName)
{
return _call(API_LANGUAGE_LOADACCELERATORSA, (HACCEL)NULL, hinst, owner, lpTableName);
}
inline HACCEL api_language::LoadAcceleratorsW(HINSTANCE hinst, HINSTANCE owner, LPCWSTR lpTableName)
{
return _call(API_LANGUAGE_LOADACCELERATORSA, (HACCEL)NULL, hinst, owner, lpTableName);
}
inline BOOL api_language::UseUserNumericLocale()
{
return _call(API_LANGUAGE_USEUSERNUMERICLOCALE, (BOOL)0);
}
inline _locale_t api_language::Get_C_NumericLocale()
{
return _call(API_LANGUAGE_GET_C_NUMERICLOCALE, (_locale_t)0);
}
// utility macros and relevant predefined variables for use with the service + macros
extern api_language *languageManager;
#define WASABI_API_LNG languageManager
extern HINSTANCE api_localised_hinstance;
#define WASABI_API_LNG_HINST api_localised_hinstance
extern HINSTANCE api_orig_hinstance;
#define WASABI_API_ORIG_HINST api_orig_hinstance
#define WASABI_API_LNGSTR WASABI_API_LNG->GetString
// use this is you want a temp copy of the string
#define WASABI_API_LNGSTRING(uID) \
WASABI_API_LNGSTR(WASABI_API_LNG_HINST,WASABI_API_ORIG_HINST,uID)
// use this is you want a temp copy of the string but need it to fallback to a different module
#define WASABI_API_LNGSTRING_HINST(hinst,uID) \
WASABI_API_LNGSTR(WASABI_API_LNG_HINST,hinst,uID)
// use this is you want a copy of the string
#define WASABI_API_LNGSTRING_BUF(uID,buf,len) \
WASABI_API_LNGSTR(WASABI_API_LNG_HINST,WASABI_API_ORIG_HINST,uID,buf,len)
// use this is you want a copy of the string but need it to fallback to a different module
#define WASABI_API_LNGSTRING_HINST_BUF(hinst,uID,buf,len) \
WASABI_API_LNGSTR(WASABI_API_LNG_HINST,hinst,uID,buf,len)
// unicode versions of the above macros
#define WASABI_API_LNGSTRW WASABI_API_LNG->GetStringW
#define WASABI_API_LNGSTRINGW(uID) \
WASABI_API_LNGSTRW(WASABI_API_LNG_HINST,WASABI_API_ORIG_HINST,uID)
#define WASABI_API_LNGSTRINGW_HINST(hinst,uID) \
WASABI_API_LNGSTRW(WASABI_API_LNG_HINST,hinst,uID)
#define WASABI_API_LNGSTRINGW_BUF(uID,buf,len) \
WASABI_API_LNGSTRW(WASABI_API_LNG_HINST,WASABI_API_ORIG_HINST,uID,buf,len)
#define WASABI_API_LNGSTRINGW_BUF_HINST(hinst,uID,buf,len) \
WASABI_API_LNGSTRW(WASABI_API_LNG_HINST,hinst,uID,buf,len)
// Dialog handling functions (will revert back to the non-localised version if not valid/present)
#define WASABI_API_CREATEDIALOGPARAM(id, parent, proc, param) \
WASABI_API_LNG->CreateLDialogParam(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, param)
#define WASABI_API_CREATEDIALOG(id, parent, proc) \
WASABI_API_LNG->CreateLDialogParam(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, 0)
#define WASABI_API_CREATEDIALOGPARAMW(id, parent, proc, param) \
WASABI_API_LNG->CreateLDialogParamW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, param)
#define WASABI_API_CREATEDIALOGW(id, parent, proc) \
WASABI_API_LNG->CreateLDialogParamW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, 0)
#define WASABI_API_DIALOGBOXPARAM(id, parent, proc, param) \
WASABI_API_LNG->LDialogBoxParam(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, param)
#define WASABI_API_DIALOGBOX(id, parent, proc) \
WASABI_API_LNG->LDialogBoxParam(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, 0)
#define WASABI_API_DIALOGBOXPARAMW(id, parent, proc, param) \
WASABI_API_LNG->LDialogBoxParamW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, param)
#define WASABI_API_DIALOGBOXW(id, parent, proc) \
WASABI_API_LNG->LDialogBoxParamW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id, parent, (DLGPROC)proc, 0)
#define WASABI_API_LOADMENU(id) \
WASABI_API_LNG->LoadLMenu(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id)
#define WASABI_API_LOADMENUW(id) \
WASABI_API_LNG->LoadLMenuW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, id)
#define WASABI_API_LOADACCELERATORSA(__id) \
WASABI_API_LNG->LoadAcceleratorsA(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, MAKEINTRESOURCEA(__id))
#define WASABI_API_LOADACCELERATORSW(__id) \
WASABI_API_LNG->LoadAcceleratorsW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, MAKEINTRESOURCEW(__id))
#ifdef UNICODE
#define WASABI_API_LOADACCELERATORS WASABI_API_LOADACCELERATORSW
#else
#define WASABI_API_LOADACCELERATORS WASABI_API_LOADACCELERATORSA
#endif
#define WASABI_API_START_LANG(orig_hinst, guid) \
{ \
WASABI_API_ORIG_HINST = orig_hinst; \
WASABI_API_LNG_HINST = WASABI_API_LNG->StartLanguageSupport(WASABI_API_ORIG_HINST,guid); \
}
#define WASABI_API_LOADRESFROMFILE(lpType, lpName, size) \
WASABI_API_LNG->LoadResourceFromFile(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, lpType, lpName, size)
#define WASABI_API_LOADRESFROMFILEW(lpType, lpName, size) \
WASABI_API_LNG->LoadResourceFromFileW(WASABI_API_LNG_HINST, WASABI_API_ORIG_HINST, lpType, lpName, size)
// {30AED4E5-EF10-4277-8D49-27AB5570E891}
static const GUID languageApiGUID =
{ 0x30aed4e5, 0xef10, 0x4277, { 0x8d, 0x49, 0x27, 0xab, 0x55, 0x70, 0xe8, 0x91 } };
#endif

View file

@ -0,0 +1,595 @@
#ifndef _LANG_GUIDS_H_
#define _LANG_GUIDS_H_
#ifdef __cplusplus
extern "C" {
#endif
// this is just the stringtable id and the
// stringtable block where the guid is stored
#define LANG_DLL_GUID_STRING_ID 65535
#define LANG_DLL_GUID_BLOCK_ID 4096
// this is the stringtable id in winamp.exe's lng file where
// the language of the lang pack is declared.
// the actual string is defined as language_code-country_code
// e.g.
// en-US - US English
// en-GB - UK English
#define LANG_PACK_LANG_ID 65534
// this is the indentifiers required as of 5.57+ for the localisation
// 'about page' shown in supporting language packs in the 'about' box
#define LANG_DLL_AUTHOR_HOMEPAGE 65533
#define LANG_DLL_AUTHOR_HOMEPAGE2 65532
#define LANG_DLL_ABOUT_TRANSLATION_DLG_ID 1378
// this holds all of the guids that will be used in modules lng files
// using these will allow you to make use of the language resources
// between plugins / for 3rd party plugins for compatability support
// {A0099AA7-F980-45cf-818D-64EAA9F4EF4B}
static const GUID WinampLangGUID =
{ 0xa0099aa7, 0xf980, 0x45cf, { 0x81, 0x8d, 0x64, 0xea, 0xa9, 0xf4, 0xef, 0x4b } };
// {0E844B2A-70E8-4007-A73A-E9C05DB3F06D}
static const GUID WinampALangGUID =
{ 0xe844b2a, 0x70e8, 0x4007, { 0xa7, 0x3a, 0xe9, 0xc0, 0x5d, 0xb3, 0xf0, 0x6d } };
// {250FAA3C-20CD-49db-A932-67B1C0191B0E}
static const GUID GenHotkeysLangGUID =
{ 0x250faa3c, 0x20cd, 0x49db, { 0xa9, 0x32, 0x67, 0xb1, 0xc0, 0x19, 0x1b, 0xe } };
// {25B50046-5B31-418b-B77E-1B0D140D64ED}
static const GUID GenTrayLangGUID =
{ 0x25b50046, 0x5b31, 0x418b, { 0xb7, 0x7e, 0x1b, 0xd, 0x14, 0xd, 0x64, 0xed } };
// {3D968813-F245-40ad-8589-5599C754B924}
static const GUID GenMlLangGUID =
{ 0x3d968813, 0xf245, 0x40ad, { 0x85, 0x89, 0x55, 0x99, 0xc7, 0x54, 0xb9, 0x24 } };
// {A3A1E7C0-761B-4391-A08A-F0D7AF38931C}
static const GUID MlBookmarkLangGUID =
{ 0xa3a1e7c0, 0x761b, 0x4391, { 0xa0, 0x8a, 0xf0, 0xd7, 0xaf, 0x38, 0x93, 0x1c } };
// {40450D34-E85A-428c-A01C-B2546BF23CE0}
static const GUID MlDashboardLangGUID =
{ 0x40450d34, 0xe85a, 0x428c, { 0xa0, 0x1c, 0xb2, 0x54, 0x6b, 0xf2, 0x3c, 0xe0 } };
// {168BA411-7E26-4749-98F0-FF02810D9B51}
static const GUID MlADDONSLangGUID =
{ 0x168ba411, 0x7e26, 0x4749, { 0x98, 0xf0, 0xff, 0x2, 0x81, 0xd, 0x9b, 0x51 } };
// {7F31F590-6602-45c9-B3F8-F61AE05BD1D3}
static const GUID MlNowPlayingLangGUID =
{ 0x7f31f590, 0x6602, 0x45c9, { 0xb3, 0xf8, 0xf6, 0x1a, 0xe0, 0x5b, 0xd1, 0xd3 } };
// {F8756C00-11D2-4857-8C50-163AE4A57783}
static const GUID MlHistoryLangGUID =
{ 0xf8756c00, 0x11d2, 0x4857, { 0x8c, 0x50, 0x16, 0x3a, 0xe4, 0xa5, 0x77, 0x83 } };
// {5E766B4F-818E-4f14-9C42-0902B2C571DC}
static const GUID MlPlaylistsLangGUID =
{ 0x5e766b4f, 0x818e, 0x4f14, { 0x9c, 0x42, 0x9, 0x2, 0xb2, 0xc5, 0x71, 0xdc } };
// {D006C700-557E-43c7-A580-B4C50C56957A}
static const GUID MlOnlineLangGUID =
{ 0xd006c700, 0x557e, 0x43c7, { 0xa5, 0x80, 0xb4, 0xc5, 0xc, 0x56, 0x95, 0x7a } };
// {5F633543-148D-48cc-B683-DA82F592CF28}
static const GUID MlReplayGainLangGUID =
{ 0x5f633543, 0x148d, 0x48cc, { 0xb6, 0x83, 0xda, 0x82, 0xf5, 0x92, 0xcf, 0x28 } };
// {699B8BA5-B292-4aba-8047-D46B0DF4E1D6}
static const GUID MlTranscodeLangGUID =
{ 0x699b8ba5, 0xb292, 0x4aba, { 0x80, 0x47, 0xd4, 0x6b, 0xd, 0xf4, 0xe1, 0xd6 } };
// {34DF1A2D-7EAD-41ab-B1A7-9AFA6DE2AFF1}
static const GUID EncWavLangGUID =
{ 0x34df1a2d, 0x7ead, 0x41ab, { 0xb1, 0xa7, 0x9a, 0xfa, 0x6d, 0xe2, 0xaf, 0xf1 } };
// {33BC12FD-E7F7-42ec-8FE3-2D8BD3A977C2}
static const GUID EncWMALangGUID =
{ 0x33bc12fd, 0xe7f7, 0x42ec, { 0x8f, 0xe3, 0x2d, 0x8b, 0xd3, 0xa9, 0x77, 0xc2 } };
// {8FBADBBB-B4D5-47d9-A723-5C8C8E88EE73}
static const GUID EncAACLangGUID =
{ 0x8fbadbbb, 0xb4d5, 0x47d9, { 0xa7, 0x23, 0x5c, 0x8c, 0x8e, 0x88, 0xee, 0x73 } };
// {F1534ECA-6E64-42c2-9781-812E61154515}
static const GUID EncLameLangGUID =
{ 0xf1534eca, 0x6e64, 0x42c2, { 0x97, 0x81, 0x81, 0x2e, 0x61, 0x15, 0x45, 0x15 } };
// deprecated enc_flac.dll based on FLAKE
// {5C0BA1EE-5A59-47cc-BC28-5B9F0C5EA1B7}
static const GUID EncFlakeLangGUID =
{ 0x5c0ba1ee, 0x5a59, 0x47cc, { 0xbc, 0x28, 0x5b, 0x9f, 0xc, 0x5e, 0xa1, 0xb7 } };
// {A23C2B70-C66B-475e-8A67-E0F33FD5BD12}
static const GUID EncVorbisLangGUID =
{ 0xa23c2b70, 0xc66b, 0x475e, { 0x8a, 0x67, 0xe0, 0xf3, 0x3f, 0xd5, 0xbd, 0x12 } };
// {D40620FB-E44B-47b3-98EE-8E5A089C0C94}
static const GUID tagzLangGUID =
{ 0xd40620fb, 0xe44b, 0x47b3, { 0x98, 0xee, 0x8e, 0x5a, 0x8, 0x9c, 0xc, 0x94 } };
// {06A3F81D-043D-4b5c-B341-590ED7053492}
static const GUID MlLocalLangGUID =
{ 0x6a3f81d, 0x43d, 0x4b5c, { 0xb3, 0x41, 0x59, 0xe, 0xd7, 0x5, 0x34, 0x92 } };
// {706549D3-D813-45dd-9A0B-E3793A1B63A8}
static const GUID MlDownloadsLangGUID =
{ 0x706549d3, 0xd813, 0x45dd, { 0x9a, 0xb, 0xe3, 0x79, 0x3a, 0x1b, 0x63, 0xa8 } };
// {1FF327B2-A41D-4c67-A58A-EB09BA1470D3}
static const GUID MlWireLangGUID =
{ 0x1ff327b2, 0xa41d, 0x4c67, { 0xa5, 0x8a, 0xeb, 0x9, 0xba, 0x14, 0x70, 0xd3 } };
// {04C986EE-9CE3-4369-820D-A64394C63D60}
static const GUID MlPMPLangGUID =
{ 0x4c986ee, 0x9ce3, 0x4369, { 0x82, 0xd, 0xa6, 0x43, 0x94, 0xc6, 0x3d, 0x60 } };
// {E553C1A4-5DE2-4838-8000-FDF8DC377DD4}
static const GUID PmpUSBLangGUID =
{ 0xe553c1a4, 0x5de2, 0x4838, { 0x80, 0x0, 0xfd, 0xf8, 0xdc, 0x37, 0x7d, 0xd4 } };
// {01C3E74C-261E-45e2-AA30-ED4039DCD3A2}
static const GUID PmpP4SLangGUID =
{ 0x1c3e74c, 0x261e, 0x45e2, { 0xaa, 0x30, 0xed, 0x40, 0x39, 0xdc, 0xd3, 0xa2 } };
// {4F5B2300-19D1-4390-BE04-89019441100B}
static const GUID PmpNJBLangGUID =
{ 0x4f5b2300, 0x19d1, 0x4390, { 0xbe, 0x4, 0x89, 0x1, 0x94, 0x41, 0x10, 0xb } };
// {B81F32B8-4AA4-4eba-8798-95F13812F638}
static const GUID PmpACTIVESYNCLangGUID =
{ 0xb81f32b8, 0x4aa4, 0x4eba, { 0x87, 0x98, 0x95, 0xf1, 0x38, 0x12, 0xf6, 0x38 } };
// {C2EE3DA5-B29B-42a0-AB5E-B202393435D6}
static const GUID PmpIPODLangGUID =
{ 0xc2ee3da5, 0xb29b, 0x42a0, { 0xab, 0x5e, 0xb2, 0x2, 0x39, 0x34, 0x35, 0xd6 } };
// {2C913A2F-CD49-40a1-8F1A-8EF7C2A22229}
static const GUID MlDiscLangGUID =
{ 0x2c913a2f, 0xcd49, 0x40a1, { 0x8f, 0x1a, 0x8e, 0xf7, 0xc2, 0xa2, 0x22, 0x29 } };
// {1A710E67-5180-49ac-8102-105856ED0A2F}
static const GUID OutDiskLangGUID =
{ 0x1a710e67, 0x5180, 0x49ac, { 0x81, 0x2, 0x10, 0x58, 0x56, 0xed, 0xa, 0x2f } };
// {858FBF71-9878-4d86-BFDD-8FEA8361238C}
static const GUID VisNFSFLangGUID =
{ 0x858fbf71, 0x9878, 0x4d86, { 0xbf, 0xdd, 0x8f, 0xea, 0x83, 0x61, 0x23, 0x8c } };
// {BE608673-B723-4a59-9EBA-52DC77109E10}
static const GUID VisAVSLangGUID =
{ 0xbe608673, 0xb723, 0x4a59, { 0x9e, 0xba, 0x52, 0xdc, 0x77, 0x10, 0x9e, 0x10 } };
// {226275F6-3318-4d4b-A6B3-5B1B5B077BE8}
static const GUID VisMilkdropLangGUID =
{ 0x226275f6, 0x3318, 0x4d4b, { 0xa6, 0xb3, 0x5b, 0x1b, 0x5b, 0x7, 0x7b, 0xe8 } };
// {C5D175F1-E4E4-47ee-B85C-4EDC6B026A35}
static const GUID VisMilk2LangGUID =
{ 0xc5d175f1, 0xe4e4, 0x47ee, { 0xb8, 0x5c, 0x4e, 0xdc, 0x6b, 0x2, 0x6a, 0x35 } };
// {87DCEEC2-1EC3-4c59-BED4-E8F42232C7D8}
static const GUID InCDDALangGUID =
{ 0x87dceec2, 0x1ec3, 0x4c59, { 0xbe, 0xd4, 0xe8, 0xf4, 0x22, 0x32, 0xc7, 0xd8 } };
// {20395FD0-AC67-446d-B8D0-D88BFD3174FC}
static const GUID IndshowLangGUID =
{ 0x20395fd0, 0xac67, 0x446d, { 0xb8, 0xd0, 0xd8, 0x8b, 0xfd, 0x31, 0x74, 0xfc } };
// {9475116B-F8C4-4dff-BC19-9601B238557D}
static const GUID InFlacLangGUID =
{ 0x9475116b, 0xf8c4, 0x4dff, { 0xbc, 0x19, 0x96, 0x1, 0xb2, 0x38, 0x55, 0x7d } };
// {EA1C197A-D227-474c-A9FD-1C79DE722BDD}
static const GUID InLineInLangGUID =
{ 0xea1c197a, 0xd227, 0x474c, { 0xa9, 0xfd, 0x1c, 0x79, 0xde, 0x72, 0x2b, 0xdd } };
// {96374982-0142-41a5-AEDE-244505C45D30}
static const GUID InWavLangGUID =
{ 0x96374982, 0x142, 0x41a5, { 0xae, 0xde, 0x24, 0x45, 0x5, 0xc4, 0x5d, 0x30 } };
// {5C5BCA4E-279E-4867-8E24-58C8B186959A}
static const GUID InVorbisLangGUID =
{ 0x5c5bca4e, 0x279e, 0x4867, { 0x8e, 0x24, 0x58, 0xc8, 0xb1, 0x86, 0x95, 0x9a } };
// {A786C0B0-69DE-49e2-9461-4F592808B0B3}
static const GUID ndeLangGUID =
{ 0xa786c0b0, 0x69de, 0x49e2, { 0x94, 0x61, 0x4f, 0x59, 0x28, 0x8, 0xb0, 0xb3 } };
// {11B847DB-29A7-47ac-B386-43B40385B817}
static const GUID InNSVLangGUID =
{ 0x11b847db, 0x29a7, 0x47ac, { 0xb3, 0x86, 0x43, 0xb4, 0x3, 0x85, 0xb8, 0x17 } };
// {5F24DF00-C163-4eaa-AB9D-22F106588C25}
static const GUID MLOrbLangGUID =
{ 0x5f24df00, 0xc163, 0x4eaa, { 0xab, 0x9d, 0x22, 0xf1, 0x6, 0x58, 0x8c, 0x25 } };
// {0FED0FEE-C995-4499-AB47-E2482336C046}
static const GUID InMidiLangGUID =
{ 0xfed0fee, 0xc995, 0x4499, { 0xab, 0x47, 0xe2, 0x48, 0x23, 0x36, 0xc0, 0x46 } };
// {F30C75C1-D284-4cd5-9CED-2BD9E7869438}
static const GUID InMp4LangGUID =
{ 0xf30c75c1, 0xd284, 0x4cd5, { 0x9c, 0xed, 0x2b, 0xd9, 0xe7, 0x86, 0x94, 0x38 } };
// {CD3EEF98-011C-4213-BC16-3F91C937B9B8}
static const GUID InMp3LangGUID =
{ 0xcd3eef98, 0x11c, 0x4213, { 0xbc, 0x16, 0x3f, 0x91, 0xc9, 0x37, 0xb9, 0xb8 } };
// {A1A39D49-671A-4c2f-AE42-BEA134EAF6A9}
static const GUID InModLangGUID =
{ 0xa1a39d49, 0x671a, 0x4c2f, { 0xae, 0x42, 0xbe, 0xa1, 0x34, 0xea, 0xf6, 0xa9 } };
// {4B567AEB-89CE-4881-9D7D-B31D7B65979A}
static const GUID DspSpsLangGUID =
{ 0x4b567aeb, 0x89ce, 0x4881, { 0x9d, 0x7d, 0xb3, 0x1d, 0x7b, 0x65, 0x97, 0x9a } };
// {004A91D9-CCD6-44e5-973A-4B7045C4662B}
static const GUID OutWaveLangGUID =
{ 0x4a91d9, 0xccd6, 0x44e5, { 0x97, 0x3a, 0x4b, 0x70, 0x45, 0xc4, 0x66, 0x2b } };
// {A812F3D3-633B-4af6-8749-3BA75290BAC0}
static const GUID OutDSLangGUID =
{ 0xa812f3d3, 0x633b, 0x4af6, { 0x87, 0x49, 0x3b, 0xa7, 0x52, 0x90, 0xba, 0xc0 } };
// {C5B78F09-3222-4a64-AA98-F1ABC5A9E355}
static const GUID InWmLangGUID =
{ 0xc5b78f09, 0x3222, 0x4a64, { 0xaa, 0x98, 0xf1, 0xab, 0xc5, 0xa9, 0xe3, 0x55 } };
// {C14FAE1D-B410-459f-B008-1A8BE3633000}
static const GUID burnlibLangGUID =
{ 0xc14fae1d, 0xb410, 0x459f, { 0xb0, 0x8, 0x1a, 0x8b, 0xe3, 0x63, 0x30, 0x0 } };
// {ACD05A75-030B-4943-A100-540DAD98FB00}
static const GUID GenFFLangGUID =
{ 0xacd05a75, 0x30b, 0x4943, { 0xa1, 0x0, 0x54, 0xd, 0xad, 0x98, 0xfb, 0x0 } };
// {0CE0174D-8334-479e-B322-9D80D48FC74D}
static const GUID MlPlgLangGUID =
{ 0xce0174d, 0x8334, 0x479e, { 0xb3, 0x22, 0x9d, 0x80, 0xd4, 0x8f, 0xc7, 0x4d } };
// {9E398E5F-EDEC-4dd8-A40D-E29B385A88C0}
static const GUID playlistLangGUID =
{ 0x9e398e5f, 0xedec, 0x4dd8, { 0xa4, 0xd, 0xe2, 0x9b, 0x38, 0x5a, 0x88, 0xc0 } };
// {092A97EF-7DC0-41a7-80D1-90DEEB18F12D}
static const GUID GenCrasherLangGUID =
{ 0x92a97ef, 0x7dc0, 0x41a7, { 0x80, 0xd1, 0x90, 0xde, 0xeb, 0x18, 0xf1, 0x2d } };
// {D8DBA660-90BD-431d-8F4E-189D6ACB407E}
static const GUID MlAutoTagLangGUID =
{ 0xd8dba660, 0x90bd, 0x431d, { 0x8f, 0x4e, 0x18, 0x9d, 0x6a, 0xcb, 0x40, 0x7e } };
// {EC959D43-9122-4807-B928-7B46207AFA49}
static const GUID InFlvLangGUID =
{ 0xec959d43, 0x9122, 0x4807, { 0xb9, 0x28, 0x7b, 0x46, 0x20, 0x7a, 0xfa, 0x49 } };
// {2430A7AC-317D-4d64-B33C-E1452A6384A2}
static const GUID InSwfLangGUID =
{ 0x2430a7ac, 0x317d, 0x4d64, { 0xb3, 0x3c, 0xe1, 0x45, 0x2a, 0x63, 0x84, 0xa2 } };
// {22661553-8D22-4012-8D3B-0FF8FE57A9ED}
static const GUID MlImpexLangGUID =
{ 0x22661553, 0x8d22, 0x4012, { 0x8d, 0x3b, 0xf, 0xf8, 0xfe, 0x57, 0xa9, 0xed } };
// {73760073-560C-433b-BC59-3FCC94CDEA4A}
static const GUID EncFlacLangGUID =
{ 0x73760073, 0x560c, 0x433b, { 0xbc, 0x59, 0x3f, 0xcc, 0x94, 0xcd, 0xea, 0x4a } };
// {95C65BA3-3C34-40ec-AE74-8D2C60AAE3C8}
static const GUID authLangGUID =
{ 0x95c65ba3, 0x3c34, 0x40ec, { 0xae, 0x74, 0x8d, 0x2c, 0x60, 0xaa, 0xe3, 0xc8 } };
// {CA36E14A-3742-4edc-A40F-2BC87F26B347}
static const GUID InAviLangGUID =
{ 0xca36e14a, 0x3742, 0x4edc, { 0xa4, 0xf, 0x2b, 0xc8, 0x7f, 0x26, 0xb3, 0x47 } };
// {5BDA8055-292D-4fcd-8404-884C2A34A8F9}
static const GUID InMkvLangGUID =
{ 0x5bda8055, 0x292d, 0x4fcd, { 0x84, 0x4, 0x88, 0x4c, 0x2a, 0x34, 0xa8, 0xf9 } };
// {0233DC7B-7060-43e5-8354-D2F2C7C7611D}
static const GUID GenMudLangGUID =
{ 0x233dc7b, 0x7060, 0x43e5, { 0x83, 0x54, 0xd2, 0xf2, 0xc7, 0xc7, 0x61, 0x1d } };
// {DCCF5A41-D16B-452b-8B7A-CFCA3360D8E8}
static const GUID omBrowserLangGUID =
{ 0xdccf5a41, 0xd16b, 0x452b, { 0x8b, 0x7a, 0xcf, 0xca, 0x33, 0x60, 0xd8, 0xe8 } };
// Winamp Android plugin (pmp_android.dll)
// {EBFF6E00-39D8-45e6-B3EC-E3B07A45E6B0}
static const GUID PmpAndroidLangGUID =
{ 0xebff6e00, 0x39d8, 0x45e6, { 0xb3, 0xec, 0xe3, 0xb0, 0x7a, 0x45, 0xe6, 0xb0 } };
// Winamp Wifi plugin (pmp_wifi.dll)
// {3066887B-CA40-4683-897F-4416FE349D7E}
static const GUID PmpWifiLangGUID =
{ 0x3066887b, 0xca40, 0x4683, { 0x89, 0x7f, 0x44, 0x16, 0xfe, 0x34, 0x9d, 0x7e } };
/*
** These are guids for known 3rd party lng files
*/
// WavPack Input plugin (in_wv.dll)
// {6DE2E465-690E-4df1-B6E2-2A9B33ED3DBB}
static const GUID InWvLangGuid =
{ 0x6de2e465, 0x690e, 0x4df1, { 0xb6, 0xe2, 0x2a, 0x9b, 0x33, 0xed, 0x3d, 0xbb } };
// Nullsoft Waveform Wrapper plugin (in_wav.dll)
// {1CED00E8-4B1B-4e10-A188-9A7C6BBEB421}
static const GUID InWavLangGuid =
{ 0x1ced00e8, 0x4b1b, 0x4e10, { 0xa1, 0x88, 0x9a, 0x7c, 0x6b, 0xbe, 0xb4, 0x21 } };
// Jump To File Extra (JTFE) plugin (gen_jumpex.dll)
// Note: this used to be {243355FE-8B16-48d2-89C3-FD80B3902875} but was changed with
// v1.1 (the build in 5.58) due to mass of changes to the file to ensure that
// this will work correctly if an old / partial file is present in the langpack
// {4693FA7D-2055-4b36-A239-0AD998B5A884}
static const GUID GenJTFELangGUID =
{ 0x4693fa7d, 0x2055, 0x4b36, { 0xa2, 0x39, 0xa, 0xd9, 0x98, 0xb5, 0xa8, 0x84 } };
// Time Restore & Autoplay (TRAP) plugin (gen_timerestore.dll)
// {75854C46-1F1A-4fae-B3FA-EEA6B253490E}
static const GUID GenTRAPLangGUID =
{ 0x75854c46, 0x1f1a, 0x4fae, { 0xb3, 0xfa, 0xee, 0xa6, 0xb2, 0x53, 0x49, 0xe } };
// Playlist File Remover (PLFR) plugin (gen_play_remove.dll)
// {58D8276F-12DD-44a7-A930-AA336BC8BA9A}
static const GUID GenPLFRLangGUID =
{ 0x58d8276f, 0x12dd, 0x44a7, { 0xa9, 0x30, 0xaa, 0x33, 0x6b, 0xc8, 0xba, 0x9a } };
// Skin Manager plugin (gen_skinmanager.dll)
// {D877C116-0201-44b2-A003-335C0600BF7A}
static const GUID GenSkinManagerGUID =
{ 0xd877c116, 0x201, 0x44b2, { 0xa0, 0x3, 0x33, 0x5c, 0x6, 0x0, 0xbf, 0x7a } };
// Playlist Undo plugin (gen_undo.dll)
// {3050F3A7-DADB-459f-900A-A8A224B7F32D}
static const GUID GenUndoLangGUID =
{ 0x3050f3a7, 0xdadb, 0x459f, { 0x90, 0xa, 0xa8, 0xa2, 0x24, 0xb7, 0xf3, 0x2d } };
// Playlist Separator plugin (in_text.dll)
// {505CAF53-D00E-4580-AA67-B31DEA6FE946}
static const GUID InTextLangGUID =
{ 0x505caf53, 0xd00e, 0x4580, { 0xaa, 0x67, 0xb3, 0x1d, 0xea, 0x6f, 0xe9, 0x46 } };
// One for Nunz plugin (gen_nunzio.dll)
// {CB659857-7468-40ef-BC51-844449253780}
static const GUID GenOne4NunzLangGUID =
{ 0xcb659857, 0x7468, 0x40ef, { 0xbc, 0x51, 0x84, 0x44, 0x49, 0x25, 0x37, 0x80 } };
// Save File As plugin (gen_saveas.dll)
// {71174948-4965-4f61-90F5-E53FF30E6578}
static const GUID GenSaveAsLangGUID =
{ 0x71174948, 0x4965, 0x4f61, { 0x90, 0xf5, 0xe5, 0x3f, 0xf3, 0xe, 0x65, 0x78 } };
// Yar-matey! Playlist Copier plugin (gen_yar.dll)
// {9725C8BF-B577-4d72-93EF-5FB41D88FFC2}
static const GUID GenYarLangGUID =
{ 0x9725c8bf, 0xb577, 0x4d72, { 0x93, 0xef, 0x5f, 0xb4, 0x1d, 0x88, 0xff, 0xc2 } };
// Album Art plugin (gen_classicart.dll)
// {EAD1E933-6D75-4c2c-B9C4-B4D7F06B7D8D}
static const GUID GenClasicArtGUID =
{ 0xead1e933, 0x6d75, 0x4c2c, { 0xb9, 0xc4, 0xb4, 0xd7, 0xf0, 0x6b, 0x7d, 0x8d } };
// Windows 7 Taskbar Integration plugin (gen_win7shell.dll)
// {7204A532-5D37-415d-B431-272C953B7459}
static const GUID GenWin7ShellLangGUID =
{ 0x7204a532, 0x5d37, 0x415d, { 0xb4, 0x31, 0x27, 0x2c, 0x95, 0x3b, 0x74, 0x59 } };
// Find File on Disk plugin (gen_find_on_disk.dll)
// {8CCF206C-1EA0-484e-88A3-943B4C4AF272}
static const GUID GenFFODLangGUID =
{ 0x8ccf206c, 0x1ea0, 0x484e, { 0x88, 0xa3, 0x94, 0x3b, 0x4c, 0x4a, 0xf2, 0x72 } };
// ML Bookmark Categoriser plugin (ml_bkmk.dll)
// {C3BC5F81-B400-4c64-BCC5-3B758D6BE2E1}
static const GUID MlBkCatLangGUID =
{ 0xc3bc5f81, 0xb400, 0x4c64, { 0xbc, 0xc5, 0x3b, 0x75, 0x8d, 0x6b, 0xe2, 0xe1 } };
// Lite'n Winamp Preferences plugin (gen_nopro.dll)
// {E6C98DDD-FC99-4ccc-B845-79A81B8C1959}
static const GUID GenNoProLangGUID =
{ 0xe6c98ddd, 0xfc99, 0x4ccc, { 0xb8, 0x45, 0x79, 0xa8, 0x1b, 0x8c, 0x19, 0x59 } };
// ML Enqueue & Play plugin (ml_enqplay.dll)
// {0DF6B872-74C3-4236-BE78-E1EAE665C62D}
static const GUID MlEnqPlayLangGUID =
{ 0xdf6b872, 0x74c3, 0x4236, { 0xbe, 0x78, 0xe1, 0xea, 0xe6, 0x65, 0xc6, 0x2d } };
// YMAMP (in_ym.dll)
// {C5F9EFFA-4727-4075-9017-A6BAE72B848C}
static const GUID InYMAMPLangGUID =
{ 0xc5f9effa, 0x4727, 0x4075, { 0x90, 0x17, 0xa6, 0xba, 0xe7, 0x2b, 0x84, 0x8c } };
// SNESAmp wrapper (in_snes.dll + in_snes.trb + in_snes_trb.lng)
// {7B2084F6-B7A7-449b-A133-12F1916F188E}
static const GUID InSNESWrapperLangGUID =
{ 0x7b2084f6, 0xb7a7, 0x449b, { 0xa1, 0x33, 0x12, 0xf1, 0x91, 0x6f, 0x18, 0x8e } };
// View Current File Information Hotkey (gen_wolfgang) plugin
// {E16E2C50-71AB-4188-9193-B9D5FB127F97}
static const GUID GenWolfgangLangGUID =
{ 0xe16e2c50, 0x71ab, 0x4188, { 0x91, 0x93, 0xb9, 0xd5, 0xfb, 0x12, 0x7f, 0x97 } };
// Mute Hotkey (gen_mute) plugin
// {E87B8C7F-51DA-442c-BB2A-D5F941318853}
static const GUID GenMuteLangGUID =
{ 0xe87b8c7f, 0x51da, 0x442c, { 0xbb, 0x2a, 0xd5, 0xf9, 0x41, 0x31, 0x88, 0x53 } };
// Play Random Song Hotkey (gen_prs) plugin
// {1112230B-6928-4f20-BD0E-F559FE6AD66E}
static const GUID GenPRSLangGUID =
{ 0x1112230b, 0x6928, 0x4f20, { 0xbd, 0xe, 0xf5, 0x59, 0xfe, 0x6a, 0xd6, 0x6e } };
// Randomise Playlist Hotkey (gen_grp) plugin
// {554151CC-ADEC-4bdc-8A96-7812BF69058D}
static const GUID GenRandPLLangGUID =
{ 0x554151cc, 0xadec, 0x4bdc, { 0x8a, 0x96, 0x78, 0x12, 0xbf, 0x69, 0x5, 0x8d } };
// Clear Current Playlist Hotkey (gen_gcp) plugin
// {1C71FF32-D2E1-403b-B39C-897AF7F4B4AE}
static const GUID GenCleardPLLangGUID =
{ 0x1c71ff32, 0xd2e1, 0x403b, { 0xb3, 0x9c, 0x89, 0x7a, 0xf7, 0xf4, 0xb4, 0xae } };
// EQ Hotkeys (gen_eq_hotkeys) plugin
// {4EA319B6-955A-4519-807E-A36EEDDC6224}
static const GUID GenEQGHKLangGUID =
{ 0x4ea319b6, 0x955a, 0x4519, { 0x80, 0x7e, 0xa3, 0x6e, 0xed, 0xdc, 0x62, 0x24 } };
// Auto EQ (gen_autoeq) plugin
// {5A2E5855-239A-44a6-A49B-1F495BBFD0D6}
static const GUID GenAutoEQLangGUID =
{ 0x5a2e5855, 0x239a, 0x44a6, { 0xa4, 0x9b, 0x1f, 0x49, 0x5b, 0xbf, 0xd0, 0xd6 } };
// CD Menu Tweaker (gen_cd_menu.dll)
// {A609C17B-44F3-47d8-9B76-C660FF5D3739}
static const GUID GenCDMenuTweakLangGUID =
{ 0xa609c17b, 0x44f3, 0x47d8, { 0x9b, 0x76, 0xc6, 0x60, 0xff, 0x5d, 0x37, 0x39 } };
// Three Mode Repeat (gen_3mode.dll)
// {81EE2A10-80E9-4d22-B363-AEA820AE988F}
static const GUID Gen3ModeLangGUID =
{ 0x81ee2a10, 0x80e9, 0x4d22, { 0xb3, 0x63, 0xae, 0xa8, 0x20, 0xae, 0x98, 0x8f } };
// Taskbar Text Mod (gen_ttm.dll)
// {BBFD3662-DBDF-417a-AAAC-23914D55F24B}
static const GUID GenTTMLangGUID =
{ 0xbbfd3662, 0xdbdf, 0x417a, { 0xaa, 0xac, 0x23, 0x91, 0x4d, 0x55, 0xf2, 0x4b } };
// OS Pos Restorer (gen_os_diag.dll)
// {B5A3AD19-2180-45d7-AFFE-80D2B7575CD1}
static const GUID GenOSDiagLangGUID =
{ 0xb5a3ad19, 0x2180, 0x45d7, { 0xaf, 0xfe, 0x80, 0xd2, 0xb7, 0x57, 0x5c, 0xd1 } };
// Shuffle Restorer (gen_shuffle_restorer.dll)
// {B13ED906-B8E9-4753-B03F-351B05A6E250}
static const GUID GenShuffleRestorerLangGUID =
{ 0xb13ed906, 0xb8e9, 0x4753, { 0xb0, 0x3f, 0x35, 0x1b, 0x5, 0xa6, 0xe2, 0x50 } };
// Shuffle Change Blocker (gen_shufblock.dll)
// {FCCFABF2-6EF3-4651-A43C-F7CA38176889}
static const GUID GenShuffleBlockerLangGUID =
{ 0xfccfabf2, 0x6ef3, 0x4651, { 0xa4, 0x3c, 0xf7, 0xca, 0x38, 0x17, 0x68, 0x89 } };
// Single Click 'n' Play (gen_singleclick.dll)
// {AF67A1E2-8827-4fa3-9F9F-3A3DE2886022}
static const GUID GenSingleClickLangGUID =
{ 0xaf67a1e2, 0x8827, 0x4fa3, { 0x9f, 0x9f, 0x3a, 0x3d, 0xe2, 0x88, 0x60, 0x22 } };
// No Minimise (gen_no_min.dll)
// {8BCF7C51-6F88-455f-88FD-0B6911650997}
static const GUID GenNoMinimiseLangGUID =
{ 0x8bcf7c51, 0x6f88, 0x455f, { 0x88, 0xfd, 0xb, 0x69, 0x11, 0x65, 0x9, 0x97 } };
// Repeater (gen_repeater.dll)
// {1C4C8774-8BBC-4f11-851E-936BF5C85E96}
static const GUID GenRepeaterLangGUID =
{ 0x1c4c8774, 0x8bbc, 0x4f11, { 0x85, 0x1e, 0x93, 0x6b, 0xf5, 0xc8, 0x5e, 0x96 } };
// Alt Close (gen_alt_close.dll)
// {0FD70024-FA0E-4f4f-A0D4-CD560913C146}
static const GUID GenAltCloseLangGUID =
{ 0xfd70024, 0xfa0e, 0x4f4f, { 0xa0, 0xd4, 0xcd, 0x56, 0x9, 0x13, 0xc1, 0x46 } };
// ML Exporter (ml_exporter.dll)
// {3B441F40-E8E9-46bf-B399-556FB6CD4295}
static const GUID MLExporterLangGUID =
{ 0x3b441f40, 0xe8e9, 0x46bf, { 0xb3, 0x99, 0x55, 0x6f, 0xb6, 0xcd, 0x42, 0x95 } };
// Silence Detector DSP (dsp_silence_detect.dll)
// {15CCEBE6-C1F5-4246-A7B0-A6E66025C01C}
static const GUID DspSilenceDetectLangGUID =
{ 0x15ccebe6, 0xc1f5, 0x4246, { 0xa7, 0xb0, 0xa6, 0xe6, 0x60, 0x25, 0xc0, 0x1c } };
// Skinned Preferences (gen_prefs_skin.dll)
// {AE99B23F-0E51-4a99-9AB0-21AEA7B4B3CA}
static const GUID GenSkinPrefsLangGUID =
{ 0xae99b23f, 0xe51, 0x4a99, { 0x9a, 0xb0, 0x21, 0xae, 0xa7, 0xb4, 0xb3, 0xca } };
// Jump to Track (gen_jtt.dll)
// {D7D804A3-0794-4761-B43B-4873E5B41873}
static const GUID GenJTTLangGUID =
{ 0xd7d804a3, 0x794, 0x4761, { 0xb4, 0x3b, 0x48, 0x73, 0xe5, 0xb4, 0x18, 0x73 } };
// Jump to Time Extra (gen_jumptotime.dll)
// {9B5DC220-F06A-44cc-909E-D2157513F280}
static const GUID GenJumpToTimeLangGUID =
{ 0x9b5dc220, 0xf06a, 0x44cc, { 0x90, 0x9e, 0xd2, 0x15, 0x75, 0x13, 0xf2, 0x80 } };
// Jumper (gen_jumper.dll)
// {5D793BF9-0903-4bc9-A78D-D10AB92C7EE5}
static const GUID GenJumperLangGUID =
{ 0x5d793bf9, 0x903, 0x4bc9, { 0xa7, 0x8d, 0xd1, 0xa, 0xb9, 0x2c, 0x7e, 0xe5 } };
// One Click Show and Hide (gen_one_click.dll)
// {8F3FCFB3-1F5A-43c6-A71E-891026479301}
static const GUID GenOneClickLangGUID =
{ 0x8f3fcfb3, 0x1f5a, 0x43c6, { 0xa7, 0x1e, 0x89, 0x10, 0x26, 0x47, 0x93, 0x1 } };
// Playback Excluder (gen_exclude.dll)
// {15C44197-EBC5-4cc7-B935-EDE40C9C1AF6}
static const GUID GenPlaybackExluderLangGUID =
{ 0x15c44197, 0xebc5, 0x4cc7, { 0xb9, 0x35, 0xed, 0xe4, 0xc, 0x9c, 0x1a, 0xf6 } };
// Close to Notification Area (gen_d3x7r0.dll)
// {2A3BC93A-99FF-469a-A94B-576218CF6265}
static const GUID GenCloseToNotAreaLangGUID =
{ 0x2a3bc93a, 0x99ff, 0x469a, { 0xa9, 0x4b, 0x57, 0x62, 0x18, 0xcf, 0x62, 0x65 } };
// Crop Die (gen_crop_die.dll)
// {9E79066C-58C5-41b9-9361-C1951DA989CD}
static const GUID GenCropDieLangGUID =
{ 0x9e79066c, 0x58c5, 0x41b9, { 0x93, 0x61, 0xc1, 0x95, 0x1d, 0xa9, 0x89, 0xcd } };
// Play Selected Song Hotkey (gen_gpss.dll)
// {94E8B2B6-685F-484b-9938-EC929F6874EC}
static const GUID GenPlaySelGHKLangGUID =
{ 0x94e8b2b6, 0x685f, 0x484b, { 0x99, 0x38, 0xec, 0x92, 0x9f, 0x68, 0x74, 0xec } };
// Close After Current (gen_cac.dll)
// {8B6A33FB-A6C5-49a0-A52A-0A0F14913BB2}
static const GUID GenCACLangGUID =
{ 0x8b6a33fb, 0xa6c5, 0x49a0, { 0xa5, 0x2a, 0xa, 0xf, 0x14, 0x91, 0x3b, 0xb2 } };
// Enhancer Wrapper DSP (dsp_enhancer.dll)
// {78842EF6-CCA2-410c-9E23-C498ABB24373}
static const GUID DspEnhancerLangGUID =
{ 0x78842ef6, 0xcca2, 0x410c, { 0x9e, 0x23, 0xc4, 0x98, 0xab, 0xb2, 0x43, 0x73 } };
// Shutdown on Close (gen_soc.dll)
// {CAE88304-4A0B-46e5-8B50-BEDFAE00FA6A}
static const GUID GenSOCLangGUID =
{ 0xcae88304, 0x4a0b, 0x46e5, { 0x8b, 0x50, 0xbe, 0xdf, 0xae, 0x0, 0xfa, 0x6a } };
// Mouse Wheel Blocker (gen_mwblock.dll)
// {C9D6697C-4C7B-4aec-A4C7-45395F0771EA}
static const GUID GenMouseWheelBlockLangGUID =
{ 0xc9d6697c, 0x4c7b, 0x4aec, { 0xa4, 0xc7, 0x45, 0x39, 0x5f, 0x7, 0x71, 0xea } };
// ML Icon Control plugin (ml_icon_control.dll)
// {4A55AE4D-B3CB-42df-A94E-53588FD761BA}
static const GUID MlIconControlLangGUID=
{ 0x4a55ae4d, 0xb3cb, 0x42df, { 0xa9, 0x4e, 0x53, 0x58, 0x8f, 0xd7, 0x61, 0xba } };
// File Copier plug-in (gen_copy.dll)
// {A2121FC9-6FC3-4a56-88F2-A36FF64D10EA}
static const GUID GenFileCopierLangGUID =
{ 0xa2121fc9, 0x6fc3, 0x4a56, { 0x88, 0xf2, 0xa3, 0x6f, 0xf6, 0x4d, 0x10, 0xea } };
// Shoutcast Source DSP plug-in
// {FD4D4A01-C337-4144-85D7-00678B3B2D2D}
static const GUID DspShoutcastLangGUID =
{ 0xfd4d4a01, 0xc337, 0x4144, { 0x85, 0xd7, 0x0, 0x67, 0x8b, 0x3b, 0x2d, 0x2d } };
#ifdef __cplusplus
} // extern "C"
#endif
#endif

View file

@ -0,0 +1,161 @@
#include "Winamp/in2.h"
#include "Winamp/wa_ipc.h"
#include "Wasabi.h"
AlbumArtFactory albumArtFactory;
class WavPack_AlbumArtProvider : public svc_albumArtProvider
{
public:
bool IsMine(const wchar_t *filename);
int ProviderType();
// implementation note: use WASABI_API_MEMMGR to alloc bits and mimetype, so that the recipient can free through that
int GetAlbumArtData(const wchar_t *filename, const wchar_t *type, void **bits, size_t *len, wchar_t **mimeType);
int SetAlbumArtData(const wchar_t *filename, const wchar_t *type, void *bits, size_t len, const wchar_t *mimeType);
int DeleteAlbumArt(const wchar_t *filename, const wchar_t *type);
protected:
RECVS_DISPATCH;
};
static const wchar_t *GetLastCharactercW(const wchar_t *string)
{
if (!string || !*string)
return string;
return CharPrevW(string, string+lstrlenW(string));
}
static const wchar_t *scanstr_backW(const wchar_t *str, const wchar_t *toscan, const wchar_t *defval)
{
const wchar_t *s = GetLastCharactercW(str);
if (!str[0]) return defval;
if (!toscan || !toscan[0]) return defval;
while (1)
{
const wchar_t *t = toscan;
while (*t)
{
if (*t == *s) return s;
t = CharNextW(t);
}
t = CharPrevW(str, s);
if (t == s)
return defval;
s = t;
}
}
static const wchar_t *extensionW(const wchar_t *fn)
{
const wchar_t *end = scanstr_backW(fn, L"./\\", 0);
if (!end)
return (fn+lstrlenW(fn));
if (*end == L'.')
return end+1;
return (fn+lstrlenW(fn));
}
int WavPack_HandlesExtension(const wchar_t *extension);
bool WavPack_AlbumArtProvider::IsMine(const wchar_t *filename)
{
const wchar_t *extension = extensionW(filename);
if (extension && *extension)
{
return WavPack_HandlesExtension(extension) != 0;
}
return false;
}
int WavPack_AlbumArtProvider::ProviderType()
{
return ALBUMARTPROVIDER_TYPE_EMBEDDED;
}
int WavPack_GetAlbumArt(const wchar_t *filename, const wchar_t *type, void **bits, size_t *len, wchar_t **mime_type);
int WavPack_AlbumArtProvider::GetAlbumArtData(const wchar_t *filename, const wchar_t *type, void **bits, size_t *len, wchar_t **mime_type)
{
return WavPack_GetAlbumArt(filename, type, bits, len, mime_type);
}
int WavPack_SetAlbumArt(const wchar_t *filename, const wchar_t *type, void *bits, size_t len, const wchar_t *mime_type);
int WavPack_AlbumArtProvider::SetAlbumArtData(const wchar_t *filename, const wchar_t *type, void *bits, size_t len, const wchar_t *mime_type)
{
return WavPack_SetAlbumArt(filename, type, bits, len, mime_type);
}
int WavPack_DeleteAlbumArt(const wchar_t *filename, const wchar_t *type);
int WavPack_AlbumArtProvider::DeleteAlbumArt(const wchar_t *filename, const wchar_t *type)
{
return WavPack_DeleteAlbumArt(filename, type);
}
#define CBCLASS WavPack_AlbumArtProvider
START_DISPATCH;
CB(SVC_ALBUMARTPROVIDER_PROVIDERTYPE, ProviderType);
CB(SVC_ALBUMARTPROVIDER_GETALBUMARTDATA, GetAlbumArtData);
CB(SVC_ALBUMARTPROVIDER_ISMINE, IsMine);
CB(SVC_ALBUMARTPROVIDER_SETALBUMARTDATA, SetAlbumArtData);
CB(SVC_ALBUMARTPROVIDER_DELETEALBUMART, DeleteAlbumArt);
END_DISPATCH;
#undef CBCLASS
static WavPack_AlbumArtProvider albumArtProvider;
// {A558560E-4334-446a-9219-E1F34F518ADE}
static const GUID wavpack_albumartproviderGUID =
{ 0xa558560e, 0x4334, 0x446a, { 0x92, 0x19, 0xe1, 0xf3, 0x4f, 0x51, 0x8a, 0xde } };
FOURCC AlbumArtFactory::GetServiceType()
{
return svc_albumArtProvider::SERVICETYPE;
}
const char *AlbumArtFactory::GetServiceName()
{
return "WavPack Album Art Provider";
}
GUID AlbumArtFactory::GetGUID()
{
return wavpack_albumartproviderGUID;
}
void *AlbumArtFactory::GetInterface(int global_lock)
{
return &albumArtProvider;
}
int AlbumArtFactory::SupportNonLockingInterface()
{
return 1;
}
int AlbumArtFactory::ReleaseInterface(void *ifc)
{
return 1;
}
const char *AlbumArtFactory::GetTestString()
{
return 0;
}
int AlbumArtFactory::ServiceNotify(int msg, int param1, int param2)
{
return 1;
}
#define CBCLASS AlbumArtFactory
START_DISPATCH;
CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
CB(WASERVICEFACTORY_GETGUID, GetGUID)
CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
END_DISPATCH;
#undef CBCLASS

View file

@ -0,0 +1,66 @@
#ifndef NULLSOFT_API_H
#define NULLSOFT_API_H
#include "api/service/api_service.h"
extern api_service *serviceManager;
#define WASABI_API_SVC serviceManager
#include "api/service/waservicefactory.h"
#include "Agave/Config/api_config.h"
extern api_config *configApi;
#define AGAVE_API_CONFIG configApi
#include "api/memmgr/api_memmgr.h"
extern api_memmgr *memmgr;
#define WASABI_API_MEMMGR memmgr
#include "Agave/Language/api_language.h"
#include "Agave/AlbumArt/svc_albumArtProvider.h"
template <class api_T>
static void ServiceBuild(api_T *&api_t, GUID factoryGUID_t)
{
if (WASABI_API_SVC)
{
waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
if (factory)
api_t = (api_T *)factory->getInterface();
}
}
template <class api_T>
static void ServiceRelease(api_T *api_t, GUID factoryGUID_t)
{
if (WASABI_API_SVC)
{
waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
if (factory)
factory->releaseInterface(api_t);
}
}
class AlbumArtFactory : public waServiceFactory
{
public:
FOURCC GetServiceType();
const char *GetServiceName();
GUID GetGUID();
void *GetInterface(int global_lock);
int SupportNonLockingInterface();
int ReleaseInterface(void *ifc);
const char *GetTestString();
int ServiceNotify(int msg, int param1, int param2);
protected:
RECVS_DISPATCH;
};
extern AlbumArtFactory albumArtFactory;
// {B6CB4A7C-A8D0-4c55-8E60-9F7A7A23DA0F}
static const GUID playbackConfigGroupGUID =
{ 0xb6cb4a7c, 0xa8d0, 0x4c55, { 0x8e, 0x60, 0x9f, 0x7a, 0x7a, 0x23, 0xda, 0xf } };
#endif

View file

@ -0,0 +1,65 @@
#ifndef NULLSOFT_WINAMP_DSP_H
#define NULLSOFT_WINAMP_DSP_H
// DSP plugin interface
// notes:
// any window that remains in foreground should optimally pass unused
// keystrokes to the parent (winamp's) window, so that the user
// can still control it. As for storing configuration,
// Configuration data should be stored in <dll directory>\plugin.ini
// (look at the vis plugin for configuration code)
typedef struct winampDSPModule {
char *description; // description
HWND hwndParent; // parent window (filled in by calling app)
HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
void (*Config)(struct winampDSPModule *this_mod); // configuration dialog (if needed)
int (*Init)(struct winampDSPModule *this_mod); // 0 on success, creates window, etc (if needed)
// modify waveform samples: returns number of samples to actually write
// (typically numsamples, but no more than twice numsamples, and no less than half numsamples)
// numsamples should always be at least 128. should, but I'm not sure
int (*ModifySamples)(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate);
void (*Quit)(struct winampDSPModule *this_mod); // called when unloading
void *userData; // user data, optional
} winampDSPModule;
typedef struct {
int version; // DSP_HDRVER
char *description; // description of library
winampDSPModule* (*getModule)(int); // module retrieval function
int (*sf)(int key); // DSP_HDRVER == 0x21
} winampDSPHeader;
// exported symbols
#ifdef USE_DSP_HDR_HWND
typedef winampDSPHeader* (*winampDSPGetHeaderType)(HWND);
#define DSP_HDRVER 0x22
#else
typedef winampDSPHeader* (*winampDSPGetHeaderType)(HWND);
// header version: 0x20 == 0.20 == winamp 2.0
#define DSP_HDRVER 0x20
#endif
// return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)
// which determine if we can uninstall the plugin immediately or on winamp restart
#define DSP_PLUGIN_UNINSTALL_NOW 0x0
#define DSP_PLUGIN_UNINSTALL_REBOOT 0x1
//
// uninstall support was added from 5.0+ and uninstall now support from 5.5+
// it is down to you to ensure that if uninstall now is returned that it will not cause a crash
// (ie don't use if you've been subclassing the main window)
// Version note:
//
// Added passing of Winamp's main hwnd in the call to the exported winampDSPHeader()
// which allows for primarily the use of localisation features with the bundled plugins.
// If you want to use the new version then either you can edit you version of dsp.h or
// you can add USE_DSP_HDR_HWND to your project's defined list or before use of dsp.h
//
#endif

View file

@ -0,0 +1,37 @@
#ifndef NULLSOFT_WINAMP_GEN_H
#define NULLSOFT_WINAMP_GEN_H
#include <windows.h>
#define GEN_INIT_SUCCESS 0
// return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)
// which determine if we can uninstall the plugin immediately or on winamp restart
//
// uninstall support was added from 5.0+ and uninstall now support from 5.5+
// it is down to you to ensure that if uninstall now is returned that it will not cause a crash
// (ie don't use if you've been subclassing the main window)
#define GEN_PLUGIN_UNINSTALL_NOW 0x1
#define GEN_PLUGIN_UNINSTALL_REBOOT 0x0
typedef struct {
int version;
char *description;
int (*init)();
void (*config)();
void (*quit)();
HWND hwndParent;
HINSTANCE hDllInstance;
} winampGeneralPurposePlugin;
#define GPPHDR_VER 0x10
#ifdef __cplusplus
extern "C" {
#endif
//extern winampGeneralPurposePlugin *gen_plugins[256];
typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)();
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,138 @@
#ifndef NULLSOFT_WINAMP_IN2H
#define NULLSOFT_WINAMP_IN2H
#include "out.h"
// note: exported symbol is now winampGetInModule2.
#define IN_UNICODE 0x0F000000
#ifdef UNICODE_INPUT_PLUGIN
#define in_char wchar_t
#define IN_VER (IN_UNICODE | 0x100)
#else
#define in_char char
#define IN_VER 0x100
#endif
#define IN_MODULE_FLAG_USES_OUTPUT_PLUGIN 1
// By default, Winamp assumes that your input plugin wants to use Winamp's EQ, and doesn't do replay gain
// if you handle any of these yourself (EQ, Replay Gain adjustments), then set these flags accordingly
#define IN_MODULE_FLAG_EQ 2 // set this if you do your own EQ
#define IN_MODULE_FLAG_REPLAYGAIN 8 // set this if you adjusted volume for replay gain
// for tracks with no replay gain metadata, you should clear this flag
// UNLESS you handle "non_replaygain" gain adjustment yourself
#define IN_MODULE_FLAG_REPLAYGAIN_PREAMP 16 // use this if you queried for the replay gain preamp parameter and used it
// this parameter is new to 5.54
typedef struct
{
int version; // module type (IN_VER)
char *description; // description of module, with version string
HWND hMainWindow; // winamp's main window (filled in by winamp)
HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp)
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 UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
// note that this has turned into a "flags" field
// see IN_MODULE_FLAG_*
void (*Config)(HWND hwndParent); // configuration dialog
void (*About)(HWND hwndParent); // about dialog
void (*Init)(); // called at program init
void (*Quit)(); // called at program quit
#define GETFILEINFO_TITLE_LENGTH 2048
void (*GetFileInfo)(const in_char *file, in_char *title, int *length_in_ms); // if file == NULL, current playing is used
#define INFOBOX_EDITED 0
#define INFOBOX_UNCHANGED 1
int (*InfoBox)(const in_char *file, HWND hwndParent);
int (*IsOurFile)(const in_char *fn); // called before extension checks, to allow detection of mms://, etc
// playback stuff
int (*Play)(const in_char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
void (*Pause)(); // pause stream
void (*UnPause)(); // unpause stream
int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not
void (*Stop)(); // stop (unload) stream
// time stuff
int (*GetLength)(); // get length in ms
int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime()
void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal your thread to seek, which seeks and calls outMod->Flush()..
// 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()
// call after opening audio device with max latency in ms and samplerate
void (*SAVSADeInit)(); // call in Stop()
// simple vis supplying mode
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 :)
// advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec))
// use when calling SAAdd()
int (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
// vis stuff (plug-in)
// simple vis supplying mode
void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
// quick and easy way to get vis working :)
// needs at least 576 samples :)
// advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
int (*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.
void (*VSASetInfo)(int srate, int nch); // <-- Correct (benski, dec 2005).. old declaration had the params backwards
// dsp plug-in processing:
// (filled in by winamp, calld 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)();
// 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);
// eq stuff
void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.
// info setting (filled in by winamp)
void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
Out_Module *outMod; // filled in by winamp, optionally used :)
} In_Module;
// return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)
// which determine if we can uninstall the plugin immediately or on winamp restart
//
// uninstall support was added from 5.0+ and uninstall now support from 5.5+
// it is down to you to ensure that if uninstall now is returned that it will not cause a crash
// (ie don't use if you've been subclassing the main window)
#define IN_PLUGIN_UNINSTALL_NOW 0x1
#define IN_PLUGIN_UNINSTALL_REBOOT 0x0
#endif

View file

@ -0,0 +1,65 @@
#ifndef NULLSOFT_API_AUDIOSTREAM_H
#define NULLSOFT_API_AUDIOSTREAM_H
#include <bfc/dispatch.h>
class api_audiostream : public Dispatchable
{
protected:
api_audiostream() {}
~api_audiostream() {}
public:
/* returns number of bytes written to buffer.
* a return value of 0 means EOF
*/
size_t ReadAudio(void *buffer, size_t sizeBytes); // TODO: killswitch and error code
size_t ReadAudio(void *buffer, size_t, int *killswitch, int *errorCode);
/* Seeks to a point in the stream in milliseconds
* returns TRUE if successful, FALSE otherwise
*/
int SeekToTimeMs(int millisecs);
/* returns 1 if this stream is seekable using SeekToTime, 0 otherwise
*/
int CanSeek();
public:
DISPATCH_CODES
{
API_AUDIOSTREAM_READAUDIO = 10,
API_AUDIOSTREAM_READAUDIO2 = 11,
API_AUDIOSTREAM_SEEKTOTIMEMS = 20,
API_AUDIOSTREAM_CANSEEK = 30,
};
};
inline size_t api_audiostream::ReadAudio(void *buffer, size_t sizeBytes)
{
return _call(API_AUDIOSTREAM_READAUDIO, (size_t)0, buffer, sizeBytes);
}
inline size_t api_audiostream::ReadAudio(void *buffer, size_t sizeBytes, int *killswitch, int *errorCode)
{
void *params[4] = { &buffer, &sizeBytes, &killswitch, &errorCode};
size_t retval;
if (_dispatch(API_AUDIOSTREAM_READAUDIO2, &retval, params, 4))
return retval;
else
{
*errorCode=0;
return ReadAudio(buffer, sizeBytes);
}
}
inline int api_audiostream::SeekToTimeMs(int millisecs)
{
return _call(API_AUDIOSTREAM_SEEKTOTIMEMS, (int)0, millisecs);
}
inline int api_audiostream::CanSeek()
{
return _call(API_AUDIOSTREAM_CANSEEK, (int)0);
}
#endif

View file

@ -0,0 +1,99 @@
#ifndef NULLSOFT_API_DECODEFILE_H
#define NULLSOFT_API_DECODEFILE_H
#include <bfc/dispatch.h>
#include <bfc/platform/types.h>
#include "api_audiostream.h"
enum
{
API_DECODEFILE_SUCCESS = 0,
API_DECODEFILE_FAILURE = 1,
API_DECODEFILE_UNSUPPORTED = 2, // type is unsupported
API_DECODEFILE_NO_INTERFACE = 3, // type is supported, but plugin does provide any interfaces for direct decoding
API_DECODEFILE_WINAMP_PRO = 4, // user has to pay $$$ to do this
API_DECODEFILE_NO_RIGHTS = 5, // user is not allowed to decode this file (e.g. DRM)
API_DECODEFILE_BAD_RESAMPLE = 6, // Winamp is unable to resample this file to CDDA format (stereo 16bit 44.1kHz)
};
enum
{
AUDIOPARAMETERS_FLOAT = 1,
};
struct AudioParameters
{
public:
AudioParameters() : bitsPerSample(0), channels(0), sampleRate(0), sampleRateReal(0.f), sizeBytes((size_t) - 1), errorCode(API_DECODEFILE_SUCCESS), flags(0)
{}
size_t bitsPerSample;
size_t channels;
size_t sampleRate;
float sampleRateReal; // yes this is duplicate.
int flags;
size_t sizeBytes; // total size of decoded file, (size_t)-1 means don't know
int errorCode;
};
class api_decodefile : public Dispatchable
{
public:
/* OpenAudioBackground gives you back an api_audiostream that you can use to get decompressed bits
* if it returns 0, check parameters->errorCode for the failure reason
* fill parameters with desired values (0 if you don't care)
* the decoder will _do its best_ to satisfy your passed-in audio parameters
* but this API does not guarantee them, so be sure to check the parameters struct after the function returns
* it's **UP TO YOU** to do any necessary conversion (sample rate, channels, bits-per-sample) if the decoder can't do it
*/
api_audiostream *OpenAudioBackground(const wchar_t *filename, AudioParameters *parameters);
/* OpenAudio is the same as OpenAudioBackground
* but, it will use the input plugin system to decode if necessary
* so it's best to use this in a separate winamp.exe
* to be honest, it was designed for internal use in the CD burner
* so it's best not to use this one at all
*/
api_audiostream *OpenAudio(const wchar_t *filename, AudioParameters *parameters);
void CloseAudio(api_audiostream *audioStream);
/* verifies that a decoder exists to decompress this filename.
this is not a guarantee tgat the file is openable, just that it can be matched to a decoder */
bool DecoderExists(const wchar_t *filename);
public:
DISPATCH_CODES
{
API_DECODEFILE_OPENAUDIO = 10,
API_DECODEFILE_OPENAUDIO2 = 11,
API_DECODEFILE_CLOSEAUDIO = 20,
API_DECODEFILE_DECODEREXISTS = 30,
};
};
inline api_audiostream *api_decodefile::OpenAudio(const wchar_t *filename, AudioParameters *parameters)
{
return _call(API_DECODEFILE_OPENAUDIO, (api_audiostream *)0, filename, parameters);
}
inline api_audiostream *api_decodefile::OpenAudioBackground(const wchar_t *filename, AudioParameters *parameters)
{
return _call(API_DECODEFILE_OPENAUDIO2, (api_audiostream *)0, filename, parameters);
}
inline void api_decodefile::CloseAudio(api_audiostream *audioStream)
{
_voidcall(API_DECODEFILE_CLOSEAUDIO, audioStream);
}
inline bool api_decodefile::DecoderExists(const wchar_t *filename)
{
return _call(API_DECODEFILE_DECODEREXISTS, (bool)true, filename); // we default to true so that an old implementation doesn't break completely
}
// {9B4188F5-4295-48ab-B50C-F2B0BB56D242}
static const GUID decodeFileGUID =
{
0x9b4188f5, 0x4295, 0x48ab, { 0xb5, 0xc, 0xf2, 0xb0, 0xbb, 0x56, 0xd2, 0x42 }
};
#endif

View file

@ -0,0 +1,78 @@
#ifndef NULLSOFT_API_RANDOM_H
#define NULLSOFT_API_RANDOM_H
#include <bfc/dispatch.h>
#include <bfc/platform/types.h>
typedef int (*RandomGenerator)(void);
typedef unsigned long (*UnsignedRandomGenerator)(void);
class api_random : public Dispatchable
{
protected:
api_random() {}
~api_random() {}
public:
RandomGenerator GetFunction();
UnsignedRandomGenerator GetUnsignedFunction();
int GetNumber();
int GetPositiveNumber();
float GetFloat(); // [0-1]
float GetFloat_LessThanOne(); // [0-1)
float GetFloat_LessThanOne_NotZero(); // (0-1)
double GetDouble(); // [0-1)
public:
DISPATCH_CODES
{
API_RANDOM_GETFUNCTION = 10,
API_RANDOM_GETFUNCTION_UNSIGNED = 11,
API_RANDOM_GETNUMBER = 20,
API_RANDOM_GETPOSITIVENUMBER = 30,
API_RANDOM_GETFLOAT = 40,
API_RANDOM_GETFLOAT2 = 41,
API_RANDOM_GETFLOAT3 = 42,
API_RANDOM_GETDOUBLE = 50,
};
};
inline RandomGenerator api_random::GetFunction()
{
return _call(API_RANDOM_GETFUNCTION, (RandomGenerator )0);
}
inline UnsignedRandomGenerator api_random::GetUnsignedFunction()
{
return _call(API_RANDOM_GETFUNCTION_UNSIGNED, (UnsignedRandomGenerator )0);
}
inline int api_random::GetNumber()
{
return _call(API_RANDOM_GETNUMBER, 0);
}
inline int api_random::GetPositiveNumber()
{
return _call(API_RANDOM_GETPOSITIVENUMBER, 0);
}
inline float api_random::GetFloat()
{
return _call(API_RANDOM_GETFLOAT, 0.f);
}
inline float api_random::GetFloat_LessThanOne()
{
return _call(API_RANDOM_GETFLOAT2, 0.f);
}
inline float api_random::GetFloat_LessThanOne_NotZero()
{
return _call(API_RANDOM_GETFLOAT3, 0.f);
}
inline double api_random::GetDouble()
{
return _call(API_RANDOM_GETDOUBLE, 0.);
}
// {CB401CAB-CC10-48f7-ADB7-9D1D24B40E0C}
static const GUID randomApiGUID =
{ 0xcb401cab, 0xcc10, 0x48f7, { 0xad, 0xb7, 0x9d, 0x1d, 0x24, 0xb4, 0xe, 0xc } };
#endif

View file

@ -0,0 +1,34 @@
#ifndef __WASABI_API_WA5COMPONENT_H_
#define __WASABI_API_WA5COMPONENT_H_
#include <bfc/dispatch.h>
class api_service;
#ifdef WIN32
#include <windows.h>
#endif
class NOVTABLE api_wa5component : public Dispatchable
{
public:
DISPATCH_CODES
{
API_WA5COMPONENT_REGISTERSERVICES = 10,
API_WA5COMPONENT_DEREEGISTERSERVICES = 20,
};
void RegisterServices(api_service *service);
void DeregisterServices(api_service *service);
#ifdef WIN32 // this is a kind of a hack (might be better to create a function that winamp calls to pass it)
HMODULE hModule;
#endif
};
inline void api_wa5component::RegisterServices(api_service *service)
{
_voidcall(API_WA5COMPONENT_REGISTERSERVICES, service);
}
inline void api_wa5component::DeregisterServices(api_service *service)
{
_voidcall(API_WA5COMPONENT_DEREEGISTERSERVICES, service);
}
#endif

View file

@ -0,0 +1,56 @@
#ifndef __IPC_PE_H
#define __IPC_PE_H
#define IPC_PE_GETCURINDEX 100 // returns current idx
#define IPC_PE_GETINDEXTOTAL 101 // returns number of items
#define IPC_PE_GETINDEXINFO 102 // (copydata) lpData is of type callbackinfo, callback is called with copydata/fileinfo structure and msg IPC_PE_GETINDEXINFORESULT
#define IPC_PE_GETINDEXINFORESULT 103 // callback message for IPC_PE_GETINDEXINFO
#define IPC_PE_DELETEINDEX 104 // lParam = index
#define IPC_PE_SWAPINDEX 105 // (lParam & 0xFFFF0000) >> 16 = from, (lParam & 0xFFFF) = to
#define IPC_PE_INSERTFILENAME 106 // (copydata) lpData is of type fileinfo
#define IPC_PE_GETDIRTY 107 // returns 1 if the playlist changed since the last IPC_PE_SETCLEAN
#define IPC_PE_SETCLEAN 108 // resets the dirty flag until next modification
#define IPC_PE_GETIDXFROMPOINT 109 // pass a point parm, return a playlist index
#define IPC_PE_SAVEEND 110 // pass index to save from
#define IPC_PE_RESTOREEND 111 // no parm
#define IPC_PE_GETNEXTSELECTED 112 // same as IPC_PLAYLIST_GET_NEXT_SELECTED for the main window
#define IPC_PE_GETSELECTEDCOUNT 113
#define IPC_PE_INSERTFILENAMEW 114 // (copydata) lpData is of type fileinfoW
#define IPC_PE_GETINDEXINFO_TITLE 115 // like IPC_PE_GETINDEXINFO, but writes the title to char file[MAX_PATH] instead of filename
#define IPC_PE_GETINDEXINFORESULT_TITLE 116 // callback message for IPC_PE_GETINDEXINFO
typedef struct {
char file[MAX_PATH];
int index;
} fileinfo;
typedef struct {
wchar_t file[MAX_PATH];
int index;
} fileinfoW;
typedef struct {
HWND callback;
int index;
} callbackinfo;
// the following messages are in_process ONLY
#define IPC_PE_GETINDEXTITLE 200 // lParam = pointer to fileinfo2 struct
#define IPC_PE_GETINDEXTITLEW 201 // lParam = pointer to fileinfo2W struct
#define IPC_PE_GETINDEXINFO_INPROC 202 // lParam = pointer to fileinfo struct
#define IPC_PE_GETINDEXINFOW_INPROC 203 // lParam = pointer to fileinfoW struct
typedef struct {
int fileindex;
char filetitle[256];
char filelength[16];
} fileinfo2;
typedef struct
{
int fileindex;
wchar_t filetitle[256];
wchar_t filelength[16];
} fileinfo2W;
#endif

View file

@ -0,0 +1,436 @@
/*
** Copyright (C) 2003-2008 Nullsoft, Inc.
**
** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
** liable for any damages arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to
** alter it and redistribute it freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
**
** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
**
** 3. This notice may not be removed or altered from any source distribution.
**
*/
#ifndef _WA_DLG_H_
#define _WA_DLG_H_
#include "wa_ipc.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
1) gen.bmp has a generic window frame for plugins to use.
its format is similar to the minibrowser's.
In addition gen.bmp includes a font for the titlebar, in both
highlight and no-highlight modes. The font is variable width,
and it uses the first color before the letter A as the delimiter.
The no-highlight form of letter must be the same width as the
highlight form.
2) genex.bmp has button and scrollbar images, as well as some individual
pixels that describe the colors for the dialog. The button and
scrollbar images should be self explanatory (note that the buttons
have 4 pixel sized edges that are not stretched, and the center is
stretched), and the scrollbars do something similar.
The colors start at (48,0) and run every other pixel. The meaning
of each pixel is:
x=48: item background (background to edits, listviews etc)
x=50: item foreground (text color of edit/listview, etc)
x=52: window background (used to set the bg color for the dialog)
x=54: button text color
x=56: window text color
x=58: color of dividers and sunken borders
x=60: selection color for playlists
x=62: listview header background color
x=64: listview header text color
x=66: listview header frame top color
x=68: listview header frame middle color
x=70: listview header frame bottom color
x=72: listview header empty color
x=74: scrollbar foreground color
x=76: scrollbar background color
x=78: inverse scrollbar foreground color
x=80: inverse scrollbar background color
x=82: scrollbar dead area color
x=84: listview/treeview selection bar text color (active)
x=86: listview/treeview selection bar back color (active)
x=88: listview/treeview selection bar text color (inactive)
x=90: listview/treeview selection bar back color (inactive)
x=92: alternate item background
x=94: alternate item foreground
*/
#define DCW_SUNKENBORDER 0x00010000
#define DCW_DIVIDER 0x00020000
enum
{
WADLG_ITEMBG,
WADLG_ITEMFG,
WADLG_WNDBG,
WADLG_BUTTONFG,
WADLG_WNDFG,
WADLG_HILITE,
WADLG_SELCOLOR,
WADLG_LISTHEADER_BGCOLOR,
WADLG_LISTHEADER_FONTCOLOR,
WADLG_LISTHEADER_FRAME_TOPCOLOR,
WADLG_LISTHEADER_FRAME_MIDDLECOLOR,
WADLG_LISTHEADER_FRAME_BOTTOMCOLOR,
WADLG_LISTHEADER_EMPTY_BGCOLOR,
WADLG_SCROLLBAR_FGCOLOR,
WADLG_SCROLLBAR_BGCOLOR,
WADLG_SCROLLBAR_INV_FGCOLOR,
WADLG_SCROLLBAR_INV_BGCOLOR,
WADLG_SCROLLBAR_DEADAREA_COLOR,
WADLG_SELBAR_FGCOLOR,
WADLG_SELBAR_BGCOLOR,
WADLG_INACT_SELBAR_FGCOLOR,
WADLG_INACT_SELBAR_BGCOLOR,
WADLG_ITEMBG2,
WADLG_ITEMFG2,
WADLG_NUM_COLORS
};
typedef enum _WACURSOR // used in IPC_GETSKINCURSORS
{
WACURSOR_VOLUME = 0, // volume & balane
WACURSOR_POSITION = 1, // position
WACURSOR_BTN_WINSHADE = 2, // winshade
WACURSOR_BTN_MINIMIZE = 3, // minimize
WACURSOR_BTN_CLOSE = 4, // close
WACURSOR_MENU = 5, // main menu
WACURSOR_TITLEBAR = 6, // title bar
WACURSOR_SONGNAME = 7,
WACURSOR_NORMAL = 8,
WACURSOR_WINSHADE_BTN_WINSHADE = 9,
WACURSOR_WINSHADE_BTN_MINIMIZE = 10,
WACURSOR_WINSHADE_POSITION = 11,
WACURSOR_WINSHADE_BTN_CLOSE = 12,
WACURSOR_WINSHADE_MENU = 13,
WACURSOR_WINSHADE_NORMAL = 14,
WACURSOR_PL_BTN_WINSHADE = 15,
WACURSOR_PL_BTN_CLOSE = 16,
WACURSOR_PL_TITLEBAR = 17,
WACURSOR_PL_VSCROLL = 18,
WACURSOR_PL_RESIZE = 19,
WACURSOR_PL_NORMAL = 20,
WACURSOR_PL_WINSHADE_BTN_WINSHADE = 21,
WACURSOR_PL_WINSHADE_BTN_CLOSE = 22,
WACURSOR_PL_WINSHADE_HSIZE = 23,
WACURSOR_PL_WINSHADE_NORMAL = 24,
WACURSOR_EQ_SLIDER = 25,
WACURSOR_EQ_BTN_CLOSE = 26,
WACURSOR_EQ_TITLEBAR = 27,
WACURSOR_EQ_NORMAL = 28,
} WACURSOR;
void WADlg_init(HWND hwndWinamp); // call this on init, or on WM_DISPLAYCHANGE
void WADlg_close();
int WADlg_getColor(int idx);
int WADlg_initted();
LRESULT WADlg_handleDialogMsgs(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); //
void WADlg_DrawChildWindowBorders(HWND hwndDlg, int *tab, int tabsize); // each entry in tab would be the id | DCW_*
HBITMAP WADlg_getBitmap();
/// define WA_DLG_IMPLEMENT in one of your source files before including this .h
// if you are making a media library plugin, you dont need to do this, look at view_ex for
// an example of how to get the function *'s via an IPC message.
#ifdef __cplusplus
}
#endif
#ifdef WA_DLG_IMPLEMENT
static HBRUSH wadlg_lastbrush=0;
static HBITMAP wadlg_bitmap=0; // load this manually
static int wadlg_colors[WADLG_NUM_COLORS];
static int wadlg_defcolors[WADLG_NUM_COLORS]=
{
RGB(0,0,0),
RGB(0,255,0),
RGB(36,36,60),
RGB(57,56,66),
RGB(255,255,255),
RGB(132,148,165),
RGB(0,0,198),
RGB(36*2,36*2,60*2),
RGB(255,255,255),
RGB(36*3,36*3,60*3),
RGB(36,36,60),
RGB(36*0.5,36*0.5,60*0.5),
RGB(36,36,60),
RGB(36*1,36*1,60*1),
RGB(36*1,36*1,60*1),
RGB(121,130,150),
RGB(78,88,110),
RGB(36*1,36*1,60*1),
RGB(255,255,255),
RGB(0,0,180),
RGB(0,255,0),
RGB(0,0,128),
RGB(0,0,0),
RGB(0,255,0),
};
int WADlg_initted()
{
return !!wadlg_bitmap;
}
int WADlg_getColor(int idx)
{
if (idx < 0 || idx >= WADLG_NUM_COLORS) return 0;
return wadlg_colors[idx];
}
HBITMAP WADlg_getBitmap()
{
return wadlg_bitmap;
}
void WADlg_init(HWND hwndWinamp) // call this on init, or on WM_DISPLAYCHANGE
{
if (wadlg_bitmap) DeleteObject(wadlg_bitmap);
wadlg_bitmap = (HBITMAP) SendMessage(hwndWinamp,WM_WA_IPC,0,IPC_GET_GENSKINBITMAP);
if (wadlg_bitmap)
{
HDC tmpDC=CreateCompatibleDC(NULL);
HGDIOBJ o=SelectObject(tmpDC,(HGDIOBJ)wadlg_bitmap);
int defbgcol=GetPixel(tmpDC,111,0);
for (int x = 0; x < WADLG_NUM_COLORS; x ++)
{
int a=GetPixel(tmpDC,48+x*2,0);
if (a == CLR_INVALID || a == RGB(0,198,255) || a == defbgcol)
{
//defaults for old skins
if (x == WADLG_SELBAR_FGCOLOR || x == WADLG_INACT_SELBAR_FGCOLOR) a=wadlg_colors[WADLG_WNDFG];
else if (x == WADLG_SELBAR_BGCOLOR || x == WADLG_INACT_SELBAR_BGCOLOR)
{
a=wadlg_colors[WADLG_SELCOLOR];
if (x == WADLG_INACT_SELBAR_BGCOLOR)
a=((a/2)&0x7F7F7F)+(((wadlg_colors[WADLG_WNDBG])/2)&0x7F7F7F);
}
else if (x == WADLG_ITEMBG2)
{
a=wadlg_colors[WADLG_ITEMBG];
}
else if (x == WADLG_ITEMFG2)
{
a=wadlg_colors[WADLG_ITEMFG];
}
else a=wadlg_defcolors[x];
}
wadlg_colors[x]=a;
}
SelectObject(tmpDC,o);
DeleteDC(tmpDC);
}
}
void WADlg_close()
{
if (wadlg_bitmap) DeleteObject(wadlg_bitmap);
wadlg_bitmap=0;
if (wadlg_lastbrush) DeleteObject(wadlg_lastbrush);
wadlg_lastbrush=0;
}
void WADlg_dotLine(HDC hdc, int left, int top, int len, int vert)
{
for(int i=(top&1);i<len-1;i+=2)
{
if(vert)
{
MoveToEx(hdc,left,top+i,NULL);
LineTo(hdc,left,top+i+1);
}
else
{
MoveToEx(hdc,left+i,top,NULL);
LineTo(hdc,left+i+1,top);
}
}
}
LRESULT WADlg_handleDialogMsgs(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_DRAWITEM)
{
DRAWITEMSTRUCT *di = (DRAWITEMSTRUCT *)lParam;
if (di->CtlType == ODT_BUTTON) {
wchar_t wt[256];
RECT r;
GetDlgItemTextW(hwndDlg,(INT)wParam,wt,sizeof(wt)/sizeof(*wt));
HDC hdc = CreateCompatibleDC(di->hDC);
HBITMAP hbmpOld = (HBITMAP)SelectObject(hdc, wadlg_bitmap);
r=di->rcItem;
SetStretchBltMode(di->hDC,COLORONCOLOR);
int yoffs = (di->itemState & ODS_SELECTED) ? 15 : 0;
BitBlt(di->hDC,r.left,r.top,4,4,hdc,0,yoffs,SRCCOPY); // top left
StretchBlt(di->hDC,r.left+4,r.top,r.right-r.left-4-4,4,hdc,4,yoffs,47-4-4,4,SRCCOPY); // top center
BitBlt(di->hDC,r.right-4,r.top,4,4,hdc,47-4,yoffs,SRCCOPY); // top right
StretchBlt(di->hDC,r.left,r.top+4,4,r.bottom-r.top-4-4,hdc,0,4+yoffs,4,15-4-4,SRCCOPY); // left edge
StretchBlt(di->hDC,r.right-4,r.top+4,4,r.bottom-r.top-4-4,hdc,47-4,4+yoffs,4,15-4-4,SRCCOPY); // right edge
// center
StretchBlt(di->hDC,r.left+4,r.top+4,r.right-r.left-4-4,r.bottom-r.top-4-4,hdc,4,4+yoffs,47-4-4,15-4-4,SRCCOPY);
BitBlt(di->hDC,r.left,r.bottom-4,4,4,hdc,0,15-4+yoffs,SRCCOPY); // bottom left
StretchBlt(di->hDC,r.left+4,r.bottom-4,r.right-r.left-4-4,4,hdc,4,15-4+yoffs,47-4-4,4,SRCCOPY); // bottom center
BitBlt(di->hDC,r.right-4,r.bottom-4,4,4,hdc,47-4,15-4+yoffs,SRCCOPY); // bottom right
// draw text
SetBkMode(di->hDC,TRANSPARENT);
// this will do a different style for the button text depending on enabled state of the button
COLORREF colour = wadlg_colors[WADLG_BUTTONFG];
if(!IsWindowEnabled(di->hwndItem)){
COLORREF fg = wadlg_colors[WADLG_WNDFG],
bg = wadlg_colors[WADLG_WNDBG];
colour = RGB((GetRValue(fg)+GetRValue(bg))/2,
(GetGValue(fg)+GetGValue(bg))/2,
(GetBValue(fg)+GetBValue(bg))/2);
}
SetTextColor(di->hDC,colour);
if (di->itemState & ODS_SELECTED) {r.left+=2; r.top+=2;}
DrawTextW(di->hDC,wt,-1,&r,DT_VCENTER|DT_SINGLELINE|DT_CENTER);
SelectObject(hdc, hbmpOld);
DeleteDC(hdc);
if(GetFocus()==di->hwndItem) {
HPEN hpen, hpenOld;
hpen =CreatePen(PS_SOLID,0,RGB(0,0,0));
hpenOld = (HPEN)SelectObject(di->hDC, hpen);
WADlg_dotLine(di->hDC,r.left+2,r.top+2,r.right-r.left-3,0);
WADlg_dotLine(di->hDC,r.right-3,r.top+2,r.bottom-r.top-3,1);
WADlg_dotLine(di->hDC,r.left+2,r.top+2,r.bottom-r.top-3,1);
WADlg_dotLine(di->hDC,r.left+2,r.bottom-3,r.right-r.left-3,0);
SelectObject(di->hDC, hpenOld);
DeleteObject(hpen);
}
}
}
switch(uMsg)
{
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORDLG:
case WM_CTLCOLORBTN:
case WM_CTLCOLORSTATIC:
case WM_CTLCOLOREDIT:
{
int bgcolor=(uMsg == WM_CTLCOLOREDIT || uMsg == WM_CTLCOLORLISTBOX) ? wadlg_colors[WADLG_ITEMBG] : (uMsg == WM_CTLCOLORBTN ? wadlg_colors[WADLG_ITEMBG] : wadlg_colors[WADLG_WNDBG]);
LOGBRUSH lb={BS_SOLID,GetNearestColor((HDC)wParam,bgcolor)};
if (wadlg_lastbrush) DeleteObject(wadlg_lastbrush);
wadlg_lastbrush=CreateBrushIndirect(&lb);
SetTextColor((HDC)wParam,uMsg == WM_CTLCOLORSTATIC ? wadlg_colors[WADLG_WNDFG] : wadlg_colors[WADLG_ITEMFG]);
SetBkColor((HDC)wParam,lb.lbColor);
return (LRESULT)wadlg_lastbrush;
}
}
return 0;
}
static int RectInRect(RECT *rect1, RECT *rect2)
{
// this has a bias towards true
// this could probably be optimized a lot
return ((rect1->top >= rect2->top && rect1->top <= rect2->bottom) ||
(rect1->bottom >= rect2->top && rect1->bottom <= rect2->bottom) ||
(rect2->top >= rect1->top && rect2->top <= rect1->bottom) ||
(rect2->bottom >= rect1->top && rect2->bottom <= rect1->bottom)) // vertical intersect
&&
((rect1->left >= rect2->left && rect1->left <= rect2->right) ||
(rect1->right >= rect2->left && rect1->right <= rect2->right) ||
(rect2->left >= rect1->left && rect2->left <= rect1->right) ||
(rect2->right >= rect1->left && rect2->right <= rect1->right)) // horiz intersect
;
}
static void WADlg_removeFromRgn(HRGN hrgn, int left, int top, int right, int bottom)
{
HRGN rgn2=CreateRectRgn(left,top,right,bottom);
CombineRgn(hrgn,hrgn,rgn2,RGN_DIFF);
DeleteObject(rgn2);
}
void WADlg_DrawChildWindowBorders(HWND hwndDlg, int *tab, int tabsize)
{
PAINTSTRUCT ps;
BeginPaint(hwndDlg,&ps);
HRGN hrgn = (ps.fErase) ? CreateRectRgnIndirect(&ps.rcPaint) : NULL;
HPEN pen = CreatePen(PS_SOLID, 0, wadlg_colors[WADLG_HILITE]);
HGDIOBJ o = SelectObject(ps.hdc, pen);
while (tabsize--)
{
RECT r;
int a = *tab++;
GetWindowRect(GetDlgItem(hwndDlg, a & 0xffff),&r);
MapWindowPoints(HWND_DESKTOP, hwndDlg, (LPPOINT)&r, 2);
if (RectInRect(&ps.rcPaint,&r))
{
if ((a & 0xffff0000) == DCW_SUNKENBORDER)
{
MoveToEx(ps.hdc,r.left,r.bottom,NULL);
LineTo(ps.hdc,r.right,r.bottom);
LineTo(ps.hdc,r.right,r.top-1);
if(hrgn)
{
WADlg_removeFromRgn(hrgn,r.left,r.bottom,r.right,r.bottom+1);
WADlg_removeFromRgn(hrgn,r.right,r.top,r.right+1,r.bottom);
}
}
else if ((a & 0xffff0000) == DCW_DIVIDER)
{
if (r.right - r.left < r.bottom - r.top) // vertical
{
int left=(r.left+r.right)/2;
MoveToEx(ps.hdc,left,r.top,NULL);
LineTo(ps.hdc,left,r.bottom+1);
if(hrgn) WADlg_removeFromRgn(hrgn,left,r.top,left+1,r.bottom);
}
else // horiz
{
int top=(r.top+r.bottom)/2;
MoveToEx(ps.hdc,r.left,top,NULL);
LineTo(ps.hdc,r.right+1,top);
if(hrgn) WADlg_removeFromRgn(hrgn,r.left,top,r.right,top+1);
}
}
}
}
SelectObject(ps.hdc, o);
DeleteObject(pen);
if(hrgn)
{
//erase bkgnd while clipping out our own drawn stuff (for flickerless display)
HBRUSH b = CreateSolidBrush(wadlg_colors[WADLG_WNDBG]);
FillRgn(ps.hdc,hrgn,b);
DeleteObject(b);
DeleteObject(hrgn);
}
EndPaint(hwndDlg,&ps);
}
#endif
#endif//_WA_DLG_H_

View file

@ -0,0 +1,39 @@
#ifndef WA_HOTKEYS
#define WA_HOTKEYS
//#define IPC_GEN_HOTKEYS_ADD xxxx //pass a genHotkeysAddStruct * struct in data
//
//To get the IPC_GEN_HOTKEYS_ADD IPC number, do this:
//
// genhotkeys_add_ipc=SendMessage(winampWindow,WM_WA_IPC,(WPARAM)&"GenHotkeysAdd",IPC_REGISTER_WINAMP_IPCMESSAGE);
//
//Then you can use:
//
// PostMessage(winampWindow,WM_WA_IPC,(WPARAM)&myGenHotkeysAddStruct,genhotkeys_add_ipc);
//
//flags for the genHotkeysAddStruct struct
#define HKF_BRING_TO_FRONT 0x1 // calls SetForegroundWindow before sending the message
#define HKF_HWND_WPARAM 0x2 // sets wParam with Winamp's window handle
#define HKF_COPY 0x4 // copies returned text to the clipboard
#define HKF_PLPOS_WPARAM 0x8 // sets wParam with current pledit position
#define HKF_ISPLAYING_WL 0x10 // sets wParam to genHotkeysAddStruct's wParam if playing, lParam if not
// uses IPC_ISPLAYING to check if playing
#define HKF_SHOWHIDE 0x20 // brings Winamp to front or minimizes Winamp if already at front
#define HKF_NOSENDMSG 0x40 // don't send any message to the winamp window
#define HKF_DISABLED 0x80000000
typedef struct {
char *name; //name that will appear in the Global Hotkeys preferences panel
DWORD flags; //one or more flags from above
UINT uMsg; //message that will be sent to winamp's main window (must always be !=NULL)
WPARAM wParam; //wParam that will be sent to winamp's main window
LPARAM lParam; //lParam that will be sent to winamp's main window
char *id; //unique string to identify this command - case insensitive
HWND wnd; //set the HWND to send message (or 0 for main winamp window)
int extended[6]; //for future extension - always set to zero!
} genHotkeysAddStruct;
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,78 @@
#ifndef __API_MEMMGR_H
#define __API_MEMMGR_H
#include "../../bfc/dispatch.h"
#include "../../bfc/platform/types.h"
class NOVTABLE api_memmgr : public Dispatchable
{
protected:
api_memmgr() {}
~api_memmgr() {}
public:
void *sysMalloc(size_t size);
void sysFree(void *ptr);
void *sysRealloc(void *ptr, size_t newsize);
void sysMemChanged(void *ptr);
DISPATCH_CODES
{
API_MEMMGR_SYSMALLOC = 0,
API_MEMMGR_SYSFREE = 10,
API_MEMMGR_SYSREALLOC = 20,
API_MEMMGR_SYSMEMCHANGED = 30,
};
// Some helper templates to new and delete objects with the memory manager
// you need to be cautious with Delete() and inheritance, particularly if you're dealing with a base class
// as the pointer to the derived class might not equal to the pointer to the base class, particularly with multiple inheritance
// e.g. class C : public A, public B {}; C c; assert((A*)&c == (B*)&c); will likely fail
template <class Class>
void New(Class **obj)
{
size_t toAlloc = sizeof(Class);
void *mem = sysMalloc(toAlloc);
*obj = new (mem) Class;
}
template <class Class>
void Delete(Class *obj)
{
if (obj)
{
obj->~Class();
sysFree(obj);
}
}
};
inline void *api_memmgr::sysMalloc(size_t size)
{
return _call(API_MEMMGR_SYSMALLOC, (void *)NULL, size);
}
inline void api_memmgr::sysFree(void *ptr)
{
_voidcall(API_MEMMGR_SYSFREE, ptr);
}
inline void *api_memmgr::sysRealloc(void *ptr, size_t newsize)
{
return _call(API_MEMMGR_SYSREALLOC, (void *)NULL, ptr, newsize);
}
inline void api_memmgr::sysMemChanged(void *ptr)
{
_voidcall(API_MEMMGR_SYSMEMCHANGED, ptr);
}
// {000CF46E-4DF6-4a43-BBE7-40E7A3EA02ED}
static const GUID memMgrApiServiceGuid =
{ 0xcf46e, 0x4df6, 0x4a43, { 0xbb, 0xe7, 0x40, 0xe7, 0xa3, 0xea, 0x2, 0xed } };
//extern api_memmgr *memmgrApi;
#endif

View file

@ -0,0 +1,155 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:56:11 2003]
//
// File : api_service.h
// Class : api_service
// class layer : Dispatchable Interface
// ----------------------------------------------------------------------------
#ifndef __API_SERVICE_H
#define __API_SERVICE_H
#include "../../bfc/dispatch.h"
#include "../../bfc/platform/types.h"
namespace SvcNotify {
enum {
ONREGISTERED=100, // init yourself here -- not all other services are registered yet
ONSTARTUP=200, // everyone is initialized, safe to talk to other services
ONAPPRUNNING=210, // app is showing and processing events
ONSHUTDOWN=300, // studio is shutting down, release resources from other services
ONDEREGISTERED=400, // bye bye
ONDBREADCOMPLETE=500,// after db is read in (happens asynchronously after ONSTARTUP)
ONBEFORESHUTDOWN=600, // system is about to shutdown, call WASABI_API_APP->main_cancelShutdown() to cancel
};
}
class waServiceFactory;
// ----------------------------------------------------------------------------
class NOVTABLE api_service: public Dispatchable {
protected:
api_service() {}
~api_service() {}
public:
int service_register(waServiceFactory *svc);
int service_deregister(waServiceFactory *svc);
size_t service_getNumServices(FOURCC svc_type);
waServiceFactory *service_enumService(FOURCC svc_type, size_t n);
waServiceFactory *service_getServiceByGuid(GUID guid);
int service_lock(waServiceFactory *owner, void *svcptr);
int service_clientLock(void *svcptr);
int service_release(void *svcptr);
const char *service_getTypeName(FOURCC svc_type);
#ifdef WASABI_COMPILE_COMPONENTS
GUID service_getOwningComponent(void *svcptr);
GUID service_getLockingComponent(void *svcptr);
#endif // WASABI_COMPILE_COMPONENTS
int service_unlock(void *svcptr);
int service_isvalid(FOURCC svctype, waServiceFactory *service);
// removes "me" from the services list and finds a second service with the same GUID and puts it in the same position
// this is used by the lazy loader service factory - you shouldn't need it for any other purposes.
// returns 0 if compaction actually happened
int service_compactDuplicates(waServiceFactory *me);
protected:
enum {
API_SERVICE_SERVICE_REGISTER = 10,
API_SERVICE_SERVICE_DEREGISTER = 20,
API_SERVICE_SERVICE_GETNUMSERVICES = 30,
API_SERVICE_SERVICE_ENUMSERVICE = 40,
API_SERVICE_SERVICE_GETSERVICEBYGUID = 50,
API_SERVICE_SERVICE_LOCK = 60,
API_SERVICE_SERVICE_CLIENTLOCK = 70,
API_SERVICE_SERVICE_RELEASE = 80,
API_SERVICE_SERVICE_GETTYPENAME = 90,
#ifdef WASABI_COMPILE_COMPONENTS
API_SERVICE_SERVICE_GETOWNINGCOMPONENT = 100,
API_SERVICE_SERVICE_GETLOCKINGCOMPONENT = 110,
#endif // WASABI_COMPILE_COMPONENTS
API_SERVICE_SERVICE_UNLOCK = 120,
API_SERVICE_ISVALID = 130,
API_SERVICE_COMPACT_DUPLICATES = 140,
};
};
// ----------------------------------------------------------------------------
inline int api_service::service_register(waServiceFactory *svc) {
int __retval = _call(API_SERVICE_SERVICE_REGISTER, (int)0, svc);
return __retval;
}
inline int api_service::service_deregister(waServiceFactory *svc) {
int __retval = _call(API_SERVICE_SERVICE_DEREGISTER, (int)0, svc);
return __retval;
}
inline size_t api_service::service_getNumServices(FOURCC svc_type) {
int __retval = _call(API_SERVICE_SERVICE_GETNUMSERVICES, (int)0, svc_type);
return __retval;
}
inline waServiceFactory *api_service::service_enumService(FOURCC svc_type, size_t n) {
waServiceFactory *__retval = _call(API_SERVICE_SERVICE_ENUMSERVICE, (waServiceFactory *)0, svc_type, n);
return __retval;
}
inline waServiceFactory *api_service::service_getServiceByGuid(GUID guid) {
waServiceFactory *__retval = _call(API_SERVICE_SERVICE_GETSERVICEBYGUID, (waServiceFactory *)0, guid);
return __retval;
}
inline int api_service::service_lock(waServiceFactory *owner, void *svcptr) {
int __retval = _call(API_SERVICE_SERVICE_LOCK, (int)0, owner, svcptr);
return __retval;
}
inline int api_service::service_clientLock(void *svcptr) {
int __retval = _call(API_SERVICE_SERVICE_CLIENTLOCK, (int)0, svcptr);
return __retval;
}
inline int api_service::service_release(void *svcptr) {
int __retval = _call(API_SERVICE_SERVICE_RELEASE, (int)0, svcptr);
return __retval;
}
inline const char *api_service::service_getTypeName(FOURCC svc_type) {
const char *__retval = _call(API_SERVICE_SERVICE_GETTYPENAME, (const char *)0, svc_type);
return __retval;
}
#ifdef WASABI_COMPILE_COMPONENTS
inline GUID api_service::service_getOwningComponent(void *svcptr) {
GUID __retval = _call(API_SERVICE_SERVICE_GETOWNINGCOMPONENT, INVALID_GUID, svcptr);
return __retval;
}
inline GUID api_service::service_getLockingComponent(void *svcptr) {
GUID __retval = _call(API_SERVICE_SERVICE_GETLOCKINGCOMPONENT, INVALID_GUID, svcptr);
return __retval;
}
#endif // WASABI_COMPILE_COMPONENTS
inline int api_service::service_unlock(void *svcptr) {
int __retval = _call(API_SERVICE_SERVICE_UNLOCK, (int)0, svcptr);
return __retval;
}
inline int api_service::service_isvalid(FOURCC svctype, waServiceFactory *service) {
int __retval = _call(API_SERVICE_ISVALID, (int)0, svctype, service);
return __retval;
}
inline int api_service::service_compactDuplicates(waServiceFactory *me)
{
return _call(API_SERVICE_COMPACT_DUPLICATES, (int)1, me);
}
// ----------------------------------------------------------------------------
extern api_service *serviceApi;
#endif // __API_SERVICE_H

View file

@ -0,0 +1,68 @@
#ifndef _SERVICES_H
#define _SERVICES_H
#include <bfc/std_mkncc.h> // for MKnCC()
// lower-case service names are reserved by Nullsoft for future use
// upper-case service names are for 3rd parties to extend the service system
// if you have a service that is unique to a component, make it type
// UNIQUE and register it by GUID
namespace WaSvc {
enum {
NONE=MK4CC('n','o','n','e'),
UNIQUE=MK4CC('u','n','i','q'), // for unique services, enumed by GUID
OBJECT=MK4CC('o','b','j','f'), // for unique objects, enumed by GUID
CONTEXTCMD=MK4CC('c','c','m','d'), // context menu command svc_contextCmd.h
DEVICE=MK3CC('d','e','v'), // portable device svc_device.h
FILEREADER=MK4CC('f','s','r','d'), // file system reader (disk, zip, http)
FILESELECTOR=MK4CC('f','s','e','l'), // file selector svc_filesel.h
STORAGEVOLENUM=MK4CC('f','s','e','n'), // storage volume enumerator.
IMAGEGENERATOR=MK4CC('i','m','g','n'), // image generator svc_imggen.h
IMAGELOADER=MK4CC('i','m','g','l'), // image loader svc_imgload.h
IMAGEWRITER=MK4CC('i','m','g','w'), // image writer
ITEMMANAGER=MK4CC('i','m','g','r'), // item manager svc_itemmgr.h
PLAYLISTREADER=MK4CC('p','l','r','d'), // playlist reader - DEPRECATED - only for wa3
PLAYLISTWRITER=MK4CC('p','l','w','r'), // playlist writer - DEPRECATED - only for wa3
MEDIACONVERTER=MK4CC('c','o','n','v'), // media converter
MEDIACORE=MK4CC('c','o','r','e'), // media core
MEDIARECORDER=MK4CC('m','r','e','c'), // media recorder
SCRIPTOBJECT=MK4CC('m','a','k','i'), // third party script object
// TRANSLATOR=MK4CC('x','l','a','t'), // text translator
WINDOWCREATE=MK4CC('w','n','d','c'), // window creator
XMLPROVIDER=MK4CC('x','m','l','p'), // xml provider
DB=MK2CC('d','b'), // database
SKINFILTER=MK4CC('f','l','t','r'), // bitmap/colorref skin filter
METADATA=MK4CC('m','t','d','t'), // play item meta data
METATAG=MK4CC('m','t','t','g'), // metadata tagging of play items
EVALUATOR=MK4CC('e','v','a','l'), // evaluate a string
MINIBROWSER=MK2CC('m','b'), // minibrowser
TOOLTIPSRENDERER=MK4CC('t','t','i','p'), // tooltips renderer
XUIOBJECT=MK4CC('x','u','i','o'), // xml gui objects
STRINGCONVERTER=MK4CC('u','t','f','8'), // unicode string conversion
ACTION=MK3CC('a','c','t'), // custom actions (ie: for buttons)
COREADMIN=MK4CC('c','a','d','m'), // core administrator
DROPTARGET=MK4CC('d','r','o','p'), // drop targets
OBJECTDIR=MK4CC('o','b','j','d'), // object directory
TEXTFEED=MK4CC('t','x','t','f'), // text feed, to send text to various XUI objects (ie: <Text> by using display="textfeedid"
ACCESSIBILITY=MK4CC('a','c','c','s'), // accessibility service
ACCESSIBILITYROLESERVER=MK4CC('r','o','l','e'), // accessibility roleServer services
EXPORTER=MK3CC('e','x','p'), // exporter
COLLECTION=MK4CC('c','l','c','t'), // named xml overridable collection
REDIRECT=MK4CC('r','e','d','r'), // filename redirect
FONTRENDER=MK4CC('f','o','n','t'), // font renderer (bitmap/truetype/freetype)
SRCCLASSFACTORY=MK4CC('c','l','f','a'), // source code class factory
SRCEDITOR=MK4CC('s','e','d','t'), // source code editor
MP4AUDIODECODER=MK4CC('m','4','a','d'), // mp4 audio decoder
PLAYLISTREADER_WA5=MK4CC('p','l','r','5'), // playlist reader
PLAYLISTWRITER_WA5=MK4CC('p','l','w','5'), // playlist writer
PLAYLISTHANDLER=MK3CC('p','l','h'), // playlist handler
TAGPROVIDER=MK4CC('t','a','g','z'), // tag provider (for ATF engine)
NSVFACTORY=MK4CC('n','s','v','f'), // NSV factory (to create NSV objects)
JSAPI2_APICREATOR=MK4CC('j','s','a','c'), // API Creator for the Javascript API
};
};
#endif

View file

@ -0,0 +1,97 @@
// ----------------------------------------------------------------------------
// Generated by InterfaceFactory [Wed May 07 00:57:16 2003]
//
// File : waservicefactory.h
// Class : waServiceFactory
// class layer : Dispatchable Interface
// ----------------------------------------------------------------------------
#ifndef __WASERVICEFACTORY_H
#define __WASERVICEFACTORY_H
#include "../../bfc/dispatch.h"
#include "../../bfc/nsguid.h"
#include "api_service.h"
// ----------------------------------------------------------------------------
class NOVTABLE waServiceFactory: public Dispatchable {
protected:
waServiceFactory() throw() {}
~waServiceFactory() throw() {}
protected:
public:
FOURCC getServiceType();
const char *getServiceName();
GUID getGuid();
void *getInterface(int global_lock = TRUE);
int supportNonLockingGetInterface();
int releaseInterface(void *ifc);
const wchar_t *getTestString();
int serviceNotify(int msg, intptr_t param1 = 0, intptr_t param2 = 0);
protected:
enum {
WASERVICEFACTORY_GETSERVICETYPE = 100,
WASERVICEFACTORY_GETSERVICENAME = 200,
WASERVICEFACTORY_GETGUID = 210,
WASERVICEFACTORY_GETINTERFACE = 300,
WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE = 301,
WASERVICEFACTORY_RELEASEINTERFACE = 310,
WASERVICEFACTORY_GETTESTSTRING = 500,
WASERVICEFACTORY_SERVICENOTIFY = 600,
};
};
// ----------------------------------------------------------------------------
inline FOURCC waServiceFactory::getServiceType() {
FOURCC __retval = _call(WASERVICEFACTORY_GETSERVICETYPE, (FOURCC)NULL);
return __retval;
}
inline const char *waServiceFactory::getServiceName() {
const char *__retval = _call(WASERVICEFACTORY_GETSERVICENAME, (const char *)0);
return __retval;
}
inline GUID waServiceFactory::getGuid() {
GUID __retval = _call(WASERVICEFACTORY_GETGUID, INVALID_GUID);
return __retval;
}
inline void *waServiceFactory::getInterface(int global_lock) {
void *__retval = _call(WASERVICEFACTORY_GETINTERFACE, (void *)NULL, global_lock);
#if 0 // unused in Winamp 5
// -- generated code - edit in waservicefactoryi.h
// support old code that always locks even when global_lock==FALSE
if (!global_lock && __retval != NULL && !supportNonLockingGetInterface())
WASABI_API_SVC->service_unlock(__retval);
#endif
return __retval;
}
inline int waServiceFactory::supportNonLockingGetInterface() {
int __retval = _call(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, (int)0);
return __retval;
}
inline int waServiceFactory::releaseInterface(void *ifc) {
int __retval = _call(WASERVICEFACTORY_RELEASEINTERFACE, (int)0, ifc);
return __retval;
}
inline const wchar_t *waServiceFactory::getTestString() {
return _call(WASERVICEFACTORY_GETTESTSTRING, (const wchar_t *)0);
}
inline int waServiceFactory::serviceNotify(int msg, intptr_t param1, intptr_t param2) {
int __retval = _call(WASERVICEFACTORY_SERVICENOTIFY, (int)0, msg, param1, param2);
return __retval;
}
// ----------------------------------------------------------------------------
#endif // __WASERVICEFACTORY_H

View file

@ -0,0 +1,559 @@
#pragma once
//#include <bfc/platform/platform.h>
#include "platform/types.h"
#include "platform/guid.h"
#ifdef WIN32
#ifndef NOVTABLE
#define NOVTABLE __declspec(novtable)
#endif
#else
#define NOVTABLE
#endif
class DispatchableCallback;
#pragma warning(disable: 4786)
#pragma warning(disable: 4275)
#pragma warning(disable: 4100)
enum
{
DISPATCH_SUCCESS=0,
DISPATCH_FAILURE=1,
};
// TODO: define this to stdcall for linux, win64, mac
#define WASABICALL
class NOVTABLE Dispatchable {
public:
// // fake virtual destructor
// void destruct() { _voidcall(DESTRUCT); }
// this is virtual so it is visible across modules
virtual int WASABICALL _dispatch(int msg, void *retval, void **params=0, int nparam=0)=0;
/* added 22 May 2007. these aren't used yet. To be used in the future
in the meantime, don't use negative numbers for your msg values */
size_t AddRef();
size_t Release();
int QueryInterface(GUID interface_guid, void **object);
enum
{
ADDREF=-1,
RELEASE=-2,
QUERYINTERFACE=-3,
};
protected:
// // protected real destructor
// ~Dispatchable() {}
// helper templates to implement client-side methods
int _voidcall(int msg) {
return _dispatch(msg, 0);
}
template<class PARAM1>
int _voidcall(int msg, PARAM1 param1) {
void *params[1] = { &param1 };
return _dispatch(msg, 0, params, 1);
}
template<class PARAM1, class PARAM2>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2) {
void *params[2] = { &param1, &param2 };
return _dispatch(msg, 0, params, 2);
}
template<class PARAM1, class PARAM2, class PARAM3>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3) {
void *params[3] = { &param1, &param2, &param3 };
return _dispatch(msg, 0, params, 3);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4) {
void *params[4] = { &param1, &param2, &param3, &param4 };
return _dispatch(msg, 0, params, 4);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5) {
// void *params[4] = { &param1, &param2, &param3, &param4, &param5 }; // mig found another bug
void *params[5] = { &param1, &param2, &param3, &param4, &param5 };
return _dispatch(msg, 0, params, 5);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6) {
// void *params[4] = { &param1, &param2, &param3, &param4, &param5, &param6 }; // mig found another bug
void *params[6] = { &param1, &param2, &param3, &param4, &param5, &param6 };
return _dispatch(msg, 0, params, 6);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7) {
void *params[7] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 };
return _dispatch(msg, 0, params, 7);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8) {
void *params[8] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 };
return _dispatch(msg, 0, params, 8);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9) {
void *params[9] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 , &param9 };
return _dispatch(msg, 0, params, 9);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9, PARAM10 param10) {
void *params[10] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 , &param9 , &param10 };
return _dispatch(msg, 0, params, 10);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9, PARAM10 param10, PARAM11 param11, PARAM12 param12, PARAM13 param13, PARAM14 param14) {
void *params[14] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 , &param9 , &param10 , &param11 , &param12 , &param13 , &param14 };
return _dispatch(msg, 0, params, 14);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14, class PARAM15, class PARAM16>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9, PARAM10 param10, PARAM11 param11, PARAM12 param12, PARAM13 param13, PARAM14 param14, PARAM15 param15, PARAM16 param16) {
void *params[16] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 , &param9 , &param10 , &param11 , &param12 , &param13 , &param14 , &param15 , &param16 };
return _dispatch(msg, 0, params, 16);
}
template<class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14, class PARAM15, class PARAM16, class PARAM17>
int _voidcall(int msg, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9, PARAM10 param10, PARAM11 param11, PARAM12 param12, PARAM13 param13, PARAM14 param14, PARAM15 param15, PARAM16 param16, PARAM17 param17) {
void *params[17] = { &param1, &param2, &param3, &param4, &param5, &param6 , &param7 , &param8 , &param9 , &param10 , &param11 , &param12 , &param13 , &param14 , &param15 , &param16 , &param17 };
return _dispatch(msg, 0, params, 17);
}
template<class RETURN_TYPE>
RETURN_TYPE _call(int msg, RETURN_TYPE defval) {
RETURN_TYPE retval;
if (_dispatch(msg, &retval)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1) {
void *params[1] = { &param1 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 1)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2) {
void *params[2] = { &param1, &param2 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 2)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3) {
void *params[3] = { &param1, &param2, &param3 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 3)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4) {
void *params[4] = { &param1, &param2, &param3, &param4 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 4)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5) {
void *params[5] = { &param1, &param2, &param3, &param4, &param5 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 5)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6) {
void *params[6] = { &param1, &param2, &param3, &param4, &param5, &param6 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 6)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7) {
void *params[7] = { &param1, &param2, &param3, &param4, &param5, &param6, &param7 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 7)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8) {
void *params[8] = { &param1, &param2, &param3, &param4, &param5, &param6, &param7, &param8 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 8)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9) {
void *params[9] = { &param1, &param2, &param3, &param4, &param5, &param6, &param7, &param8, &param9 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 9)) return retval;
return defval;
}
template<class RETURN_TYPE, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10>
RETURN_TYPE _call(int msg, RETURN_TYPE defval, PARAM1 param1, PARAM2 param2, PARAM3 param3, PARAM4 param4, PARAM5 param5, PARAM6 param6, PARAM7 param7, PARAM8 param8, PARAM9 param9, PARAM10 param10) {
void *params[10] = { &param1, &param2, &param3, &param4, &param5, &param6, &param7, &param8, &param9, &param10 };
RETURN_TYPE retval;
if (_dispatch(msg, &retval, params, 10)) return retval;
return defval;
}
template <class CLASSNAME, class RETVAL>
void cb(RETVAL (CLASSNAME::*fn)(), void *retval, void **params) {
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)();
}
template <class CLASSNAME>
void vcb(void (CLASSNAME::*fn)(), void *retval, void **params) {
(static_cast<CLASSNAME *>(this)->*fn)();
}
template <class CLASSNAME, class RETVAL, class PARAM1>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1);
}
template <class CLASSNAME, class PARAM1>
void vcb(void (CLASSNAME::*fn)(PARAM1), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1);
}
template <class CLASSNAME, class PARAM1, class PARAM2>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2);
}
// 3 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3);
}
// 4 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4);
}
// 5 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5);
}
// 6 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6);
}
// 7 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7);
}
// 8 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8);
}
// 9 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9);
}
// 10 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAM10), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
PARAM10 *p10 = static_cast<PARAM10*>(params[9]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10);
}
template <class CLASSNAME, class RETVAL, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10>
void cb(RETVAL (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAM10), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
PARAM10 *p10 = static_cast<PARAM10*>(params[9]);
*static_cast<RETVAL*>(retval) = (static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10);
}
// 14 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAM10, PARAM11, PARAM12, PARAM13, PARAM14), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
PARAM10 *p10 = static_cast<PARAM10*>(params[9]);
PARAM11 *p11 = static_cast<PARAM11*>(params[10]);
PARAM12 *p12 = static_cast<PARAM12*>(params[11]);
PARAM13 *p13 = static_cast<PARAM13*>(params[12]);
PARAM14 *p14 = static_cast<PARAM14*>(params[13]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10, *p11, *p12, *p13, *p14);
}
// 16 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14, class PARAM15, class PARAM16>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAM10, PARAM11, PARAM12, PARAM13, PARAM14, PARAM15, PARAM16), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
PARAM10 *p10 = static_cast<PARAM10*>(params[9]);
PARAM11 *p11 = static_cast<PARAM11*>(params[10]);
PARAM12 *p12 = static_cast<PARAM12*>(params[11]);
PARAM13 *p13 = static_cast<PARAM13*>(params[12]);
PARAM14 *p14 = static_cast<PARAM14*>(params[13]);
PARAM15 *p15 = static_cast<PARAM15*>(params[14]);
PARAM16 *p16 = static_cast<PARAM16*>(params[15]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10, *p11, *p12, *p13, *p14, *p15, *p16);
}
// 17 params
template <class CLASSNAME, class PARAM1, class PARAM2, class PARAM3, class PARAM4, class PARAM5, class PARAM6, class PARAM7, class PARAM8, class PARAM9, class PARAM10, class PARAM11, class PARAM12, class PARAM13, class PARAM14, class PARAM15, class PARAM16, class PARAM17>
void vcb(void (CLASSNAME::*fn)(PARAM1, PARAM2, PARAM3, PARAM4, PARAM5, PARAM6, PARAM7, PARAM8, PARAM9, PARAM10, PARAM11, PARAM12, PARAM13, PARAM14, PARAM15, PARAM16, PARAM17), void *retval, void **params) {
PARAM1 *p1 = static_cast<PARAM1*>(params[0]);
PARAM2 *p2 = static_cast<PARAM2*>(params[1]);
PARAM3 *p3 = static_cast<PARAM3*>(params[2]);
PARAM4 *p4 = static_cast<PARAM4*>(params[3]);
PARAM5 *p5 = static_cast<PARAM5*>(params[4]);
PARAM6 *p6 = static_cast<PARAM6*>(params[5]);
PARAM7 *p7 = static_cast<PARAM7*>(params[6]);
PARAM8 *p8 = static_cast<PARAM8*>(params[7]);
PARAM9 *p9 = static_cast<PARAM9*>(params[8]);
PARAM10 *p10 = static_cast<PARAM10*>(params[9]);
PARAM11 *p11 = static_cast<PARAM11*>(params[10]);
PARAM12 *p12 = static_cast<PARAM12*>(params[11]);
PARAM13 *p13 = static_cast<PARAM13*>(params[12]);
PARAM14 *p14 = static_cast<PARAM14*>(params[13]);
PARAM15 *p15 = static_cast<PARAM15*>(params[14]);
PARAM16 *p16 = static_cast<PARAM16*>(params[15]);
PARAM17 *p17 = static_cast<PARAM17*>(params[16]);
(static_cast<CLASSNAME *>(this)->*fn)(*p1, *p2, *p3, *p4, *p5, *p6, *p7, *p8, *p9, *p10, *p11, *p12, *p13, *p14, *p15, *p16, *p17);
}
enum { DESTRUCT=0xffff };
};
#define CB(x, y) case (x): cb(&CBCLASS::y, retval, params); break;
#define VCB(x, y) case (x): vcb(&CBCLASS::y, retval, params); break;
#define RECVS_DISPATCH virtual int WASABICALL _dispatch(int msg, void *retval, void **params=0, int nparam=0)
#define START_DISPATCH \
int CBCLASS::_dispatch(int msg, void *retval, void **params, int nparam) { \
switch (msg) {
#define START_DISPATCH_INLINE \
int WASABICALL CBCLASS::_dispatch(int msg, void *retval, void **params, int nparam) { \
switch (msg) {
//FINISH case DESTRUCT: delete this; return 1;
#define END_DISPATCH \
default: return 0; \
} \
return 1; \
}
#define FORWARD_DISPATCH(x) \
default: return x::_dispatch(msg, retval, params, nparam); \
} \
return 1; \
}
#define DISPATCH_CODES enum
inline size_t Dispatchable::AddRef()
{
return _call(Dispatchable::ADDREF, 0);
}
inline size_t Dispatchable::Release()
{
return _call(Dispatchable::RELEASE, 0);
}
inline int Dispatchable::QueryInterface(GUID interface_guid, void **object)
{
return _call(Dispatchable::QUERYINTERFACE, 0, interface_guid, object);
}

View file

@ -0,0 +1,37 @@
#ifndef _NSGUID_H
#define _NSGUID_H
#include "platform/guid.h"
//#include <bfc/common.h>
// Some conversion functions to allow
// us to have GUIDs translatable to and from other data types.
class nsGUID {
public:
// To the "Human Readable" character format.
// {1B3CA60C-DA98-4826-B4A9-D79748A5FD73}
static char *toChar(const GUID &guid, char *target);
static wchar_t *toCharW(const GUID &guid, wchar_t *target);
static GUID fromCharW(const wchar_t *source);
// To the "C Structure" character format.
// { 0x1b3ca60c, 0xda98, 0x4826, { 0xb4, 0xa9, 0xd7, 0x97, 0x48, 0xa5, 0xfd, 0x73 } };
static char *toCode(const GUID &guid, char *target);
static GUID fromCode(const char *source);
// Compare function, returns -1, 0, 1
static int compare(const GUID &a, const GUID &b);
// strlen("{xx xxx xxx-xxxx-xxxx-xxxx-xxx xxx xxx xxx}"
enum { GUID_STRLEN = 38 };
#ifdef WASABI_COMPILE_CREATEGUID
static void createGuid(GUID *g);
#endif
};
inline
int operator <(const GUID &a, const GUID &b) {
return (nsGUID::compare(a, b) < 0);
}
#endif //_NSGUID_H

View file

@ -0,0 +1,24 @@
#ifndef _GUID_H
#define _GUID_H
#include "types.h"
#include "platform.h"
#ifdef __cplusplus
#ifndef GUID_EQUALS_DEFINED
#define GUID_EQUALS_DEFINED
#include <memory.h>
static __inline int operator ==(const GUID &a, const GUID &b) {
return !memcmp(&a, &b, sizeof(GUID));
}
static __inline int operator !=(const GUID &a, const GUID &b) {
return !!memcmp(&a, &b, sizeof(GUID));
}
#endif //GUID_EQUALS_DEFINED
#endif //__cplusplus
static const GUID INVALID_GUID = { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} };
static const GUID GENERIC_GUID = { 0xFFFFFFFF, 0xFFFF, 0xFFFF, {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
#endif

View file

@ -0,0 +1,500 @@
#ifndef _PLATFORM_H
#define _PLATFORM_H
#include "types.h"
#include "../std_mkncc.h" // for MKnCC
#ifdef WIN32
# include "win32.h"
#define OSMODULEHANDLE HINSTANCE
#define INVALIDOSMODULEHANDLE ((OSMODULEHANDLE)0)
#define OSWINDOWHANDLE HWND
#define INVALIDOSWINDOWHANDLE ((OSWINDOWHANDLE)0)
#define OSICONHANDLE HICON
#define INVALIDOSICONHANDLE ((OSICONHANDLE)0)
#define OSCURSORHANDLE HICON
#define INVALIDOSCURSORHANDLE ((OSCURSORHANDLE)0)
#define OSTHREADHANDLE HANDLE
#define INVALIDOSTHREADHANDLE ((OSTHREADHANDLE)0)
#define OSREGIONHANDLE HRGN
#define INVALIDOSREGIONHANDLE ((OSREGIONHANDLE)0)
typedef HMENU OSMENUHANDLE;
#define RGBA(r,g,b,a) ((ARGB32)((uint8_t)(r) | ((uint8_t)(g) << 8) | ((uint8_t)(b) << 16) | ((uint8_t)(a) << 24)))
#ifndef PATH_MAX
#define PATH_MAX MAX_PATH
#endif
#elif defined(LINUX)
# include <bfc/platform/linux.h>
#elif defined(__APPLE__)
#include <Carbon/Carbon.h>
typedef HIShapeRef OSREGIONHANDLE;
typedef int OSCURSOR; // TODO: find a good one for this
typedef int OSCURSORHANDLE; // TODO: find a good one for this
typedef HIWindowRef OSWINDOWHANDLE;
typedef void *OSMODULEHANDLE; // TODO:
typedef CGContextRef HDC; // TODO: find a better name
typedef MenuRef OSMENUHANDLE;
typedef CGImageRef OSICONHANDLE;
#ifdef __LITTLE_ENDIAN__
#define RGBA(r,g,b,a) ((ARGB32)((uint8_t)(r) | ((uint8_t)(g) << 8) | ((uint8_t)(b) << 16) | ((uint8_t)(a) << 24)))
#elif defined(__BIG_ENDIAN__)
#define RGBA(r,g,b,a) ((ARGB32)((uint8_t)(a) | ((uint8_t)(r) << 8) | ((uint8_t)(g) << 16) | ((uint8_t)(b) << 24)))
#else
#error endian preprocessor symbol not defined
#endif
#define RGB(r,g,b) RGBA(r,g,b,0xFF)
static const HIWindowRef INVALIDOSWINDOWHANDLE = 0; // TODO: maybe there's an apple-defined name for this
#define INVALIDOSMODULEHANDLE 0
#define INVALIDOSCURSORHANDLE 0
typedef char OSFNCHAR;
typedef char *OSFNSTR;
typedef const char OSFNCCHAR;
typedef const char *OSFNCSTR;
#define FNT(x) x
typedef struct tagRECT
{
int left;
int top;
int right;
int bottom;
}
RECT;
typedef RECT * LPRECT;
inline RECT RECTFromHIRect(const HIRect *r)
{
RECT rect;
rect.left = r->origin.x;
rect.right = r->origin.x + r->size.width;
rect.top = r->origin.y;
rect.bottom = r->origin.y + r->size.height;
return rect;
}
inline HIRect HIRectFromRECT(const RECT *r)
{
HIRect rect;
rect.origin.x = r->left;
rect.origin.y = r->top;
rect.size.width = r->right - r->left;
rect.size.height = r->bottom - r->top;
return rect;
}
typedef struct tagPOINT
{
int x;
int y;
}
POINT;
typedef struct tagPOINT * LPPOINT;
inline HIPoint HIPointFromPOINT(const POINT *pt)
{
HIPoint p;
p.x = pt->x;
p.y = pt->y;
return p;
}
inline int MulDiv(int a, int b, int c)
{
int s;
int v;
s = 0;
if (a < 0)
{
s = !s;
a = -a;
}
if (b < 0)
{
s = !s;
b = -b;
}
if (c < 0)
{
s = !s;
c = -c;
}
double d;
d = ((double)a * (double)b) / (double)c;
if (d >= 4294967296.)
return -1;
v = d;
if (s)
v = -v;
return v;
}
#else
#error port me
// Windows API dependant definitions for non-windows platforms
#define __cdecl
#define __stdcall
#define WINAPI
#define WINBASEAPI
#define WINUSERAPI
#define WINGDIAPI
#define WINOLEAPI
#define CALLBACK
#define FARPROC void *
#define FALSE 0
#define TRUE 1
#define ERROR 0
#define CONST const
#define VOID void
typedef unsigned long DWORD;
typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef long LONG;
typedef int INT;
typedef int BOOL;
typedef short SHORT;
typedef void * PVOID;
typedef void * LPVOID;
typedef char CHAR;
typedef unsigned short WCHAR;
typedef char * LPSTR;
typedef WCHAR * LPWSTR;
typedef const char * LPCSTR;
typedef const WCHAR * LPCWSTR;
typedef LPWSTR PTSTR, LPTSTR;
typedef LPCWSTR LPCTSTR;
typedef char TCHAR;
typedef WCHAR OLECHAR;
typedef void * HANDLE;
typedef void * HWND;
typedef void * HDC;
typedef void * HFONT;
typedef void * HBITMAP;
typedef void * HINSTANCE;
typedef void * HICON;
typedef void * HRGN;
typedef void * HPEN;
typedef void * HBRUSH;
typedef void * HRSRC;
typedef void * HGLOBAL;
typedef void * HACCEL;
typedef void * HMODULE;
typedef void * HMENU;
typedef void * HGDIOBJ;
typedef void * ATOM;
typedef void * CRITICAL_SECTION;
typedef void * LPCRITICAL_SECTION;
typedef UINT WPARAM;
typedef UINT LPARAM;
typedef LONG LRESULT;
typedef UINT COLORREF;
typedef LRESULT(*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
typedef BOOL CALLBACK WNDENUMPROC(HWND, LPARAM);
typedef VOID CALLBACK *TIMERPROC(HWND, UINT, UINT, DWORD);
typedef struct tagPOINT
{
LONG x;
LONG y;
}
POINT;
typedef struct tagPOINT * LPPOINT;
typedef struct tagSIZE
{
LONG cx;
LONG cy;
}
SIZE;
typedef struct tagRECT
{
LONG left;
LONG top;
LONG right;
LONG bottom;
}
RECT;
typedef RECT * LPRECT;
typedef struct _COORD
{
SHORT X;
SHORT Y;
}
COORD, *PCOORD;
typedef struct tagPAINTSTRUCT
{
HDC hdc;
BOOL fErase;
RECT rcPaint;
BOOL fRestore;
BOOL fIncUpdate;
BYTE rgbReserved[32];
}
PAINTSTRUCT;
typedef struct tagBITMAP
{ /* bm */
int bmType;
int bmWidth;
int bmHeight;
int bmWidthBytes;
BYTE bmPlanes;
BYTE bmBitsPixel;
LPVOID bmBits;
}
BITMAP;
typedef struct tagRGBQUAD
{
BYTE rgbRed;
BYTE rgbGreen;
BYTE rgbBlue;
BYTE rgbReserved;
}
RGBQUAD;
typedef struct tagBITMAPINFOHEADER
{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
}
BITMAPINFOHEADER;
typedef struct tagBITMAPINFO
{
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
}
BITMAPINFO, *LPBITMAPINFO;
typedef struct tagMSG
{
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
}
MSG;
typedef MSG * LPMSG;
typedef struct _RGNDATAHEADER
{
DWORD dwSize;
DWORD iType;
DWORD nCount;
DWORD nRgnSize;
RECT rcBound;
}
RGNDATAHEADER, *PRGNDATAHEADER;
typedef struct _RGNDATA
{
RGNDATAHEADER rdh;
char Buffer[1];
}
RGNDATA, *PRGNDATA;
// Windows messages
#define WM_SYSCOMMAND 0x112
#define WM_LBUTTONDOWN 0x201
#define WM_LBUTTONUP 0x202
#define WM_RBUTTONDOWN 0x204
#define WM_RBUTTONUP 0x205
#define WM_USER 0x400
#define WS_EX_TOOLWINDOW 0x00000080L
#define WS_OVERLAPPED 0x00000000L
#define WS_MAXIMIZEBOX 0x00010000L
#define WS_MINIMIZEBOX 0x00020000L
#define WS_SYSMENU 0x00080000L
#define WS_CAPTION 0x00C00000L
#define WS_CLIPCHILDREN 0x02000000L
#define WS_CLIPSIBLINGS 0x04000000L
#define WS_VISIBLE 0x10000000L
#define WS_CHILD 0x40000000L
#define WS_POPUP 0x80000000L
#define HWND_TOP ((HWND)0)
#define HWND_TOPMOST ((HWND)-1)
#define HWND_NOTOPMOST ((HWND)-2)
#define GWL_STYLE (-16)
#define GW_HWNDFIRST 0
#define GW_HWNDNEXT 2
#define SWP_NOMOVE 0x0002
#define SWP_NOSIZE 0x0001
#define SWP_SHOWWINDOW 0x0040
#define SWP_DEFERERASE 0x2000
#define SWP_NOZORDER 0x0004
#define SWP_NOACTIVATE 0x0010
#define SW_SHOW 5
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#define SC_RESTORE 0xF120
#define GCL_HICONSM (-34)
#define GCL_HICON (-14)
#define MB_OK 0
#define MB_OKCANCEL 1
#define MB_TASKMODAL 0x2000L
#define IDOK 1
#define IDCANCEL 2
#define VK_SHIFT 0x10
#define VK_CONTROL 0x11
#define VK_MENU 0x12
#define RT_RCDATA 10
#define IMAGE_BITMAP 0
#define LR_LOADFROMFILE 0x0010
#define DIB_RGB_COLORS 0
#define MAX_PATH 1024
#define _MAX_PATH MAX_PATH
#define _MAX_DRIVE 3
#define _MAX_DIR 256
#define _MAX_FNAME 256
#define _MAX_EXT 256
#define GMEM_FIXED 0x0
#define GMEM_ZEROINIT 0x40
#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
#define SPI_GETWORKAREA 48
#define SM_CXDOUBLECLK 36
#define SM_CYDOUBLECLK 37
#define COLORONCOLOR 3
#define SRCCOPY (DWORD)0x00CC0020
#define BI_RGB 0L
#define NULLREGION 1
#define DT_LEFT 0x00000000
#define DT_CENTER 0x00000001
#define DT_RIGHT 0x00000002
#define DT_VCENTER 0x00000004
#define DT_WORDBREAK 0x00000010
#define DT_SINGLELINE 0x00000020
#define DT_CALCRECT 0x00000400
#define DT_NOPREFIX 0x00000800
#define DT_PATH_ELLIPSIS 0x00004000
#define DT_END_ELLIPSIS 0x00008000
#define DT_MODIFYSTRING 0x00010000
#define FW_NORMAL 400
#define FW_BOLD 700
#define FF_DONTCARE (0<<4)
#define BLACK_BRUSH 4
#define NULL_BRUSH 5
#define PS_SOLID 0
#define PS_DOT 2
#define TRANSPARENT 1
#define OPAQUE 2
#define ANSI_CHARSET 0
#define ANSI_VAR_FONT 12
#define OUT_DEFAULT_PRECIS 0
#define CLIP_DEFAULT_PRECIS 0
#define PROOF_QUALITY 2
#define VARIABLE_PITCH 2
#define RGN_AND 1
#define RGN_OR 2
#define RGN_DIFF 4
#define RGN_COPY 5
#define RDH_RECTANGLES 1
#define MAXLONG 0x7fffffff
// define GUID
#include <bfc/platform/guid.h>
#endif /* not WIN32 */
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
#include <new>
#else
#include <new.h>
#endif
#include <limits.h>
#ifdef WIN32
#define OSPIPE HANDLE
#define OSPROCESSID int
#endif
// Ode macro keyworkds
#define DISPATCH_ // makes a method dispatchable, automatically assigns a free ID (requires Interface)
#define DISPATCH(x) // makes a method dispatchable and specifies its ID (not duplicate check, requires Interface)
#define NODISPATCH // prevents a method from being dispatched if the class is marked for dispatching by default
#define EVENT // marks a method as being an event to which other classes can connect to receive notification (used by Script and DependentItem helpers)
#define SCRIPT // exposes a method to script interfaces (requires Script helper)
#define IN // Input parameter
#define OUT // Output parameter
#define INOUT // Input/Output parameter
#endif

View file

@ -0,0 +1,78 @@
#ifndef __WASABI_TYPES_H
#define __WASABI_TYPES_H
// first, some standard int types
typedef unsigned int UINT;
typedef signed int SINT;
typedef unsigned char UCHAR;
typedef signed char SCHAR;
typedef unsigned long ARGB32;
typedef unsigned long RGB32;
typedef unsigned long ARGB24;
typedef unsigned long RGB24;
typedef unsigned short ARGB16;
typedef unsigned short RGB16;
typedef unsigned long FOURCC;
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
/*
#ifndef _REFCLSID_DEFINED
#define REFGUID const GUID &
#define _REFCLSID_DEFINED
#endif
*/
#endif
#if defined(_WIN32) && !defined(__GNUC__)
#include <stddef.h>
// since windows doesn't have stdint.h
typedef unsigned __int64 uint64_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int8 uint8_t;
typedef __int64 int64_t;
typedef __int32 int32_t;
typedef __int16 int16_t;
typedef __int8 int8_t;
typedef size_t ssize_t;
#else
#include <stdint.h>
#include <stddef.h>
#include <inttypes.h>
#endif
#ifdef WIN32
#include <windows.h>
// this is for GUID == and !=
#include <objbase.h>
#ifndef GUID_EQUALS_DEFINED
#define GUID_EQUALS_DEFINED
#endif
#ifdef NULL
#undef NULL
#endif
#ifndef NULL
#define NULL 0
#endif
#ifdef _WIN32_WCE
typedef int intptr_t;
#endif
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef _WIN32_H
#define _WIN32_H
#ifndef WIN32
#error this file is only for win32
#endif
#ifndef _PLATFORM_H
#error this file should only be included from platform.h
#endif
// this should be the *only* place windows.h gets included!
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifndef _WIN32_WCE
#include <io.h>
#endif
#if defined(_MSC_VER) // msvc
# define WASABIDLLEXPORT __declspec(dllexport)
# if _MSC_VER >= 1100
# define NOVTABLE __declspec(novtable)
# endif
#endif
#define _TRY __try
#define _EXCEPT(x) __except(x)
#define OSPIPE HANDLE
typedef WCHAR OSFNCHAR;
typedef LPWSTR OSFNSTR;
typedef LPCWSTR OSFNCSTR;
#endif

View file

@ -0,0 +1,11 @@
#ifndef _STD_MKNCC
#define _STD_MKNCC
// note: this is endian-incompatible with win32's MAKEFOURCC
// otoh, it shows up nicely in a debug register ;)
#define MK4CC(a, b, c, d) ( (((unsigned long)a)<<24)|(((unsigned long)b)<<16)|(((unsigned long)c)<<8)|((unsigned long)d) )
#define MK3CC(b, c, d) ( (((unsigned long)b)<<16)|(((unsigned long)c)<<8)|((unsigned long)d) )
#define MK2CC(c, d) ( (((unsigned long)c)<<8)|((unsigned long)d) )
#endif

View file

@ -0,0 +1,133 @@
#ifndef NULLSOFT_AUTOCHARH
#define NULLSOFT_AUTOCHARH
#ifdef WIN32
#include <windows.h>
inline char *AutoCharDupN(const wchar_t *convert, size_t len, UINT codePage = CP_ACP, UINT flags=0)
{
if (!convert)
return 0;
int size = WideCharToMultiByte(codePage, flags, convert, (int)len, 0, 0, NULL, NULL);
if (!size)
return 0;
char *narrow = (char *)malloc((size+1)*sizeof(char));
if (!WideCharToMultiByte(codePage, flags, convert, (int)len, narrow, size, NULL, NULL))
{
free(narrow);
narrow=0;
}
else
narrow[size]=0;
return narrow;
}
inline char *AutoCharDup(const wchar_t *convert, UINT codePage = CP_ACP, UINT flags=0)
{
if (!convert)
return 0;
int size = WideCharToMultiByte(codePage, flags, convert, -1, 0, 0, NULL, NULL);
if (!size)
return 0;
char *narrow = (char *)malloc(size*sizeof(char));
if (!WideCharToMultiByte(codePage, flags, convert, -1, narrow, size, NULL, NULL))
{
free(narrow);
narrow=0;
}
return narrow;
}
class AutoChar
{
public:
AutoChar(const wchar_t *convert, UINT codePage = CP_ACP, UINT flags=0) : narrow(0)
{
narrow = AutoCharDup(convert, codePage, flags);
}
~AutoChar()
{
free(narrow);
narrow=0;
}
operator const char *()
{
return narrow;
}
operator char *()
{
return narrow;
}
protected:
AutoChar() : narrow(0)
{
}
char *narrow;
};
class AutoCharN : public AutoChar
{
public:
AutoCharN(const wchar_t *convert, size_t len, UINT codePage = CP_ACP, UINT flags=0)
{
narrow = AutoCharDupN(convert, len, codePage, flags);
}
};
#else
#include <stdlib.h>
#include <wchar.h>
inline char *AutoCharDup(const wchar_t *convert)
{
if (!convert)
return 0;
size_t size = wcslen(convert)+1;
if (!size)
return 0;
char *narrow = (char *)malloc(size*sizeof(char));
if (wcstombs(narrow, convert, size) == (size_t)-1)
{
free(narrow);
narrow=0;
}
return narrow;
}
class AutoChar
{
public:
AutoChar(const wchar_t *convert) : narrow(0)
{
narrow = AutoCharDup(convert);
}
~AutoChar()
{
free(narrow);
narrow=0;
}
operator const char *()
{
return narrow;
}
operator char *()
{
return narrow;
}
private:
char *narrow;
};
#endif
#endif

View file

@ -0,0 +1,86 @@
#ifndef AUTOWIDEH
#define AUTOWIDEH
#ifdef WIN32
#include <windows.h>
inline wchar_t *AutoWideDup(const char *convert, UINT codePage=CP_ACP)
{
wchar_t *wide = 0;
if (!convert)
return 0;
int size = MultiByteToWideChar(codePage, 0, convert, -1, 0,0);
if (!size)
return 0;
wide = (wchar_t *)malloc(size*sizeof(wchar_t));
if (!MultiByteToWideChar(codePage, 0, convert, -1, wide,size))
{
free(wide);
wide=0;
}
return wide;
}
class AutoWide
{
public:
AutoWide(const char *convert, UINT codePage=CP_ACP) : wide(0)
{
wide = AutoWideDup(convert, codePage);
}
~AutoWide()
{
free(wide);
wide=0;
}
operator wchar_t *()
{
return wide;
}
private:
wchar_t *wide;
};
#elif defined(__APPLE__)
#include <string.h>
inline wchar_t *AutoWideDup(const char *convert)
{
wchar_t *wide=0;
if (!convert)
return 0;
int size = strlen(convert)+1;
if (!size)
return 0;
wide = (wchar_t *)malloc(size*sizeof(wchar_t));
if (mbstowcs(wide, convert, size) == (size_t)-1)
{
free(wide);
wide=0;
}
return wide;
}
class AutoWide
{
public:
AutoWide(const char *convert) : wide(0)
{
wide = AutoWideDup(convert);
}
~AutoWide()
{
free(wide);
wide=0;
}
operator wchar_t *()
{
return wide;
}
private:
wchar_t *wide;
};
#endif
#endif

View file

@ -0,0 +1,118 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winresrc.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Neutral (Default) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)
#ifdef _WIN32
LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_ABOUT "WavPack Decoder"
IDS_ENCODER_VERSION "WavPack encoder version: %d\n"
IDS_SOURCE "Source: %d-bit %s at %d Hz \n"
IDS_MULTICHANNEL "Channels: %d (multichannel)\n"
IDS_MONO "Channels: 1 (mono)\n"
IDS_STEREO "Channels: 2 (stereo)\n"
IDS_HYBRID "hybrid"
IDS_LOSSLESS "lossless"
IDS_LOSSY "lossy"
IDS_INTS "ints"
IDS_FLOATS "floats"
IDS_MODES "Modes"
IDS_FAST ", fast"
IDS_HIGH ", high"
IDS_VHIGH ", v.high"
END
STRINGTABLE
BEGIN
IDS_EXTRA ", extra"
IDS_BITRATE "Average bitrate"
IDS_RATIO "Overall ratio"
IDS_KBPS "kbps"
IDS_MD5 "Original md5"
IDS_DESCRIPTION "WavPack Decoder v%s"
IDS_FILETYPE "WavPack Files (*.WV)"
IDS_ABOUT_MESSAGE "WavPack Decoder v%hs\nCopyright (c) %hs Conifer Software\n\nBuild date: %hs\n\nSee http://www.wavpack.com for information."
IDS_FAMILY_STRING "WavPack File"
END
STRINGTABLE
BEGIN
IDS_GUID "{6DE2E465-690E-4df1-B6E2-2A9B33ED3DBB}"
END
#endif // Neutral (Default) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winresrc.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="winamp"
ProjectGUID="{1DB9C3E7-D670-46EB-B006-CCF94982D484}"
RootNamespace="winamp"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\in_wv.dll"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="false"
WarningLevel="3"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\in_wv.dll"
LinkIncremental="1"
GenerateManifest="false"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
EntryPointSymbol=""
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="lng_generator.exe &quot;$(OutDir)\in_wv.dll&quot; /build&#x0D;&#x0A;copy &quot;$(OutDir)\in_wv.dll&quot; &quot;$(ProgramFiles)\Winamp\plugins&quot; /y&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{5CCCB9CF-0384-458F-BA08-72B73866840F}"
/>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\in2.h"
>
</File>
<File
RelativePath=".\out.h"
>
</File>
<File
RelativePath=".\resource.h"
>
</File>
<File
RelativePath=".\wasabi\Wasabi.h"
>
</File>
<File
RelativePath="..\include\wavpack.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\wavpack.rc"
>
</File>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\in_wv.cpp"
>
</File>
<File
RelativePath=".\wasabi\Wasabi.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>