From cf15fde2aa2bcbb244fdfdc46debf457451079f7 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Wed, 13 Mar 2019 17:53:46 +0800 Subject: 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. --- qmidiplayer-desktop/qmppresetselect.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'qmidiplayer-desktop/qmppresetselect.cpp') 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(); -- cgit v1.2.3