diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-04-08 23:49:24 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-04-08 23:49:24 +0800 |
commit | 2b46ba471830d4e6e22be5afc720adc2489efcfe (patch) | |
tree | 8445440ba0204a67d1cb49185297a49e326dc9ab /qmidiplayer-desktop/qmpsettingswindow.cpp | |
parent | 8f8782f43bd838e825f3792b611d27fffa90399b (diff) | |
download | QMidiPlayer-2b46ba471830d4e6e22be5afc720adc2489efcfe.tar.xz |
the Awakening of the Evil.
Diffstat (limited to 'qmidiplayer-desktop/qmpsettingswindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpsettingswindow.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp index c2e31a2..2074972 100644 --- a/qmidiplayer-desktop/qmpsettingswindow.cpp +++ b/qmidiplayer-desktop/qmpsettingswindow.cpp @@ -82,7 +82,7 @@ void qmpSettingsWindow::settingsInit() settings->setValue("Audio/Driver",ui->cbAudioDrv->currentText()); #ifdef _WIN32 -#define DefBufSize 8192 +#define DefBufSize 256 #else #define DefBufSize 128 #endif @@ -97,15 +97,21 @@ void qmpSettingsWindow::settingsInit() settings->setValue("Audio/BufSize",ui->cbBufSize->currentText().toInt()); #undef DefBufSize +#ifdef _WIN32 +#define DefBufCnt 8 +#else +#define DefBufCnt 2 +#endif selected=-1; for(int i=0;i<ui->cbBufCnt->count();++i) - if(ui->cbBufCnt->itemText(i).toInt()==settings->value("Audio/BufCnt",2).toInt()) + if(ui->cbBufCnt->itemText(i).toInt()==settings->value("Audio/BufCnt",DefBufCnt).toInt()) {selected=i;break;} if(~selected)ui->cbBufCnt->setCurrentIndex(selected); - else if(settings->value("Audio/BufCnt",2).toInt()>=2&&settings->value("Audio/BufCnt",2).toInt()<=64) - ui->cbBufCnt->setCurrentText(settings->value("Audio/BufCnt",2).toString()); - else ui->cbBufCnt->setCurrentText("2"); + else if(settings->value("Audio/BufCnt",DefBufCnt).toInt()>=2&&settings->value("Audio/BufCnt",DefBufCnt).toInt()<=64) + ui->cbBufCnt->setCurrentText(settings->value("Audio/BufCnt",DefBufCnt).toString()); + else ui->cbBufCnt->setCurrentText(QString::number(DefBufCnt)); settings->setValue("Audio/BufCnt",ui->cbBufCnt->currentText().toInt()); +#undef DefBufCnt selected=-1; for(int i=0;i<ui->cbFormat->count();++i) |