aboutsummaryrefslogtreecommitdiff
path: root/qmpmainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-05 23:26:01 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-05 23:26:01 +0800
commitffd5bf0c99be3e4089886ab4757100474010edb8 (patch)
treea6918b4e8d480690bee835f4f994907b9721b617 /qmpmainwindow.cpp
parent45c5116353986d13f886ff7398dcb34b878c6cea (diff)
downloadQMidiPlayer-ffd5bf0c99be3e4089886ab4757100474010edb8.tar.xz
Butterfly of Isaac the Traveler.
Diffstat (limited to 'qmpmainwindow.cpp')
-rw-r--r--qmpmainwindow.cpp18
1 files changed, 18 insertions, 0 deletions
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 <Windows.h>
+#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);
}