From cd8432e47e1e9b332f2d5682ce4c796a94a29de8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 1 Jul 2019 22:33:53 +0800 Subject: Actually send initialization sequence to external devices. Replace hardcoded initial CC values with values from device property API. --- qmidiplayer-desktop/qmpchanneleditor.cpp | 7 ++++++- qmidiplayer-desktop/qmppresetselect.cpp | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'qmidiplayer-desktop') 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; -- cgit v1.2.3