Пример #1
0
void playListTest()
{
	int i;

	for (i = 0; i < 10; i++)
	{
		const char *cur, *next;

		PlayList_Quit();
		PlayList_Init();
		PlayList_Read("music");
		if (numSongs != 2)
		{
			debug(LOG_ERROR, "Use the default playlist for selftest!");
		}
		cur = PlayList_CurrentSong();
		next = PlayList_NextSong();
		assert(cur != NULL && next != NULL && cur != next);
		next = PlayList_NextSong();
		assert(cur == next);	// loop around
		assert(songList);
		assert(numSongs == 2);
	}
	fprintf(stdout, "\tPlaylist self-test: PASSED\n");
}
Пример #2
0
void PlayList_Quit()
{
	WZ_TRACK *list = songList;

	while (list)
	{
		WZ_TRACK *next = list->next;

		free(list);
		list = next;
	}

	PlayList_Init();
}
Пример #3
0
bool cdAudio_Open(const char *user_musicdir)
{
	PlayList_Init();

	if (user_musicdir == nullptr
	    || !PlayList_Read(user_musicdir))
	{
		return false;
	}

	debug(LOG_SOUND, "called(%s)", user_musicdir);

	music_initialized = true;
	stopping = true;

	return true;
}
Пример #4
0
bool cdAudio_Open(const char* user_musicdir)
{
	PlayList_Init();

	if (user_musicdir == NULL
	 || !PlayList_Read(user_musicdir))
	{
		return false;
	}

	debug(LOG_SOUND, "called(%s)", user_musicdir);

#if !defined(WZ_NOSOUND)
	music_initialized = true;
	stopping = true;
#endif

	return true;
}