aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiplay.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-15 22:08:35 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2017-01-15 22:08:35 +0800
commit8a0d671e1a77c58142d0cbe82f40ee64bcae2be5 (patch)
treecb7ce958d02f2bb9e00581a56c28120800521a93 /core/qmpmidiplay.cpp
parentb7842ae90b28618affdad6977c9c814aa573a3fe (diff)
downloadQMidiPlayer-8a0d671e1a77c58142d0cbe82f40ee64bcae2be5.tar.xz
A little code refactoring.
Diffstat (limited to 'core/qmpmidiplay.cpp')
-rw-r--r--core/qmpmidiplay.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/core/qmpmidiplay.cpp b/core/qmpmidiplay.cpp
index 1d32501..9cd7782 100644
--- a/core/qmpmidiplay.cpp
+++ b/core/qmpmidiplay.cpp
@@ -211,11 +211,7 @@ void CMidiPlayer::playEvents()
if(resumed)resumed=false;
else
if(sendtime.count()<(midiFile->getEvent(tceptr)->time-ct)*dpt)
-#if _WIN32
- w32usleep((midiFile->getEvent(tceptr)->time-ct)*(dpt/1000));
-#else
std::this_thread::sleep_for(std::chrono::nanoseconds((midiFile->getEvent(tceptr)->time-ct)*dpt-sendtime.count()));
-#endif
if(tcstop||!midiFile)break;
ct=midiFile->getEvent(tceptr)->time;
}
@@ -463,7 +459,7 @@ void CMidiPlayer::setChannelPreset(int ch,int b,int p)
}
//16MSB..LSB1
void CMidiPlayer::setBit(uint16_t &n, uint16_t bn, uint16_t b)
-{n^=(-b^n)&(1<<bn);}
+{n^=(((~b)+1)^n)&(1<<bn);}
void CMidiPlayer::setMute(int ch,bool m)
{setBit(mute,ch,m?1:0);}
void CMidiPlayer::setSolo(int ch,bool s)