示例#1
0
文件: Week1.c 项目: daeken/Straylight
int WINAPI WinMain(
		HINSTANCE hInstance, 
		HINSTANCE hPrevInstance, 
		LPSTR lpCmdLine, 
		int nCmdShow
	) {
	MSG msg;
	
	createWindow();
	
	for(ever) {
		if(FMUSIC_IsFinished(song))
			break;
		
		if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
			if(msg.message == WM_QUIT)
				break;
			else {
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		} else if(active) {
			if(keys[VK_ESCAPE])
				break;
			
			render();
			SwapBuffers(hDC);
		}
	}
	
	killWindow();
	
	return msg.wParam;
}
示例#2
0
int CSound::musicCycle()
{
	signed char isDone = 0;
	switch(MIDIndex)
		{
		case 0:
			isDone = FMUSIC_IsFinished(m_BC1);
			break;
		case 1:
			isDone = FMUSIC_IsFinished(m_BC2);
			break;
		case 2:
			isDone = FMUSIC_IsFinished(m_BC3);
			break;
		case 3:
			isDone = FMUSIC_IsFinished(m_BC5);
			break;
		case 4:
			isDone = FMUSIC_IsFinished(m_BC6);
			break;
		case 5:
			isDone = FMUSIC_IsFinished(m_BC8);
			break;
		case 6:
			isDone = FMUSIC_IsFinished(m_BC9);
			break;  
		case -1:
			isDone = 0;
			break;
		}
		if (isDone)
		{
			MIDIndex++;
			if (MIDIndex > 6)
				MIDIndex = 0;
			PlaYMID(MIDIndex);
		}
		return 0;
}
示例#3
0
void C4MusicFileMOD::CheckIfPlaying()
{
	if (FMUSIC_IsFinished(mod))
		Application.MusicSystem.NotifySuccess();
}