예제 #1
0
void initPlayer() {
    MIDASstartup();
    MIDASinit();
    MIDASsetTimerCallbacks(70000, FALSE, &PreVR, &immVR, NULL/*&inVR*/);
    module = MIDASloadModule("epic.mod");
    playHandle = MIDASplayModule(module, TRUE);
    MIDASstartBackgroundPlay(0);
}
예제 #2
0
int main(void)
{
	MIDASmodule module;
	MIDASmodulePlayHandle playHandle;
	int i;
	FILE *f;

	remove("c:\\crn_cmn.mrk");

	if(!MIDASstartup()) {
		printf("Unable to initialize MIDAS sound system\n");
		getch();
		exit(0);
	}

	if(!MIDASinit()) MIDASerror();
	if(!MIDASstartBackgroundPlay(0)) MIDASerror();

	if((module = MIDASloadModule("cadmium.xm")) == NULL) MIDASerror();

	if((i = WinExec("..\\crn_cmn.exe", SW_SHOWMAXIMIZED )) == 0) {
		printf("Unable to execute crn_cmn.exe\n");
		MIDASclose();
		getch();
		exit(0);
	}

	while(1) {
		sleep(1000);
		if((f = fopen("c:\\crn_cmn.mrk", "rb")) !=  NULL) {
			fclose(f);
			break;
		}
	}

	playHandle = MIDASplayModule(module, TRUE);

	while(1) {
		sleep(1000);
		if((f = fopen("c:\\crn_cmn.mrk", "rb")) ==  NULL) break;
		else fclose(f);
	}

	MIDASclose();

	return 0;
}
예제 #3
0
파일: echotest.c 프로젝트: cdrr/MAME_hack
int main(int argc, char *argv[])
{
    int error;
    MIDASmodule module;
    MIDASmodulePlayHandle playHandle;
    static mEchoHandle eh;

    MIDASstartup();

    puts("MIDAS echo effect engine test\n");

    if ( argc != 2 )
    {
        puts("Usage: echo module");
        return 1;
    }

    MIDASsetOption(MIDAS_OPTION_MIXING_MODE, MIDAS_MIX_HIGH_QUALITY);
    if ( !MIDASinit() )
        MIDASerror();
    if ( !MIDASstartBackgroundPlay(0) )
        MIDASerror();

    if ( (error = mEchoInit()) != OK )
        mError(error);

    if ( (module = MIDASloadModule(argv[1])) == NULL )
        MIDASerror();
    
    if ( (playHandle = MIDASplayModule(module, TRUE)) == 0 )
        MIDASerror();

    
    if ( (error = mEchoAddEffect(&simpleEcho, &eh)) != OK )
        mError(error);

    puts("Simple echo - press any key");
    getch();

    if ( (error = mEchoRemoveEffect(eh)) != OK )
        mError(error);

    if ( (error = mEchoAddEffect(&reverseEcho, &eh)) != OK )
        mError(error);

    puts("Channel-reverse echo - press any key");
    getch();

    if ( (error = mEchoRemoveEffect(eh)) != OK )
        mError(error);

    puts("No echo - press any key");
    getch();

    if ( !MIDASstopModule(playHandle) )
        MIDASerror();
    if ( !MIDASfreeModule(module) )
        MIDASerror();

    if ( (error = mEchoClose()) != OK )
        mError(error);
    
    if ( !MIDASstopBackgroundPlay() )
        MIDASerror();
    if ( !MIDASclose() )
        MIDASerror();

    return 0;
}
예제 #4
0
파일: playprof.c 프로젝트: cdrr/MAME_hack
int main(int argc, char *argv[])
{
    MIDASmodule module;
    MIDASmodulePlayHandle playHandle;

    MIDASstartup();

#ifdef _WIN32_
    SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS);
#endif    

    puts("MIDAS playback profiler\n");

    if ( argc != 3 )
    {
        puts("Usage: mode filename\n        mode = (f)loat/(i)nteger\n");
        return EXIT_FAILURE;
    }

    MIDASconfig();

    switch ( argv[1][0] )
    {
        case 'i':
            mPreferredMixingMode = M_MIX_INTEGER;
            break;

        case 'f':
            mPreferredMixingMode = M_MIX_FLOAT;
            break;
    }

    if ( !MIDASinit() )
        MIDASerror();
    if ( !MIDASstartBackgroundPlay(0) )
        MIDASerror();
    
    if ( (module = MIDASloadModule(argv[2])) == NULL )
        MIDASerror();
    if ( (playHandle = MIDASplayModule(module, TRUE)) == 0 )
        MIDASerror();

    printf("Playing - press any\n");
    getch();

    if ( !MIDASstopModule(playHandle) )
        MIDASerror();
    if ( !MIDASfreeModule(module) )
        MIDASerror();

    if ( !MIDASstopBackgroundPlay() )
        MIDASerror();

    PrintResults();
    
    if ( !MIDASclose() )
        MIDASerror();

    
    return 0;    
}