aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-07-01 22:33:53 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-07-01 22:33:53 +0800
commitcd8432e47e1e9b332f2d5682ce4c796a94a29de8 (patch)
tree9091d98efe995bcd11439115200f02d3083c07be /qmidiplayer-desktop
parenteb82292b5d8818a5ef1a0c92e35390bd4e22674e (diff)
downloadQMidiPlayer-cd8432e47e1e9b332f2d5682ce4c796a94a29de8.tar.xz
Actually send initialization sequence to external devices.
Replace hardcoded initial CC values with values from device property API.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r--qmidiplayer-desktop/qmpchanneleditor.cpp7
-rw-r--r--qmidiplayer-desktop/qmppresetselect.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/qmpchanneleditor.cpp b/qmidiplayer-desktop/qmpchanneleditor.cpp
index 71dd455..fbe3d50 100644
--- a/qmidiplayer-desktop/qmpchanneleditor.cpp
+++ b/qmidiplayer-desktop/qmpchanneleditor.cpp
@@ -26,7 +26,12 @@ void qmpChannelEditor::setupWindow(int chid)
setWindowTitle(tr("Channel Parameter Editor - Channel #%1").arg(ch+1));
CMidiPlayer* player=qmpMainWindow::getInstance()->getPlayer();
uint16_t b;uint8_t p;std::string pstn;
- player->getChannelOutputDevice(ch)->getChannelPreset(ch,&b,&p,pstn);
+ if(!player->getChannelOutputDevice(ch)->getChannelPreset(ch,&b,&p,pstn))
+ {
+ b=player->getCC(ch,0)<<7|player->getCC(ch,32);
+ p=player->getCC(ch,128);
+ pstn=player->getChannelOutputDevice(ch)->getPresetName(b,p);
+ }
ui->lbPresetName->setText(pstn.c_str());
sprintf(str,"BK: %03d",b);ui->lbBank->setText(str);
sprintf(str,"PC: %03d",p);ui->lbPreset->setText(str);
diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp
index 6683e49..578ae1d 100644
--- a/qmidiplayer-desktop/qmppresetselect.cpp
+++ b/qmidiplayer-desktop/qmppresetselect.cpp
@@ -112,7 +112,6 @@ void qmpPresetSelector::on_lwPresetSelect_itemDoubleClicked()
void qmpPresetSelector::on_lwBankSelect_currentRowChanged()
{
- fprintf(stderr,"bs cr changed\n");
ui->lwPresetSelect->clear();
if(!ui->lwBankSelect->currentItem())return;
char name[256];int b;