aboutsummaryrefslogtreecommitdiff
path: root/include/qmpcorepublic.hpp
blob: ad6a165235d819c5d51ec71515b4e3a02000711f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef QMPCOREPUBLIC_H
#define QMPCOREPUBLIC_H
#include <cstdint>
#include <string>
struct SEventCallBackData
{
	uint32_t type,p1,p2;
	SEventCallBackData(uint32_t _t,uint32_t _p1,uint32_t _p2){type=_t;p1=_p1;p2=_p2;}
};
class IMidiCallBack
{
	public:
		IMidiCallBack(){}
		virtual void callBack(void* callerdata,void* userdata)=0;
		virtual ~IMidiCallBack(){}
};
class qmpPluginIntf
{
	public:
		virtual ~qmpPluginIntf(){}
		virtual void init(){}
		virtual void deinit(){}
		virtual const char* pluginGetName(){return "";}
		virtual const char* pluginGetVersion(){return "";}
};
class qmpVisualizationIntf
{
	public:
		virtual void show();
		virtual void close();
};
extern "C"{
class qmpPluginAPI
{
	public:
		uint32_t getDivision();
		uint32_t getRawTempo();
		double getRealTempo();
		uint32_t getTimeSig();
		int getKeySig();
		uint32_t getNoteCount();
		uint32_t getCurrentPolyphone();
		uint32_t getMaxPolyphone();
		uint32_t getCurrentTimeStamp();
		int registerVisualizationIntf(qmpVisualizationIntf* i);
		void unregisterVisualizationIntf(int intfhandle);
		int registerEventReaderIntf(IMidiCallBack* cb,void* userdata);
		void unregisterEventReaderIntf(int intfhandle);
		int registerEventHandlerIntf(IMidiCallBack* cb,void* userdata);
		void unregisterEventHandlerIntf(int intfhandle);
		void registerOptionInt(std::string desc,std::string key,int defaultval);
		int getOptionInt(std::string key);
		void registerOptionDouble(std::string desc,std::string key,double defaultval);
		double getOptionDouble(std::string key);
		void registerOptionString(std::string desc,std::string key,std::string defaultval);
		std::string getOptionString(std::string key);
};
}
typedef qmpPluginIntf*(*qmpPluginEntry)(qmpPluginAPI*);
#endif // QMPCOREPUBLIC_H