From 6015dccd4a839d46749a3bf7c0e45263ac8870ca Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 19 Mar 2016 11:53:26 +0800 Subject: Fairy Wars. --- ChangeLog | 4 ++++ qmpmidiplay.cpp | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c352ce8..4410a5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-03-19 0.7.0 beta +Minor changes on w32usleep... +Sync with the Windows build. + 2016-02-28 0.7.0 beta RPN pitch bend range handling. Added an option to disable waiting for remaining voices before stopping. diff --git a/qmpmidiplay.cpp b/qmpmidiplay.cpp index ebbf36e..8da2963 100644 --- a/qmpmidiplay.cpp +++ b/qmpmidiplay.cpp @@ -5,6 +5,7 @@ #include "qmpmidiplay.hpp" #ifdef _WIN32 #include +uint64_t pf; #endif void CMidiPlayer::fluidPreInitialize() { @@ -144,15 +145,14 @@ void CMidiPlayer::processEventStub(const SEvent *e) #ifdef _WIN32 void w32usleep(uint64_t t) { - uint64_t st=0,ct=0,f=0; - QueryPerformanceFrequency((LARGE_INTEGER*)&f); + uint64_t st=0,ct=0; QueryPerformanceCounter((LARGE_INTEGER*)&st); do{ - if(t>10000+(ct-st)*1000000/f)Sleep((t-(ct-st)*1000000/f)/2000); - else if(t>5000+(ct-st)*1000000/f)Sleep(1); + if(t>10000+(ct-st)*1000000/pf)Sleep((t-(ct-st)*1000000/pf)/2000); + else if(t>5000+(ct-st)*1000000/pf)Sleep(1); else std::this_thread::yield(); QueryPerformanceCounter((LARGE_INTEGER*)&ct); - }while((ct-st)*1000000