aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-11-02 22:13:32 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-11-02 22:13:32 +0800
commitb2ef363f49db70219ac1eaebb7d69dcdade8d60b (patch)
treecfc0e8da88dc27b62578dccbce367736e020f63d /core/qmpmidiplay.hpp
parent23525e2a648a23f099c2b533aa91839a2f8e829f (diff)
downloadQMidiPlayer-b2ef363f49db70219ac1eaebb7d69dcdade8d60b.tar.xz
Keyboard plugin: show additional information on the side.
qmpPluginAPI::registerEventHandler now accepts an optional argument that determines whether the handler is called prior to or after an event is sent.
Diffstat (limited to 'core/qmpmidiplay.hpp')
-rw-r--r--core/qmpmidiplay.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/qmpmidiplay.hpp b/core/qmpmidiplay.hpp
index 4d950fa..c3833a5 100644
--- a/core/qmpmidiplay.hpp
+++ b/core/qmpmidiplay.hpp
@@ -5,6 +5,7 @@
#include <cstdlib>
#include <chrono>
#include <unordered_map>
+#include <tuple>
#include <utility>
#include <vector>
#define QMP_MAIN
@@ -91,7 +92,7 @@ class CMidiPlayer
void* eventHandlerCBuserdata[16];
void* eventReaderCBuserdata[16];
void* fileReadFinishCBuserdata[16];
- std::unordered_map<int,std::pair<callback_t,void*>> event_handlers;
+ std::unordered_map<int,std::tuple<callback_t,void*,bool>> event_handlers;
std::unordered_map<int,std::pair<callback_t,void*>> event_read_handlers;
std::unordered_map<int,std::pair<callback_t,void*>> file_read_finish_hooks;
int event_handlers_id,event_read_handlers_id,file_read_finish_hooks_id;
@@ -163,7 +164,7 @@ class CMidiPlayer
void unsetEventReaderCB(int id);
int setFileReadFinishedCB(ICallBack *cb,void *userdata);
void unsetFileReadFinishedCB(int id);
- int registerEventHandler(callback_t cb,void *userdata);
+ int registerEventHandler(callback_t cb,void *userdata,bool post);
void unregisterEventHandler(int id);
int registerEventReadHandler(callback_t cb,void *userdata);
void unregisterEventReadHandler(int id);