aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmppresetselect.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-07 16:57:57 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-07 16:57:57 -0500
commita42be43a3aa5e1494267f3ae93d70a37afe48673 (patch)
tree73f37a5d4a1029eabcbbf0b8637bda91b1d08e1b /qmidiplayer-desktop/qmppresetselect.cpp
parent9bb221706e9a45343eeb69401b9f50605aab5c1a (diff)
downloadQMidiPlayer-a42be43a3aa5e1494267f3ae93d70a37afe48673.tar.xz
Stop using MIDI messages for selecting presets used by fluidsynth.
Diffstat (limited to 'qmidiplayer-desktop/qmppresetselect.cpp')
-rw-r--r--qmidiplayer-desktop/qmppresetselect.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp
index 1eb5282..973cf30 100644
--- a/qmidiplayer-desktop/qmppresetselect.cpp
+++ b/qmidiplayer-desktop/qmppresetselect.cpp
@@ -82,34 +82,14 @@ void qmpPresetSelector::on_pbCancel_clicked()
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
- {
- if (!ui->lwBankSelect->currentItem() || !ui->lwPresetSelect->currentItem())
- return (void)close();
- int b = ui->lwBankSelect->currentItem()->text().split(' ').first().toInt();
- int p = ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt();
- plyr->setChannelPreset(ch, b, p);
- }
- }
+ if (ui->spCustomMSB->isEnabled())
+ plyr->setChannelPreset(ch, (ui->spCustomMSB->value() << 7) | ui->spCustomLSB->value(), ui->spCustomPC->value());
else
{
if (!ui->lwBankSelect->currentItem() || !ui->lwPresetSelect->currentItem())
return (void)close();
- int b, p;
- b = ui->lwBankSelect->currentItem()->text().toInt();
- p = ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt();
- std::string s = qmpMainWindow::getInstance()->getSettings()->getOptionEnumIntOptName("FluidSynth/BankSelect");
- if (s == "XG")
- {
- if (b == 128)
- b = 127 << 7;
- }
- else if (s == "GS")
- b <<= 7;
+ int b = ui->lwBankSelect->currentItem()->text().split(' ').first().toInt();
+ int p = ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt();
plyr->setChannelPreset(ch, b, p);
}
qmpMainWindow::getInstance()->invokeCallback("preset.set", nullptr);