void PC_StopPause(struct Tracker_Windows *window){ R_ASSERT(THREADING_is_main_thread()); g_pausing_level--; if (g_pausing_level < 0){ R_ASSERT(g_pausing_level < 0); g_pausing_level = 0; } //printf(" Leaving pause %d\n", g_pausing_level); if (g_pausing_level>0) return; if (window==NULL) window = root->song->tracker_windows; if (g_was_playing) { if (g_was_playing_range) PlayRangeCurrPos(window); else if (g_playtype==PLAYSONG) PlaySongCurrPos(window); else if (g_playtype==PLAYBLOCK) PlayBlockCurrPos(window); } }
// called very often static void PlayHandleRangeLoop(void){ struct Blocks *block = pc->block; if (pc->is_playing_range == false || block==NULL) return; //printf("duration: %d\nrealtime: %d\n\n", (int)duration, (int)pc->therealtime); STime start_therealtime = pc->therealtime; if (start_therealtime >= pc->range_duration/block->reltempo) { PlayRangeCurrPos(root->song->tracker_windows); int counter = 0; while (pc->therealtime == start_therealtime && counter < 50){ // Wait for the player to start up. OS_WaitForAShortTime(20); counter++; } } }
void playRangeFromCurrent(int windownum){ struct Tracker_Windows *window=getWindowFromNum(windownum); if(window==NULL) return; PlayRangeCurrPos(window); }