aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp4
-rw-r--r--qmidiplayer-desktop/qmpplugin.cpp12
2 files changed, 11 insertions, 5 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index 13f2c8d..41f545e 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -22,7 +22,7 @@ qmpChannelsModel::qmpChannelsModel(QObject*parent):QAbstractTableModel(parent)
QMetaObject::invokeMethod(this, &qmpChannelsModel::updateChannelActivity, Qt::ConnectionType::QueuedConnection);
}
}
- ,nullptr);
+ ,nullptr,false);
QTimer*t=new QTimer(this);
t->setInterval(500);
t->setSingleShot(false);
@@ -267,7 +267,7 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) :
if((e->type&0xF0)==0x90&&e->p2>0&&(e->flags&0x01))
emit this->noteOn();
}
- ,nullptr);
+ ,nullptr,false);
std::vector<std::string> devs=qmpMainWindow::getInstance()->getPlayer()->getMidiOutDevices();
size_t devc=devs.size();
std::set<std::string> devset;
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp
index fd79b16..774f0da 100644
--- a/qmidiplayer-desktop/qmpplugin.cpp
+++ b/qmidiplayer-desktop/qmpplugin.cpp
@@ -179,7 +179,13 @@ std::string qmpPluginAPI::getChannelPresetString(int ch)
std::string nm;
if(qmw&&qmw->getPlayer())
{
- qmw->getPlayer()->getChannelOutputDevice(ch)->getChannelPreset(ch,&b,&p,nm);
+ int r=qmw->getPlayer()->getChannelOutputDevice(ch)->getChannelPreset(ch,&b,&p,nm);
+ if(!r)
+ {
+ b=qmw->getPlayer()->getCC(ch,0)<<7|qmw->getPlayer()->getCC(ch,32);
+ p=qmw->getPlayer()->getCC(ch,128);
+ nm=qmw->getPlayer()->getChannelOutputDevice(ch)->getPresetName(b,p);
+ }
snprintf(ret,320,"%03d:%03d %s",b,p,nm.c_str());
}
return std::string(ret);
@@ -223,8 +229,8 @@ void qmpPluginAPI::registerFileReader(qmpFileReader* reader,std::string name)
{qmw->getPlayer()->registerReader(reader,name);}
void qmpPluginAPI::unregisterFileReader(std::string name)
{qmw->getPlayer()->unregisterReader(name);}
-int qmpPluginAPI::registerEventHandler(callback_t cb,void *userdata)
-{return qmw->getPlayer()->registerEventHandler(cb,userdata);}
+int qmpPluginAPI::registerEventHandler(callback_t cb,void *userdata,bool post)
+{return qmw->getPlayer()->registerEventHandler(cb,userdata,post);}
void qmpPluginAPI::unregisterEventHandler(int id)
{qmw->getPlayer()->unregisterEventHandler(id);}
int qmpPluginAPI::registerEventReadHandler(callback_t cb,void *userdata)