aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-01-25 22:44:17 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-01-25 22:44:17 +0800
commit4d9b1e98f4f3cd7387491ba1cc883230302a9022 (patch)
tree7147e208bdab4356e317cb46ea4958de23f6800f /qmidiplayer-desktop
parent003c637ef40e1826b7c829afbfba82ea028e21a5 (diff)
downloadQMidiPlayer-4d9b1e98f4f3cd7387491ba1cc883230302a9022.tar.xz
Fixed a crash caused by improper preset probing.
Further ensure CC#8 is initialized correctly. Minor string table update.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r--qmidiplayer-desktop/qmpchannelswindow.cpp2
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp2
-rw-r--r--qmidiplayer-desktop/qmpplugin.cpp6
-rw-r--r--qmidiplayer-desktop/qmppresetselect.cpp2
-rw-r--r--qmidiplayer-desktop/qmpsettingswindow.ui4
5 files changed, 8 insertions, 8 deletions
diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp
index c154383..87eae10 100644
--- a/qmidiplayer-desktop/qmpchannelswindow.cpp
+++ b/qmidiplayer-desktop/qmpchannelswindow.cpp
@@ -148,7 +148,7 @@ void qmpChannelsWindow::channelWindowsUpdate()
}
for(int i=0;i<16;++i)
{
- char data[128],nm[25];
+ char data[128],nm[256];
int b,p;
qmpMainWindow::getInstance()->getPlayer()->getChannelPreset(i,&b,&p,nm);
sprintf(data,"%03d:%03d %s",b,p,nm);
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index c83152c..adbd6d5 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -309,7 +309,7 @@ void qmpMainWindow::playerSetup(IFluidSettings* fs)
fs->setOptInt("audio.period-size",settings->value("Audio/BufSize","").toInt());
fs->setOptInt("audio.periods",settings->value("Audio/BufCnt","").toInt());
fs->setOptStr("audio.sample-format",settings->value("Audio/Format","").toString().toStdString().c_str());
- fs->setOptInt("synth.sample-rate",settings->value("Audio/Frequency","").toInt());
+ fs->setOptNum("synth.sample-rate",settings->value("Audio/Frequency","").toInt());
fs->setOptInt("synth.polyphony",settings->value("Audio/Polyphony","").toInt());
fs->setOptInt("synth.cpu-cores",settings->value("Audio/Threads","").toInt());
char bsmode[4];
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp
index 7ef31f3..13d5730 100644
--- a/qmidiplayer-desktop/qmpplugin.cpp
+++ b/qmidiplayer-desktop/qmpplugin.cpp
@@ -153,7 +153,7 @@ int qmpPluginAPI::getChannelCC(int ch,int cc)
{return qmw&&qmw->getPlayer()?qmw->getPlayer()->getCC(ch,cc):0;}
int qmpPluginAPI::getChannelPreset(int ch)
{
- int b,p;char nm[25];
+ int b,p;char nm[256];
if(qmw&&qmw->getPlayer())
{
qmw->getPlayer()->getChannelPreset(ch,&b,&p,nm);
@@ -173,11 +173,11 @@ std::wstring qmpPluginAPI::getWTitle()
{return qmw?qmw->getWTitle():L"";}
std::string qmpPluginAPI::getChannelPresetString(int ch)
{
- int b,p;char nm[25],ret[33];ret[0]=0;
+ int b,p;char nm[256],ret[320];ret[0]=0;
if(qmw&&qmw->getPlayer())
{
qmw->getPlayer()->getChannelPreset(ch,&b,&p,nm);
- sprintf(ret,"%03d:%03d %s",b,p,nm);
+ snprintf(ret,320,"%03d:%03d %s",b,p,nm);
}
return std::string(ret);
}
diff --git a/qmidiplayer-desktop/qmppresetselect.cpp b/qmidiplayer-desktop/qmppresetselect.cpp
index 57dbe7f..87071f4 100644
--- a/qmidiplayer-desktop/qmppresetselect.cpp
+++ b/qmidiplayer-desktop/qmppresetselect.cpp
@@ -40,7 +40,7 @@ void qmpPresetSelector::setupWindow(int chid)
{
CMidiPlayer *plyr=qmpMainWindow::getInstance()->getPlayer();
if(!plyr->fluid()->getSFCount())return;
- ch=chid;int b=0,p=0,r;char name[64];
+ ch=chid;int b=0,p=0,r;char name[256];
sprintf(name,"Preset Selection - Channel #%d",ch+1);
setWindowTitle(name);
plyr->getChannelPreset(chid,&b,&p,name);
diff --git a/qmidiplayer-desktop/qmpsettingswindow.ui b/qmidiplayer-desktop/qmpsettingswindow.ui
index bbeddd4..dc9a8b0 100644
--- a/qmidiplayer-desktop/qmpsettingswindow.ui
+++ b/qmidiplayer-desktop/qmpsettingswindow.ui
@@ -252,7 +252,7 @@
<item row="4" column="0">
<widget class="QLabel" name="lbFrequency">
<property name="text">
- <string>Audio Frequency</string>
+ <string>Sample Rate</string>
</property>
</widget>
</item>
@@ -347,7 +347,7 @@
<item row="3" column="0">
<widget class="QLabel" name="lbFormat">
<property name="text">
- <string>Audio Format</string>
+ <string>Sample Format</string>
</property>
</widget>
</item>