diff options
author | Chris Xiong <chirs241097@gmail.com> | 2017-02-10 00:00:57 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2017-02-10 00:00:57 +0800 |
commit | 70f0007154992c0bc89e11af4fe7dcc2c493aac3 (patch) | |
tree | 67e673820a3be04ccb2aca6fb29ed2e2a9578af8 /core | |
parent | 620aad63042e0f397ea6691fe92ac40fcc6b6fed (diff) | |
download | QMidiPlayer-70f0007154992c0bc89e11af4fe7dcc2c493aac3.tar.xz |
Fix building on Windows.
Behavior changes:
1. DnD into the main window now causes the dropped
file to play.
2. Switch back to w32usleep to increase bpm accuracy.
3. Scan for plugins in application folder (in Windows),
not in the working directory.
Diffstat (limited to 'core')
-rw-r--r-- | core/qmpmidiplay.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp index 76c7d16..0bb73f9 100644 --- a/core/qmpmidiplay.cpp +++ b/core/qmpmidiplay.cpp @@ -212,7 +212,11 @@ void CMidiPlayer::playEvents() if(resumed)resumed=false; else if(sendtime.count()<(midiReaders->getEvent(tceptr)->time-ct)*dpt) +#ifdef _WIN32 + w32usleep(((midiReaders->getEvent(tceptr)->time-ct)*dpt-sendtime.count())/1000); +#else std::this_thread::sleep_for(std::chrono::nanoseconds((midiReaders->getEvent(tceptr)->time-ct)*dpt-sendtime.count())); +#endif if(tcstop||!midiReaders)break; ct=midiReaders->getEvent(tceptr)->time; } @@ -278,6 +282,8 @@ CMidiPlayer::CMidiPlayer(bool singleInst) memset(eventHandlerCBuserdata,0,sizeof(eventHandlerCBuserdata)); memset(eventReaderCB,0,sizeof(eventReaderCB)); memset(eventReaderCBuserdata,0,sizeof(eventReaderCBuserdata)); + memset(fileReadFinishCB,0,sizeof(fileReadFinishCB)); + memset(fileReadFinishCBuserdata,0,sizeof(fileReadFinishCBuserdata)); memset(mappedoutput,0,sizeof(mappedoutput)); memset(deviceusage,0,sizeof(deviceusage)); mapper=new qmpMidiMapperRtMidi(); |