//------------------------------------------------------------------------- // MAIN //------------------------------------------------------------------------- int main(int argc, char *argv[] ) { char appname[256]; char rcfilename[256]; char* home = getenv("HOME"); snprintf(appname, 255, "%s", basename(argv[0])); snprintf(rcfilename, 255, "%s/.%src", home, appname); CMDUI* interface = new CMDUI(argc, argv); FUI* finterface = new FUI(); DSP.buildUserInterface(interface); DSP.buildUserInterface(finterface); #ifdef OSCCTRL GUI* oscinterface = new OSCUI(appname, argc, argv); DSP.buildUserInterface(oscinterface); #endif #ifdef HTTPCTRL httpdUI* httpdinterface = new httpdUI(appname, DSP.getNumInputs(), DSP.getNumOutputs(), argc, argv); DSP.buildUserInterface(httpdinterface); #endif jackaudio audio; audio.init(appname, &DSP); interface->process_command(); audio.start(); #ifdef HTTPCTRL httpdinterface->run(); #endif #ifdef OSCCTRL oscinterface->run(); #endif interface->run(); audio.stop(); finterface->saveState(rcfilename); // desallocation delete interface; delete finterface; #ifdef HTTPCTRL delete httpdinterface; #endif #ifdef OSCCTRL delete oscinterface; #endif return 0; }
int main(int argc, char *argv[] ) { char* appname = basename (argv [0]); char rcfilename[256]; char* home = getenv("HOME"); int nvoices = 0; mydsp_poly* dsp_poly = NULL; snprintf(rcfilename, 256, "%s/.%src", home, appname); #ifdef POLY2 nvoices = lopt(argv, "--nvoices", nvoices); int group = lopt(argv, "--group", 1); std::cout << "Started with " << nvoices << " voices\n"; dsp_poly = new mydsp_poly(new mydsp(), nvoices, true, group); #if MIDICTRL if (hasMIDISync()) { DSP = new timed_dsp(new dsp_sequencer(dsp_poly, new effect())); } else { DSP = new dsp_sequencer(dsp_poly, new effect()); } #else DSP = new dsp_sequencer(dsp_poly, new effect()); #endif #else nvoices = lopt(argv, "--nvoices", nvoices); int group = lopt(argv, "--group", 1); if (nvoices > 0) { std::cout << "Started with " << nvoices << " voices\n"; dsp_poly = new mydsp_poly(new mydsp(), nvoices, true, group); #if MIDICTRL if (hasMIDISync()) { DSP = new timed_dsp(dsp_poly); } else { DSP = dsp_poly; } #else DSP = dsp_poly; #endif } else { #if MIDICTRL if (hasMIDISync()) { DSP = new timed_dsp(new mydsp()); } else { DSP = new mydsp(); } #else DSP = new mydsp(); #endif } #endif if (DSP == 0) { std::cerr << "Unable to allocate Faust DSP object" << std::endl; exit(1); } CMDUI* interface = new CMDUI(argc, argv); FUI* finterface = new FUI(); DSP->buildUserInterface(interface); DSP->buildUserInterface(finterface); #ifdef MIDICTRL rt_midi midi_handler(appname); midi_handler.addMidiIn(dsp_poly); MidiUI midiinterface(&midi_handler); DSP->buildUserInterface(&midiinterface); std::cout << "MIDI is on" << std::endl; #endif #ifdef HTTPCTRL httpdUI* httpdinterface = new httpdUI(appname, DSP->getNumInputs(), DSP->getNumOutputs(), argc, argv); DSP->buildUserInterface(httpdinterface); std::cout << "HTTPD is on" << std::endl; #endif #ifdef OSCCTRL GUI* oscinterface = new OSCUI(appname, argc, argv); DSP->buildUserInterface(oscinterface); #endif alsaaudio audio (argc, argv, DSP); audio.init(appname, DSP); finterface->recallState(rcfilename); audio.start(); #ifdef HTTPCTRL httpdinterface->run(); #endif #ifdef OSCCTRL oscinterface->run(); #endif #ifdef MIDICTRL if (!midiinterface.run()) { std::cerr << "MidiUI run error\n"; } #endif interface->run(); #ifdef MIDICTRL midiinterface.stop(); #endif audio.stop(); finterface->saveState(rcfilename); // desallocation delete interface; delete finterface; #ifdef HTTPCTRL delete httpdinterface; #endif #ifdef OSCCTRL delete oscinterface; #endif return 0; }
//------------------------------------------------------------------------- // MAIN //------------------------------------------------------------------------- int main(int argc, char *argv[]) { char appname[256]; char rcfilename[256]; char* home = getenv("HOME"); int celt = lopt(argv, "--celt", -1); const char* master_ip = lopts(argv, "--a", DEFAULT_MULTICAST_IP); int master_port = lopt(argv, "--p", DEFAULT_PORT); int mtu = lopt(argv, "--m", DEFAULT_MTU); int latency = lopt(argv, "--l", 2); snprintf(appname, 255, "%s", basename(argv[0])); snprintf(rcfilename, 255, "%s/.%src", home, appname); CMDUI* interface = new CMDUI(argc, argv); FUI* finterface = new FUI(); DSP.buildUserInterface(interface); DSP.buildUserInterface(finterface); #ifdef OSCCTRL GUI* oscinterface = new OSCUI(appname, argc, argv); DSP.buildUserInterface(oscinterface); #endif #ifdef HTTPCTRL httpdUI* httpdinterface = new httpdUI(appname, argc, argv); DSP.buildUserInterface(httpdinterface); #endif netjackaudio audio(celt, master_ip, master_port, mtu, latency); if (!audio.init(appname, &DSP)) { return 0; } finterface->recallState(rcfilename); if (!audio.start()) { return 0; } #ifdef HTTPCTRL httpdinterface->run(); #endif #ifdef OSCCTRL oscinterface->run(); #endif interface->run(); audio.stop(); finterface->saveState(rcfilename); // desallocation delete interface; delete finterface; #ifdef HTTPCTRL delete httpdinterface; #endif #ifdef OSCCTRL delete oscinterface; #endif return 0; }