diff --git a/common/JackNetAPI.cpp b/common/JackNetAPI.cpp index 7088f7f4..38e4a2be 100644 --- a/common/JackNetAPI.cpp +++ b/common/JackNetAPI.cpp @@ -35,13 +35,6 @@ extern "C" #define MASTER_NAME_SIZE 256 - enum JackNetMode { - - JackFastMode = 'f', - JackNormalMode = 'n', - JackSlowMode = 's', - }; - enum JackNetEncoder { JackFloatEncoder = 0, diff --git a/example-clients/netslave.c b/example-clients/netslave.c index 446d1561..077ed314 100644 --- a/example-clients/netslave.c +++ b/example-clients/netslave.c @@ -1,6 +1,6 @@ /* Copyright (C) 2009 Grame - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -55,18 +55,18 @@ static void net_shutdown(void* data) } static int net_process(jack_nframes_t buffer_size, - int audio_input, - float** audio_input_buffer, + int audio_input, + float** audio_input_buffer, int midi_input, void** midi_input_buffer, int audio_output, - float** audio_output_buffer, - int midi_output, - void** midi_output_buffer, + float** audio_output_buffer, + int midi_output, + void** midi_output_buffer, void* data) { int i; - + // Copy input to output for (i = 0; i < audio_input; i++) { memcpy(audio_output_buffer[i], audio_input_buffer[i], buffer_size * sizeof(float)); @@ -84,7 +84,7 @@ main (int argc, char *argv[]) const char *options = "C:P:a:p:"; int option_index; int opt; - + struct option long_options[] = { {"audio input", 1, 0, 'C'}, @@ -93,36 +93,36 @@ main (int argc, char *argv[]) {"port", 1, 0, 'p'}, {0, 0, 0, 0} }; - + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { - + switch (opt) { - + case 'C': audio_input = atoi(optarg); break; - + case 'P': audio_output = atoi(optarg); break; - + case 'a': multicast_ip = strdup(optarg); break; - + case 'p': port = atoi(optarg); break; - + case 'h': usage(); return -1; } } - jack_slave_t request = { audio_input, audio_output, 0, 0, DEFAULT_MTU, -1, JackSlowMode }; + jack_slave_t request = { audio_input, audio_output, 0, 0, DEFAULT_MTU, -1, 2 }; jack_master_t result; - + printf("Waiting for a master...\n"); if ((net = jack_net_slave_open(DEFAULT_MULTICAST_IP, DEFAULT_PORT, "net_slave", &request, &result)) == 0) { @@ -139,7 +139,7 @@ main (int argc, char *argv[]) fprintf(stderr, "Cannot sactivate client\n"); return 1; } - + /* install a signal handler to properly quits jack client */ #ifdef WIN32 signal(SIGINT, signal_handler); @@ -160,7 +160,7 @@ main (int argc, char *argv[]) sleep(1); #endif }; - + // Wait for application end jack_net_slave_deactivate(net); jack_net_slave_close(net); diff --git a/macosx/iphone/freeverb.mm b/macosx/iphone/freeverb.mm index 3daabc9a..1d1517d7 100644 --- a/macosx/iphone/freeverb.mm +++ b/macosx/iphone/freeverb.mm @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,7 +52,7 @@ using namespace std; #define AVOIDDENORMALS _mm_setcsr(_mm_getcsr() | 0x8000) #endif #else - #define AVOIDDENORMALS + #define AVOIDDENORMALS #endif //#define BENCHMARKMODE @@ -61,7 +61,7 @@ struct Meta : map { void declare (const char* key, const char* value) { (*this)[key]=value; } }; - + #define max(x,y) (((x)>(y)) ? (x) : (y)) #define min(x,y) (((x)<(y)) ? (x) : (y)) @@ -91,37 +91,37 @@ class UI { bool fStopped; public: - + UI() : fStopped(false) {} virtual ~UI() {} - + // -- active widgets - + virtual void addButton(const char* label, float* zone) = 0; virtual void addToggleButton(const char* label, float* zone) = 0; virtual void addCheckButton(const char* label, float* zone) = 0; virtual void addVerticalSlider(const char* label, float* zone, float init, float min, float max, float step) = 0; virtual void addHorizontalSlider(const char* label, float* zone, float init, float min, float max, float step) = 0; virtual void addNumEntry(const char* label, float* zone, float init, float min, float max, float step) = 0; - + // -- passive widgets - + virtual void addNumDisplay(const char* label, float* zone, int precision) = 0; virtual void addTextDisplay(const char* label, float* zone, char* names[], float min, float max) = 0; virtual void addHorizontalBargraph(const char* label, float* zone, float min, float max) = 0; virtual void addVerticalBargraph(const char* label, float* zone, float min, float max) = 0; - + // -- frames and labels - + virtual void openFrameBox(const char* label) = 0; virtual void openTabBox(const char* label) = 0; virtual void openHorizontalBox(const char* label) = 0; virtual void openVerticalBox(const char* label) = 0; virtual void closeBox() = 0; - + virtual void show() = 0; virtual void run() = 0; - + void stop() { fStopped = true; } bool stopped() { return fStopped; } @@ -132,24 +132,24 @@ struct param { float* fZone; float fMin; float fMax; param(float* z, float a, float b) : fZone(z), fMin(a), fMax(b) {} }; - + class CMDUI : public UI { int fArgc; char** fArgv; stack fPrefix; map fKeyParam; - + void addOption(const char* label, float* zone, float min, float max) { string fullname = fPrefix.top() + label; fKeyParam.insert(make_pair(fullname, param(zone, min, max))); } - + void openAnyBox(const char* label) { string prefix; - + if (label && label[0]) { prefix = fPrefix.top() + "-" + label; } else { @@ -157,21 +157,21 @@ class CMDUI : public UI } fPrefix.push(prefix); } - + public: - + CMDUI(int argc, char *argv[]) : UI(), fArgc(argc), fArgv(argv) { fPrefix.push("--"); } virtual ~CMDUI() {} - + virtual void addButton(const char* label, float* zone) {}; virtual void addToggleButton(const char* label, float* zone) {}; virtual void addCheckButton(const char* label, float* zone) {}; - + virtual void addVerticalSlider(const char* label, float* zone, float init, float min, float max, float step) { addOption(label,zone,min,max); } - + virtual void addHorizontalSlider(const char* label, float* zone, float init, float min, float max, float step) { addOption(label,zone,min,max); @@ -181,9 +181,9 @@ public: { addOption(label,zone,min,max); } - + // -- passive widgets - + virtual void addNumDisplay(const char* label, float* zone, int precision) {} virtual void addTextDisplay(const char* label, float* zone, char* names[], float min, float max) {} virtual void addHorizontalBargraph(const char* label, float* zone, float min, float max) {} @@ -193,11 +193,11 @@ public: virtual void openTabBox(const char* label) { openAnyBox(label); } virtual void openHorizontalBox(const char* label) { openAnyBox(label); } virtual void openVerticalBox(const char* label) { openAnyBox(label); } - + virtual void closeBox() { fPrefix.pop(); } - + virtual void show() {} - virtual void run() + virtual void run() { char c; printf("Type 'q' to quit\n"); @@ -205,8 +205,8 @@ public: sleep(1); } } - - void print() + + void print() { map::iterator i; cout << fArgc << "\n"; @@ -215,13 +215,13 @@ public: cout << "[ " << i->first << " " << i->second.fMin << ".." << i->second.fMax <<" ] "; } } - + void process_command() { map::iterator p; for (int i = 1; i < fArgc; i++) { if (fArgv[i][0] == '-') { - p = fKeyParam.find(fArgv[i]); + p = fKeyParam.find(fArgv[i]); if (p == fKeyParam.end()) { cout << fArgv[0] << " : unrecognized option " << fArgv[i] << "\n"; print(); @@ -233,13 +233,13 @@ public: } } } - + void process_init() { map::iterator p; for (int i = 1; i < fArgc; i++) { if (fArgv[i][0] == '-') { - p = fKeyParam.find(fArgv[i]); + p = fKeyParam.find(fArgv[i]); if (p == fKeyParam.end()) { cout << fArgv[0] << " : unrecognized option " << fArgv[i] << "\n"; exit(1); @@ -256,14 +256,14 @@ public: //---------------------------------------------------------------- // Signal processor definition //---------------------------------------------------------------- - + class dsp { protected: int fSamplingFreq; public: dsp() {} virtual ~dsp() {} - + virtual int getNumInputs() = 0; virtual int getNumOutputs() = 0; virtual void buildUserInterface(UI* interface) = 0; @@ -271,12 +271,12 @@ class dsp { virtual void compute(int len, float** inputs, float** outputs) = 0; virtual void conclude() {} }; - + //---------------------------------------------------------------------------- // FAUST generated code //---------------------------------------------------------------------------- - + class mydsp : public dsp { private: @@ -349,7 +349,7 @@ class mydsp : public dsp { float fVec23[256]; float fRec24[2]; public: - static void metadata(Meta* m) { + static void metadata(Meta* m) { m->declare("name", "freeverb"); m->declare("version", "1.0"); m->declare("author", "Grame"); @@ -580,8 +580,8 @@ class mydsp : public dsp { }; - - + + mydsp DSP; @@ -601,7 +601,7 @@ int gNumInChans; int gNumOutChans; //---------------------------------------------------------------------------- -// Jack Callbacks +// Jack Callbacks //---------------------------------------------------------------------------- static void net_shutdown(void *) @@ -633,7 +633,7 @@ void printstats() low = hi = tot = (stops[KSKIP] - starts[KSKIP]); if (mesure < KMESURE) { - + for (int i = KSKIP+1; i