diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-06-18 00:51:29 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-06-18 00:51:29 +0800 |
commit | 19c89fc7baa299e523e152a14066ebc8ce23af21 (patch) | |
tree | 893d2643b57cb03092ab520b64dabff753437bbc /qmidiplayer-desktop/qmppresetselect.cpp | |
parent | 795043d6851a355d70aa2341e2edfd526c24d041 (diff) | |
download | QMidiPlayer-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/qmppresetselect.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmppresetselect.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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(); |