From 19c89fc7baa299e523e152a14066ebc8ce23af21 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 18 Jun 2019 00:51:29 +0800 Subject: 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. --- qmidiplayer-desktop/qmppresetselect.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qmidiplayer-desktop/qmppresetselect.cpp') diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp index a32aa99..6683e49 100644 --- a/qmidiplayer-desktop/qmppresetselect.cpp +++ b/qmidiplayer-desktop/qmppresetselect.cpp @@ -34,6 +34,7 @@ void qmpPresetSelector::setupWindow(int chid) sprintf(name,"Preset Selection - Channel #%d",ch+1); setWindowTitle(name); r=plyr->getChannelOutputDevice(ch)->getChannelPreset(ch,&b,&p,pstname); + if(!r){b=plyr->getCC(ch,0)<<7|plyr->getCC(ch,32);p=plyr->getCC(ch,128);} ui->lwBankSelect->blockSignals(true); ui->lwBankSelect->clear(); ui->lwPresetSelect->clear(); @@ -80,7 +81,14 @@ void qmpPresetSelector::on_pbOk_clicked() { CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer(); if(plyr->getChannelOutput(ch)){ + if(ui->spCustomMSB->isEnabled()) plyr->setChannelPreset(ch,(ui->spCustomMSB->value()<<7)|ui->spCustomLSB->value(),ui->spCustomPC->value()); + else + { + int b=ui->lwBankSelect->currentItem()->text().split(' ').first().toInt(); + int p=ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt(); + plyr->setChannelPreset(ch,b,p); + } } else{ if(!ui->lwBankSelect->currentItem()||!ui->lwPresetSelect->currentItem())return (void)close(); -- cgit v1.2.3