MidiVid Home 

MVPlug.h

Go to the documentation of this file.
00001 /* 00002 00003 MVPlug.h - MidVid Plugin class definition 00004 00005 */ 00006 00007 #pragma once 00008 #ifndef MVPLUG_H 00009 #define MVPLUG_H 00010 00011 #include "MidiVidInterface.h" 00012 #include "TagStream.h" 00013 00016 class MVPlugDesc; 00017 class MVBasePlug; 00018 class MVPlug; 00019 00021 const long MVP_Header_Version = 0x00000300; 00022 00029 #define MVExport extern "C" __declspec(dllexport) 00030 00031 00032 00033 #ifndef MIDIVID_APP // Exporting from DLL to MidVid ------------------------------- 00034 00041 MVExport long mvpGetVersion(void); 00042 00048 MVExport long mvpGetNumPlugs(void); 00049 00055 MVExport MVPlugDesc *mvpGetPlugDesc(long WhichPlug); 00056 00057 #endif 00058 00059 // ---------------------------------------------------------------------------- 00061 typedef enum { 00062 PlugType_Event = 0, 00063 PlugType_Video = 1, 00064 PlugType_Audio = 2, 00065 PlugType_AudioVideo = 3, 00066 00067 PlugType_Source = 4, 00068 } MVPlugType; 00069 00070 00071 // ---------------------------------------------------------------------------- 00073 struct MVGuid 00074 { 00075 DWORD Data1; 00076 WORD Data2; 00077 WORD Data3; 00078 BYTE Data4[8]; 00079 }; 00080 00081 inline bool operator==(const MVGuid &lhs, const MVGuid &rhs) 00082 { 00083 return memcmp(&lhs, &rhs, sizeof(MVGuid)) == 0; 00084 } 00085 00086 00087 // ---------------------------------------------------------------------------- 00099 class MVPlugDesc 00100 { 00101 public: 00102 virtual ~MVPlugDesc() {;} 00103 00104 virtual MVPlugType GetType(void) = 0; 00105 virtual const MVGuid &GetGUID(void) = 0; 00106 00107 virtual const char *GetClass(void) = 0; 00108 virtual const char *GetName(void) = 0; 00109 virtual const char *GetDesc(void) = 0; 00110 virtual MVBasePlug *CreatePlug(void) = 0; 00111 }; 00112 00113 00114 // ---------------------------------------------------------------------------- 00121 class MVBasePlug 00122 { 00123 public: 00124 MVBasePlug() : pMVI(0) {;} 00125 00126 virtual ~MVBasePlug() {;} 00127 void SetInterface(MidiVidInterface &MVI) {pMVI = &MVI;} 00128 00129 virtual MVPlugType GetType(void) = 0; 00130 virtual const MVGuid &GetGUID(void) = 0; 00131 00134 MidiVidInterface *pMVI; 00135 }; 00136 00137 00138 typedef void (*FormatKnobValueFunc)(int Value, char Output[32], MVPlug *pPlugin, int Index); 00139 00140 00141 // ---------------------------------------------------------------------------- 00143 struct MVParamInfo 00144 { 00145 int MinValue; 00146 int MaxValue; 00147 int Default; 00148 bool bWrap; 00149 DWORD ParamID; 00150 const char *pName; 00151 FormatKnobValueFunc pFunc; 00152 }; 00153 00154 00155 // ---------------------------------------------------------------------------- 00166 class MVPlug : public MVBasePlug 00167 { 00168 public: 00169 // ------------------------------------------------------------------------ 00170 // Maintained by MidiVid, accessible to plugins 00171 00172 BYTE Velocity; 00173 BYTE Channel; 00174 WORD StartChan; 00175 // ------------------------------------------------------------------------ 00176 00177 MVPlug() {StartChan = 0;} 00178 virtual ~MVPlug() {;} 00179 00180 virtual long GetNumFiles(void) = 0; 00181 virtual const char *GetFileName(long WhichFile) = 0; 00182 virtual void SetFileName(long WhichFile, char *pNewName) = 0; 00183 00185 virtual bool Startup(void) = 0; 00186 00188 virtual bool Shutdown(void) = 0; 00189 00190 virtual bool Assign(HWND hCallWnd) = 0; 00191 00192 virtual void NoteOn(void) = 0; 00193 virtual void NoteOff(void) = 0; 00194 virtual void Tick(DWORD dwTimeDelt) = 0; 00195 virtual bool Sustain(void) = 0; 00196 00197 virtual bool Load(TagStream &f) = 0; 00198 virtual bool Save(TagStream &f) = 0; 00199 00200 00201 virtual int NumParameters(void) = 0; 00202 virtual bool ParameterVisible(int Index) = 0; 00203 virtual MVParamInfo *GetParamInfo(int Param) = 0; 00204 virtual int GetParameter(int Index) = 0; 00205 virtual void SetParameter(int Index, int Value) = 0; 00206 }; 00207 00208 #include "MVSourcePlug.h" 00209 00210 #endif


MidiVid GPU Version 1.0
Copyright (c) 2005 Jason Dorie and VUTAG
Generated on: Sun Jan 25 23:45:41 2009