aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpchannelswindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-06-18 00:51:29 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-06-18 00:51:29 +0800
commit19c89fc7baa299e523e152a14066ebc8ce23af21 (patch)
tree893d2643b57cb03092ab520b64dabff753437bbc /qmidiplayer-desktop/qmpchannelswindow.cpp
parent795043d6851a355d70aa2341e2edfd526c24d041 (diff)
downloadQMidiPlayer-19c89fc7baa299e523e152a14066ebc8ce23af21.tar.xz
Device initialization file implementation (part 1).
Added UI for external device configuration. Instrument mapping portion of the device intialization file is now working. Fixed a few spots where return value of getChannelPreset() is ignored. Fixed layout of the preset selection dialog.
Diffstat (limited to 'qmidiplayer-desktop/qmpchannelswindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index 5a6a2de..b029e3e 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -156,8 +156,14 @@ void qmpChannelsWindow::channelWindowsUpdate()
char data[128];
std::string nm;
uint16_t b;uint8_t p;
- qmpMainWindow::getInstance()->getPlayer()->getChannelOutputDevice(i)->getChannelPreset(i,&b,&p,nm);
+ CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
+ bool r=plyr->getChannelOutputDevice(i)->getChannelPreset(i,&b,&p,nm);
sprintf(data,"%03d:%03d %s",b,p,nm.c_str());
+ if(!r)
+ {
+ nm=plyr->getChannelOutputDevice(i)->getPresetName(plyr->getCC(i,0)<<7|plyr->getCC(i,32),plyr->getCC(i,128));
+ sprintf(data,"%03d:%03d:%03d %s",plyr->getCC(i,0),plyr->getCC(i,32),plyr->getCC(i,128),nm.c_str());
+ }
if(fused)
{
if(strcmp((ui->twChannels->item(i,4))->