void PauseMIDI() { // flush our callback control VESARegisterTimer(255, 0, 0); // wait on the user... printf("Song Now Paused!\n"); while (!kbhit()) KeepActive(); getch(); // set the tempo & let'er rip! SetSongTempo(micros, sigdenom); }
void RigidBody::UpdatePosRotFromPlaceable() { URHO3D_PROFILE(RigidBody_UpdatePosRotFromPlaceable); Placeable* placeable = impl->placeable; if (!placeable || !impl->body) return; float3 position = placeable->WorldPosition(); Quat orientation = placeable->WorldOrientation(); btTransform& worldTrans = impl->body->getWorldTransform(); worldTrans.setOrigin(position); worldTrans.setRotation(orientation); // When we forcibly set the physics transform, also set the interpolation transform to prevent jerky motion btTransform interpTrans = impl->body->getInterpolationWorldTransform(); interpTrans.setOrigin(worldTrans.getOrigin()); interpTrans.setRotation(worldTrans.getRotation()); impl->body->setInterpolationWorldTransform(interpTrans); KeepActive(); }
int UpdateMIDI() { int n; int maxticks, ticks; int NotHalted; long l; int trk, deadcnt; int all, nxt; KeepActive(); // Callbacks occur to give us a tempo for MIDI timing if (CallBackOccured) { ReportCallback(); CallBackOccured--; // if we have run out of data, exit the program... deltacount += deltastep; while (1) { // find the track with the lowest delta time deadcnt = 0; for (nxt = n = 0; n < mhdr.ftracks; n++) { if (mtrk[n].mt.flen > 0) { if (mtrk[n].delta < mtrk[nxt].delta) nxt = n; } else { deadcnt++; if (nxt == n) nxt++; } } // if all tracks are dead, exit if (deadcnt >= mhdr.ftracks) { return 1; } // if higher that the current delta count, exit if (mtrk[nxt].delta > deltacount) break; ProcessMidiMsg(&mtrk[nxt]); } } // blast through the file for debugging purposes. Not for normal use if (Breakneckspeed) CallBackOccured++; MIDIEndFrame(); return 0; }