From ffd5bf0c99be3e4089886ab4757100474010edb8 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Tue, 5 Apr 2016 23:26:01 +0800 Subject: Butterfly of Isaac the Traveler. --- qmpmainwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'qmpmainwindow.cpp') diff --git a/qmpmainwindow.cpp b/qmpmainwindow.cpp index 3220c13..aad0161 100644 --- a/qmpmainwindow.cpp +++ b/qmpmainwindow.cpp @@ -6,6 +6,9 @@ #include "qmpmainwindow.hpp" #include "ui_qmpmainwindow.h" #include "qmpmidiplay.hpp" +#ifdef _WIN32 +#include +#endif qmpMainWindow* qmpMainWindow::ref=NULL; @@ -181,6 +184,9 @@ void qmpMainWindow::updateWidgets() player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); playerTh=new std::thread(&CMidiPlayer::playerThread,player); +#ifdef _WIN32 + SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); +#endif st=std::chrono::steady_clock::now();offset=0; timer->start(100); } @@ -271,6 +277,9 @@ void qmpMainWindow::on_pbPlayPause_clicked() player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); playerTh=new std::thread(&CMidiPlayer::playerThread,player); +#ifdef _WIN32 + SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); +#endif st=std::chrono::steady_clock::now();offset=0; timer->start(100); stopped=false; @@ -392,6 +401,9 @@ void qmpMainWindow::on_pbPrev_clicked() player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); playerTh=new std::thread(&CMidiPlayer::playerThread,player); +#ifdef _WIN32 + SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); +#endif st=std::chrono::steady_clock::now();offset=0; timer->start(100); } @@ -414,6 +426,9 @@ void qmpMainWindow::on_pbNext_clicked() player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); playerTh=new std::thread(&CMidiPlayer::playerThread,player); +#ifdef _WIN32 + SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); +#endif st=std::chrono::steady_clock::now();offset=0; timer->start(100); } @@ -439,6 +454,9 @@ void qmpMainWindow::selectionChanged() player->setGain(ui->vsMasterVol->value()/250.);efxw->sendEfxChange(); player->setWaitVoice(qmpSettingsWindow::getSettingsIntf()->value("Midi/WaitVoice",1).toInt()); playerTh=new std::thread(&CMidiPlayer::playerThread,player); +#ifdef _WIN32 + SetThreadPriority(playerTh->native_handle(),THREAD_PRIORITY_TIME_CRITICAL); +#endif st=std::chrono::steady_clock::now();offset=0; timer->start(100); } -- cgit v1.2.3