int main(void) { /* unsigned v;*/ MIDASstartup(); puts("MIDAS config test\n"); if ( !MIDASconfig() ) { puts("Cancelled\n"); return 1; } puts("OK\n"); return 0; }
static int MIDAS_detect(struct mpxplay_audioout_info_s *aui) { unsigned int iscard,len; char midascnffile[300]; pds_getpath_from_fullname(midascnffile,freeopts[OPT_PROGNAME]); len=pds_strlen(midascnffile); if(len && (midascnffile[len-1]!=PDS_DIRECTORY_SEPARATOR_CHAR)) len+=pds_strcpy(&midascnffile[len],PDS_DIRECTORY_SEPARATOR_STR); pds_strcpy(&midascnffile[len],"mpxmidas.ini"); MIDASstartup(); MIDASsetOption(MIDAS_OPTION_MIXING_MODE,1); if(aui->card_controlbits&AUINFOS_CARDCNTRLBIT_MIDASMANUALCFG){ iscard=MIDASconfig(); MIDASsaveConfig(midascnffile); }else{ iscard=MIDASloadConfig(midascnffile); if(!iscard) iscard=MIDASdetectSoundCard(); } iscard+=MIDASinit(); iscard+=MIDASopenChannels(2); if(iscard==3){ midashandle=MIDASplayStreamPolling(4,aui->freq_card,1000); if(midashandle){ MIDASpauseStream(midashandle); iscard++; } } if(iscard<4){ pds_textdisplay_printf("MIDAS error: "); pds_textdisplay_printf(MIDASgetErrorMessage(MIDASgetLastError())); MIDASclose(); return 0; } return 1; }
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; }