Example #1
0
int digi_win32_play_midi_song( char * filename, int loop )
{
	if (firstplay)
	{
		hmp_reset();
		firstplay = 0;
	}
	digi_win32_stop_midi_song();

	if (filename == NULL)
		return 0;

	if ((cur_hmp = hmp_open(filename)))
	{
		/*
		 * FIXME: to be implemented as soon as we have some kind or checksum function - replacement for ugly hack in hmp.c for descent.hmp
		 * if (***filesize check*** && ***CRC32 or MD5 check***)
		 *	(((*cur_hmp).trks)[1]).data[6] = 0x6C;
		 */
		if (hmp_play(cur_hmp,loop) != 0)
			return 0;	// error
		digi_win32_midi_song_playing = 1;
		digi_win32_set_midi_volume(GameCfg.MusicVolume);
		return 1;
	}

	return 0;
}
Example #2
0
//stop any songs - builtin, redbook or jukebox - that are currently playing
void songs_stop_all(void)
{
#ifdef _WIN32
    digi_win32_stop_midi_song();	// Stop midi song, if playing
#endif
    RBAStop();
#ifdef USE_SDLMIXER
    mix_stop_music();
#endif

    Song_playing = -1;
}