/////////////////////////////////////////////////////////////// // Do Demo /////////////////////////////////////////////////////////////// void RunDemo(void) { int speed,i; cWILLYx=0; cWILLYy=128; SwapPage2(); NEXTBIT=FrCt+SPEED; RemoveSPG(); RemoveSky(); RemoveKong(); RemoveVRobo(); RemoveHRobo(); RemoveEugene(); DrawKeys(); DrawConv(); DrawSwitches(); DoHRobo(); DoVRobo(); DoSpecialRobo(); DrawExit(); DrawAir(); DrawLives(); DEMOp++; if(DEMOp>60) { DEMOm=2; LevelDoneExtra(); SwapPage(); LevelDoneExtra(); for(i=0;i<8;i++) { PaletteSet(PALwhite); WaitVR(); PaletteSet(PALmain); WaitVR(); } } if(AnyKeyx()==1) { MODE=0; TITLEm=0; MIDASstopModule(modon); modon=0; } }
void musapois() { if ( !MIDASsetMusicSyncCallback(playHandle, NULL) ) MIDASerror(); for ( int i = 0; i < MAXSAMPLES; i++ ) if ( (error = vuRemove(i)) != OK ) midasError(error); if ( (error = vuClose()) != OK ) midasError(error); if ( !MIDASstopModule(playHandle) ) MIDASerror(); if ( !MIDASfreeModule(module) ) MIDASerror(); if ( !MIDASremoveTimerCallbacks() ) MIDASerror(); if ( !MIDASclose() ) MIDASerror(); }
static void soundStop(struct Sound *s) { if (s->datahandle) switch (s->type) { case Module: if (s->playhandle) { MIDASstopModule((MIDASmodulePlayHandle)s->playhandle); MIDASreportErr(); } MIDASfreeModule((MIDASmodule)s->datahandle); break; case Sample: if (s->playhandle) { MIDASstopSample((MIDASsamplePlayHandle)s->playhandle); MIDASreportErr(); } MIDASfreeSample((MIDASsample)s->datahandle); break; case Stream: if (s->playhandle) { MIDASstopStream((MIDASstreamHandle)s->playhandle); MIDASreportErr(); } MP3close((void *)s->datahandle); break; #ifdef DEBUG default: errAdd(" Stop: Unknown type."); #endif } MIDASreportErr(); }
void endPlayer() { MIDASstopModule(playHandle); MIDASfreeModule(module); MIDASstopBackgroundPlay(); MIDASclose(); }
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; }
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; }