aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpplugin.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-24 23:47:04 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-24 23:47:04 +0800
commit800a0417e9ed175f220c472842a283202c77060b (patch)
tree6609fcccf55d176d8eb61aa69526a19ba1859487 /qmidiplayer-desktop/qmpplugin.cpp
parentaa8af83ff8889aa136e9152b2cca9a88d99c5f47 (diff)
downloadQMidiPlayer-800a0417e9ed175f220c472842a283202c77060b.tar.xz
Problematic commit...
Diffstat (limited to 'qmidiplayer-desktop/qmpplugin.cpp')
-rw-r--r--qmidiplayer-desktop/qmpplugin.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp
index 4da1698..559b575 100644
--- a/qmidiplayer-desktop/qmpplugin.cpp
+++ b/qmidiplayer-desktop/qmpplugin.cpp
@@ -4,6 +4,7 @@
#include <dlfcn.h>
#include <dirent.h>
#endif
+#include <cstdio>
#include <cstring>
#include "qmpplugin.hpp"
#include "qmpmainwindow.hpp"
@@ -53,6 +54,38 @@ qmpPluginManager::~qmpPluginManager()
{
qmw=NULL;qsw=NULL;
}
+void qmpPluginManager::initPlugins()
+{
+ for(unsigned i=0;i<plugins.size();++i)
+ {
+ printf("Loaded plugin: %s\n",plugins[i].path.c_str());
+ plugins[i].interface->init();
+ }
+}
uint32_t qmpPluginAPI::getDivision()
{return qmw->getPlayer()->getDivision();}
+uint32_t qmpPluginAPI::getRawTempo()
+{return qmw->getPlayer()->getRawTempo();}
+double qmpPluginAPI::getRealTempo()
+{return qmw->getPlayer()->getTempo();}
+uint32_t qmpPluginAPI::getTimeSig()
+{int n,d=0,t;qmw->getPlayer()->getCurrentTimeSignature(&n,&t);for(;t>>=1;++d);return n<<8|d;}
+int qmpPluginAPI::getKeySig()
+{return qmw->getPlayer()->getCurrentKeySignature();}
+uint32_t qmpPluginAPI::getNoteCount()
+{return qmw->getPlayer()->getFileNoteCount();}
+uint32_t qmpPluginAPI::getCurrentPolyphone()
+{return qmw->getPlayer()->getPolyphone();}
+uint32_t qmpPluginAPI::getMaxPolyphone()
+{return qmw->getPlayer()->getMaxPolyphone();}
+uint32_t qmpPluginAPI::getCurrentTimeStamp()
+{return qmw->getPlayer()->getTCeptr();}
+int qmpPluginAPI::registerEventHandlerIntf(IMidiCallBack *cb,void *userdata)
+{return qmw->getPlayer()->setEventHandlerCB(cb,userdata);}
+void qmpPluginAPI::unregisterEventHandlerIntf(int intfhandle)
+{qmw->getPlayer()->unsetEventHandlerCB(intfhandle);}
+int qmpPluginAPI::registerEventReaderIntf(IMidiCallBack *cb,void *userdata)
+{return qmw->getPlayer()->setEventReaderCB(cb,userdata);}
+void qmpPluginAPI::unregisterEventReaderIntf(int intfhandle)
+{qmw->getPlayer()->unsetEventReaderCB(intfhandle);}