aboutsummaryrefslogtreecommitdiff
path: root/qmpsettingswindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-31 21:03:23 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-01-31 21:03:23 +0800
commit20283f4c5629f659d05ba18475492c43163bb16e (patch)
tree34d2b63da62b730ff37f9a84efc23baf6e0329b5 /qmpsettingswindow.cpp
parent24481b4334db3c45041db53503a7b6832deb704f (diff)
downloadQMidiPlayer-20283f4c5629f659d05ba18475492c43163bb16e.tar.xz
Waltzing Matilda.
Diffstat (limited to 'qmpsettingswindow.cpp')
-rw-r--r--qmpsettingswindow.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/qmpsettingswindow.cpp b/qmpsettingswindow.cpp
index 622093e..5058496 100644
--- a/qmpsettingswindow.cpp
+++ b/qmpsettingswindow.cpp
@@ -78,15 +78,21 @@ void qmpSettingsWindow::settingsInit()
if(~selected)ui->cbAudioDrv->setCurrentIndex(selected);
settings->setValue("Audio/Driver",ui->cbAudioDrv->currentText());
+#ifdef WIN32
+#define DefBufSize 8192
+#else
+#define DefBufSize 128
+#endif
selected=-1;
for(int i=0;i<ui->cbBufSize->count();++i)
- if(ui->cbBufSize->itemText(i).toInt()==settings->value("Audio/BufSize",128).toInt())
+ if(ui->cbBufSize->itemText(i).toInt()==settings->value("Audio/BufSize",DefBufSize).toInt())
{selected=i;break;}
if(~selected)ui->cbBufSize->setCurrentIndex(selected);
- else if(settings->value("Audio/BufSize",128).toInt()>=64&&settings->value("Audio/BufSize",128).toInt()<=8192)
- ui->cbBufSize->setCurrentText(settings->value("Audio/BufSize",128).toString());
- else ui->cbBufSize->setCurrentText("128");
+ else if(settings->value("Audio/BufSize",DefBufSize).toInt()>=64&&settings->value("Audio/BufSize",DefBufSize).toInt()<=8192)
+ ui->cbBufSize->setCurrentText(settings->value("Audio/BufSize",DefBufSize).toString());
+ else ui->cbBufSize->setCurrentText(QString::number(DefBufSize));
settings->setValue("Audio/BufSize",ui->cbBufSize->currentText().toInt());
+#undef DefBufSize
selected=-1;
for(int i=0;i<ui->cbBufCnt->count();++i)