diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-05-06 23:43:01 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-05-06 23:43:01 +0800 |
commit | 909cfe195ae2f6058a03875123f1e80f2a3fa0fa (patch) | |
tree | 9a6fcc0fa6390b8f503881999e4f08a8cd650c49 /qmidiplayer-desktop/qmpplugin.cpp | |
parent | 8da0f5c82fb91c2731cd2e90a875fe92c6557407 (diff) | |
download | QMidiPlayer-909cfe195ae2f6058a03875123f1e80f2a3fa0fa.tar.xz |
Use new SMELT rendering API for notes drawing.
Deinitialize classes in a correct order to avoid crashes.
Add background image option.
Add FPS-related options.
Use QLineEdit instead of QPlainTextEdit for strings.
Diffstat (limited to 'qmidiplayer-desktop/qmpplugin.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index f014902..b05ca0c 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -9,7 +9,7 @@ #include "qmpplugin.hpp" #include "qmpmainwindow.hpp" #include "qmpsettingswindow.hpp" -qmpPluginAPI pluginAPI; +qmpPluginAPI* pluginAPI; qmpMainWindow* qmw; qmpSettingsWindow* qsw; #ifdef _WIN32 @@ -48,7 +48,7 @@ void qmpPluginManager::scanPlugins() void* hndi=dlsym(hso,"qmpPluginGetInterface"); if(!hndi)continue; qmpPluginEntry e=(qmpPluginEntry)hndi; - qmpPluginIntf* intf=e(&pluginAPI); + qmpPluginIntf* intf=e(pluginAPI); plugins.push_back(qmpPlugin(std::string(intf->pluginGetName()),std::string(intf->pluginGetVersion()),std::string(cpluginpaths[i]),intf)); } } @@ -57,11 +57,16 @@ qmpPluginManager::qmpPluginManager() { qmw=qmpMainWindow::getInstance(); qsw=qmw->getSettingsWindow(); + pluginAPI=new qmpPluginAPI(); } qmpPluginManager::~qmpPluginManager() { - for(unsigned i=0;i<plugins.size();++i)delete plugins[i].interface; - qmw=NULL;qsw=NULL; + for(unsigned i=0;i<plugins.size();++i) + { + if(plugins[i].enabled)plugins[i].interface->deinit(); + delete plugins[i].interface; + } + qmw=NULL;qsw=NULL;delete pluginAPI; } std::vector<qmpPlugin> *qmpPluginManager::getPlugins() { @@ -82,6 +87,8 @@ void qmpPluginManager::deinitPlugins() plugins[i].interface->deinit(); } +qmpPluginAPI::~qmpPluginAPI(){} + uint32_t qmpPluginAPI::getDivision() {return qmw&&qmw->getPlayer()?qmw->getPlayer()->getDivision():0;} uint32_t qmpPluginAPI::getRawTempo() |