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; }
void endPlayer() { MIDASstopModule(playHandle); MIDASfreeModule(module); MIDASstopBackgroundPlay(); MIDASclose(); }
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; }