aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmppresetselect.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-13 17:53:46 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-13 17:53:46 +0800
commitcf15fde2aa2bcbb244fdfdc46debf457451079f7 (patch)
tree3d63d296f0fbd45fcd128b1c8006cb8de5bc4353 /qmidiplayer-desktop/qmppresetselect.cpp
parentfb5c0155fdff917a1f1816c7afbf00a076c54156 (diff)
downloadQMidiPlayer-cf15fde2aa2bcbb244fdfdc46debf457451079f7.tar.xz
Set preset bank correctly in XG mode.
Removed High DPI handling code. Good luck to Windows users out there. Skulpture style: dials are no longer blurred if scaled.
Diffstat (limited to 'qmidiplayer-desktop/qmppresetselect.cpp')
-rw-r--r--qmidiplayer-desktop/qmppresetselect.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp
index 87071f4..8afea2b 100644
--- a/qmidiplayer-desktop/qmppresetselect.cpp
+++ b/qmidiplayer-desktop/qmppresetselect.cpp
@@ -8,8 +8,6 @@ qmpPresetSelector::qmpPresetSelector(QWidget *parent) :
ui(new Ui::qmpPresetSelector)
{
ui->setupUi(this);
- int w=size().width(),h=size().height();w=w*(logicalDpiX()/96.);h=h*(logicalDpiY()/96.);
- setMaximumWidth(w);setMaximumHeight(h);setMinimumWidth(w);setMinimumHeight(h);
}
qmpPresetSelector::~qmpPresetSelector()
@@ -88,13 +86,17 @@ void qmpPresetSelector::on_pbOk_clicked()
CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
if(plyr->getChannelOutput(ch)){
plyr->setChannelPreset(ch,(ui->spCustomMSB->value()<<7)|ui->spCustomLSB->value(),ui->spCustomPC->value());
- //plyr->setCC(ch,0,ui->spCustomMSB->value());
- //plyr->setCC(ch,32,ui->spCustomLSB->value());
}
else{
if(!ui->lwBankSelect->currentItem()||!ui->lwPresetSelect->currentItem())return (void)close();
- int b,p;sscanf(ui->lwBankSelect->currentItem()->text().toStdString().c_str(),"%d",&b);
- sscanf(ui->lwPresetSelect->currentItem()->text().toStdString().c_str(),"%d",&p);
+ int b,p;
+ b=ui->lwBankSelect->currentItem()->text().toInt();
+ p=ui->lwPresetSelect->currentItem()->text().split(' ').first().toInt();
+ QString s=qmpSettingsWindow::getSettingsIntf()->value("Audio/BankSelect","CC#0").toString();
+ if(s=="CC#32"){
+ if(b==128)b=127<<7;
+ }
+ else if(s=="CC#0")b<<=7;
plyr->setChannelPreset(ch,b,p);
}
close();