From 8eac5088101595422753030b1b259411d63f83a8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 27 Apr 2016 23:45:24 +0800 Subject: Handle pitch bend in visualization. Handle mute and solo in the default visualization. Show file name in window title. A little plugin sdk documentaion... Remove stupid things. --- include/qmpcorepublic.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/qmpcorepublic.hpp b/include/qmpcorepublic.hpp index 8c67562..a8e3fa8 100644 --- a/include/qmpcorepublic.hpp +++ b/include/qmpcorepublic.hpp @@ -2,11 +2,15 @@ #define QMPCOREPUBLIC_H #include #include +//This struct is used by event reader callbacks and event handler callbacks +//as caller data struct struct SEventCallBackData { uint32_t time,type,p1,p2; SEventCallBackData(uint32_t _t,uint32_t _p1,uint32_t _p2,uint32_t _tm){type=_t;p1=_p1;p2=_p2;time=_tm;} }; +//Generic callback function that can be used for hooking the core. +//"userdata" is set when you register the callback function. class IMidiCallBack { public: @@ -14,6 +18,7 @@ class IMidiCallBack virtual void callBack(void* callerdata,void* userdata)=0; virtual ~IMidiCallBack(){} }; +//Main plugin interface. class qmpPluginIntf { public: @@ -24,6 +29,8 @@ class qmpPluginIntf virtual const char* pluginGetName(){return "";} virtual const char* pluginGetVersion(){return "";} }; +//Visualization plugin interface. If your plugin implements a visualization, +//you should implement this interface. class qmpVisualizationIntf { public: @@ -36,7 +43,11 @@ class qmpVisualizationIntf virtual void reset()=0; virtual ~qmpVisualizationIntf(){} }; +#ifdef QMP_MAIN extern "C"{ +#endif +//The API class provided by the core. Plugins use this class to interact with +//the core. class qmpPluginAPI { public: @@ -49,6 +60,9 @@ class qmpPluginAPI virtual uint32_t getCurrentPolyphone(); virtual uint32_t getMaxPolyphone(); virtual uint32_t getCurrentTimeStamp(); + virtual double getPitchBend(int ch); + virtual bool getChannelMask(int ch); + virtual std::string getTitle(); virtual int registerVisualizationIntf(qmpVisualizationIntf* intf); virtual void unregisterVisualizationIntf(int intfhandle); virtual int registerEventReaderIntf(IMidiCallBack* cb,void* userdata); @@ -62,6 +76,13 @@ class qmpPluginAPI virtual void registerOptionString(std::string desc,std::string key,std::string defaultval); virtual std::string getOptionString(std::string key); }; +#ifdef QMP_MAIN } +#endif +//The entry type for the plugin. Your plugin should implement +//qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api) +//as its entry point. A pointer to the core API is also passed to the plugin +//through the parameter. This function should return a pointer to a class +//that implementes the plugin interface (qmpPluginIntf). typedef qmpPluginIntf*(*qmpPluginEntry)(qmpPluginAPI*); #endif // QMPCOREPUBLIC_H -- cgit v1.2.3