void MPlayer::play_pause(bool p) { if (isPlaying()) { pause(p); } else { mPlay(); } }
int _main() { mPlay(&tune); while (1) { mGetData(&lastplayed,1,500); printf("channel: %d, note: %d, velocity: %d\n",lastplayed.chan,lastplayed.note,lastplayed.vel); Sleep(100); if (GetAsyncKeyState(VK_ESCAPE)) { mStop(); ExitProcess(0); } } }