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/qmpmainwindow.cpp | |
parent | 8f8782f43bd838e825f3792b611d27fffa90399b (diff) | |
download | QMidiPlayer-2b46ba471830d4e6e22be5afc720adc2489efcfe.tar.xz |
the Awakening of the Evil.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 32d28f2..37ca9f4 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -9,6 +9,7 @@ #ifdef _WIN32 #include <Windows.h> #endif +#define UPDATE_INTERVAL 66 qmpMainWindow* qmpMainWindow::ref=NULL; @@ -188,7 +189,7 @@ void qmpMainWindow::updateWidgets() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } } if(renderTh) @@ -199,7 +200,14 @@ void qmpMainWindow::updateWidgets() ui->centralWidget->setEnabled(true); delete renderTh;renderTh=NULL; player->rendererDeinit(); - if(singleFS){player->fluidPreInitialize();playerSetup();player->fluidInitialize();} + if(singleFS) + { + player->fluidPreInitialize(); + playerSetup(); + player->fluidInitialize(); + for(int i=settingsw->getSFWidget()->count()-1;i>=0;--i) + player->pushSoundFont(settingsw->getSFWidget()->item(i)->text().toStdString().c_str()); + } } } while(!player->isFinished()&&player->getTCeptr()>player->getStamp(ui->hsTimer->value()) @@ -281,7 +289,7 @@ void qmpMainWindow::on_pbPlayPause_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); stopped=false; } else @@ -405,7 +413,7 @@ void qmpMainWindow::on_pbPrev_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::on_pbNext_clicked() @@ -430,7 +438,7 @@ void qmpMainWindow::on_pbNext_clicked() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::selectionChanged() @@ -458,7 +466,7 @@ void qmpMainWindow::selectionChanged() SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); #endif st=std::chrono::steady_clock::now();offset=0; - timer->start(100); + timer->start(UPDATE_INTERVAL); } void qmpMainWindow::on_pbEfx_clicked() @@ -495,7 +503,7 @@ void qmpMainWindow::onfnA2() ui->centralWidget->setEnabled(false); for(int i=settingsw->getSFWidget()->count()-1;i>=0;--i) player->pushSoundFont(settingsw->getSFWidget()->item(i)->text().toStdString().c_str()); - player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange();timer->start(100); + player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange();timer->start(UPDATE_INTERVAL); renderTh=new std::thread(&CMidiPlayer::rendererThread,player); } |