Ejemplo n.º 1
0
Archivo: songs.c Proyecto: paud/d2x-xl
//this should be called regularly to check for redbook restart
void songs_check_redbook_repeat()
{
	static fix last_check_time;
	fix current_time;

	if (!gameStates.sound.bRedbookPlaying || gameConfig.nRedbookVolume==0) return;

	current_time = TimerGetFixedSeconds();
	if (current_time < last_check_time || (current_time - last_check_time) >= F2_0) {
		if (!RBAPeekPlayStatus()) {
			StopTime();
			// if title ends, start credit music
			// if credits music ends, restart it
			if (gameStates.sound.bRedbookPlaying == REDBOOK_TITLE_TRACK || gameStates.sound.bRedbookPlaying == REDBOOK_CREDITS_TRACK)
				play_redbook_track(REDBOOK_CREDITS_TRACK,0);
			else {
				//songs_goto_next_song();
	
				//new code plays all tracks to end of disk, so if disk has
				//stopped we must be at end.  So start again with level 1 song.
	
				PlayLevelSong(1);
			}
			StartTime();
		}
		last_check_time = current_time;
	}
}
Ejemplo n.º 2
0
//this should be called regularly to check for redbook restart
//ideally, this would be handled by a hook
void songs_check_redbook_repeat()
{
	static fix last_check_time;
	fix current_time;
	
	if (!Redbook_playing || GameCfg.MusicVolume==0) return;
	
	current_time = timer_get_fixed_seconds();
	if (current_time < last_check_time || (current_time - last_check_time) >= F2_0) {
		if (!RBAPeekPlayStatus() && (Redbook_playing != REDBOOK_ENDLEVEL_TRACK)) {
			stop_time();
			play_redbook_track(Redbook_playing, 0);
			start_time();
		}
		last_check_time = current_time;
	}
}