#define WIN32_LEAN_AND_MEAN
#include <windows.h>

//#include "../eshared/system/system.hpp"
#include "../eshared/eshared.hpp"
#include "resource.h"
#include "../../demos/rev2012exemusic/rev2012exemusic.e3scr.musiconly.h"
//#include "../eshared/synth/tunefish3.hpp"

#ifdef eDEBUG
eInt WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, eChar *cmdLine, eInt showCmd)
#else
void WinMainCRTStartup()
#endif
{
	tfISoundOut *   soundOut = new tfSoundOutDx8(512, 44100);
	tfPlayer *      player = new tfPlayer(soundOut);

	eDataStream stream(musicdata, sizeof(musicdata));
	player->loadInstruments(stream);
	tfSong* song = new tfSong();
	song->load(stream);
	player->setSong(song);
	player->play(0);
//	MessageBox(eNULL, "Playing Song ... Press OK to quit", "[TuneFish3] Skyrunner - Diploduplex", MB_SYSTEMMODAL | MB_ICONQUESTION);
	eSleep((3 * 60 + 33)*1000);
	player->stop();
    ExitProcess(0);
#ifdef eDEBUG
    return 0;
#endif
}