| |
Effect plugin header file |
- AtomixDsp.h -
#ifndef AtomixDspH
#define AtomixDspH
//---------------------------------------------------------------------------
// for compatibility with old compiler
#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef long HRESULT;
#endif
#ifdef STRICT
#ifndef DECLARE_HANDLE
struct HINSTANCE__ { int unused; }; typedef struct HINSTANCE__ *HINSTANCE;
struct HWND__ { int unused; }; typedef struct HWND__ *HWND;
#endif
#else
typedef void *HINSTANCE;
typedef void *HWND;
#endif
//---------------------------------------------------------------------------
class IAtomixDsp // Interface for the plugin. Let your DSP class inherit from this class
{
public:
// functions that are called by AtomixMP3
virtual HRESULT __stdcall OnLoad()=0; // this function is called when the library is loaded (you can use SendCommand in this function, unlike in the constructor)
virtual HRESULT __stdcall GetName(char **Name,char **Author)=0; // get the name and author of the plugin
virtual HRESULT __stdcall GetSliders(int *nbSliders,char **ToolTips)=0; // get the number of sliders needed and their tooltips
virtual HRESULT __stdcall OnStart()=0; // this function is called when the plugin is started
virtual HRESULT __stdcall Modify(int *PCM_Datas,int nb)=0; // this function is called each time new datas are to be processed
virtual HRESULT __stdcall OnJump(int delta)=0; // this function is called when the decoding jump to a new position
virtual HRESULT __stdcall OnStop()=0; // this function is called when the plugin is stopped
virtual ULONG __stdcall Release()=0; // this function is called when the library is unloaded and the object can be deleted
// function that the plugin can call
int (__stdcall *SendCommand)(int where,int cmd,int param); // call this function to send a command to atomix
// variables that the plugin can read
int SlidersValues[3]; // sliders values, ranged from 0 (min) to 4096 (max)
float Bpm; // global BPM of the song
float InstBpm; // instant BPM of the song
unsigned int PlayPos; // sample number actually being played (from the start of the song)
unsigned int SamplePos; // sample number actually being processed by the plugin
unsigned int SongLength; // total number of samples in the song
HINSTANCE hInst; // instance of the loaded dll
HWND hWndParent; // handle of the AtomixMP3 window
unsigned int Version; // current version of AtomixMP3 (0x02020000 for 2.2.0.0)
int PluginNumber; // slot number in which the plugin is loaded (from 0 to 5. Even for desk A, odd for desk B)
};
//---------------------------------------------------------------------------
// commands to be used with the SendCommand function
#define ATOMIXCMD_STOP 1 // Stop the song
#define ATOMIXCMD_STOPEFFECT 2 // Stop the effect
#define ATOMIXCMD_GETPITCH 3 // Get the actual pitch value (in 100/4096th of percent)
#define ATOMIXCMD_SETPITCH 4 // Set the pitch value (in 100/4096th of percent)
#define ATOMIXCMD_SETPOS 5 // Set the actual playing position in the song
#define ATOMIXCMD_GETSONGINFOS 6 // Get the infos for the actual song (see TSongInfos struct)
#define ATOMIXCMD_SETSONGINFOS 7 // Set the infos for the actual song
//---------------------------------------------------------------------------
// Song infos structure
struct TSongInfos
{
char *FileName;
int FileSize;
char *Author;
char *Title;
int Date;
float Bpm;
int Volume;
char *Comment;
};
//---------------------------------------------------------------------------
// COM-like stuff (we made the plugins look like COM so that a real COM object can be used as a plugin)
#ifdef __cplusplus
extern "C" {
#endif
#ifndef ATOMIXDSPGUID_DEFINED
#define ATOMIXDSPGUID_DEFINED
static const GUID CLSID_AtomixDsp = { 0x9b4af611, 0x872e, 0x45bd, { 0x9f, 0xdb, 0x4b, 0x80, 0x9f, 0xa9, 0xf7, 0x45 } };
static const GUID IID_IAtomixDspV1 = { 0x60347063, 0x279d, 0x433a, { 0x83, 0xac, 0x64, 0x15, 0x3c, 0x73, 0x65, 0x9d } };
#else
extern static const GUID CLSID_AtomixDsp;
extern static const GUID IID_IAtomixDsp;
#endif
#ifdef ATOMIX
typedef HRESULT (__stdcall *DllGetClassObjectType)(const GUID &,const GUID &,void**);
#else
__declspec( dllexport ) HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject);
#endif
#ifdef __cplusplus
}
#endif
//---------------------------------------------------------------------------
#endif
|