commit e399d0587c7194f4d720db68684df6d7a2d93201
parent 94fde6bb0aa0ae991279ce9b969d8d027f5d4b05
Author: fundamental <[email protected]>
Date: Thu, 5 Mar 2015 21:01:48 -0500
UI: Reconnect Copy/Paste Buttons To Logic
Diffstat:
11 files changed, 62 insertions(+), 54 deletions(-)
diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp
@@ -929,6 +929,7 @@ void MiddleWareImpl::bToUhandle(const char *rtmsg)
bool MiddleWareImpl::handleOscil(string path, const char *msg, void *v)
{
+ printf("handleOscil...\n");
char buffer[1024];
memset(buffer, 0, sizeof(buffer));
DummyDataObj d(buffer, 1024, v, cb, ui, osc);
@@ -936,11 +937,17 @@ bool MiddleWareImpl::handleOscil(string path, const char *msg, void *v)
if(!v)
return true;
- for(auto &p:OscilGen::ports.ports) {
- if(strstr(p.name,msg) && strstr(p.metadata, "realtime") &&
- !strcmp("b", rtosc_argument_string(msg))) {
- //printf("sending along packet '%s'...\n", msg);
- return false;
+ //Paste To Non-Realtime Parameters and then forward
+ if(strstr(msg, "paste") && !strstr(msg, "padpars")) {
+ }
+
+ if(!strstr(msg, "padpars")) {
+ for(auto &p:OscilGen::ports.ports) {
+ if(strstr(p.name,msg) && strstr(p.metadata, "realtime") &&
+ !strcmp("b", rtosc_argument_string(msg))) {
+ //printf("sending along packet '%s'...\n", msg);
+ return false;
+ }
}
}
@@ -1176,6 +1183,8 @@ void MiddleWare::transmitMsg(const char *path, const char *args, ...)
va_start(va,args);
if(rtosc_vmessage(buffer,1024,path,args,va))
transmitMsg(buffer);
+ else
+ fprintf(stderr, "Error in transmitMsg(...)\n");
va_end(va);
}
@@ -1184,6 +1193,8 @@ void MiddleWare::transmitMsg(const char *path, const char *args, va_list va)
char buffer[1024];
if(rtosc_vmessage(buffer, 1024, path, args, va))
transmitMsg(buffer);
+ else
+ fprintf(stderr, "Error in transmitMsg(va)n");
}
void MiddleWare::pendingSetProgram(int part)
diff --git a/src/Misc/PresetExtractor.cpp b/src/Misc/PresetExtractor.cpp
@@ -115,18 +115,13 @@ void doPaste(MiddleWare &mw, string url, string data, Ts&&... args)
//Let the pointer be reclaimed later
}
-//../Synth/OscilGen.h
-//../Params/ADnoteParameters.h
-//../Params/Controller.h
-//../Params/EnvelopeParams.h
-//../Params/FilterParams.h
-//../Params/LFOParams.h
-//../Params/PADnoteParameters.h
-//../Params/Presets.h
-//../Params/PresetsArray.h
-//../Params/PresetsStore.h
-//../Params/SUBnoteParameters.h
-//../Effects/Effect.h
+/*
+ * Dispatch to class specific operators
+ *
+ * Oscilgen and PADnoteParameters have mixed RT/non-RT parameters and require
+ * extra handling.
+ * See MiddleWare.cpp for these specifics
+ */
void doClassPaste(std::string type, MiddleWare &mw, string url, string data)
{
if(type == "EnvelopeParams")
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -1016,12 +1016,12 @@ resui->resonancewindow->show();}
}
Fl_Button {} {
label C
- callback {/*presetsui->copyArray(pars);*/}
+ callback {presetsui->copyArray(loc);}
xywh {405 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->pasteArray(pars,this);*/}
+ callback {presetsui->pasteArray(loc,this);}
xywh {435 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
}
@@ -1055,12 +1055,12 @@ advoice->change_voice(nvoice);}
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(pars,nvoice);*/}
+ callback {presetsui->copy(ADnoteVoice->loc(),nvoice);}
xywh {705 609 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->paste(pars,this,nvoice);*/}
+ callback {presetsui->paste(ADnoteVoice->loc(),this,nvoice);}
xywh {735 609 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
}
diff --git a/src/UI/Connection.cpp b/src/UI/Connection.cpp
@@ -238,34 +238,34 @@ class UI_Interface:public Fl_Osc_Interface
void writeRaw(const char *msg) override
{
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
- //fprintf(stderr, ".");
- fprintf(stderr, "rawWrite(%s:%s)\n", msg, rtosc_argument_string(msg));
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
+ ////fprintf(stderr, ".");
+ //fprintf(stderr, "rawWrite(%s:%s)\n", msg, rtosc_argument_string(msg));
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
impl->transmitMsg(msg);
}
void writeValue(string s, string ss) override
{
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
- fprintf(stderr, "writevalue<string>(%s,%s)\n", s.c_str(),ss.c_str());
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
+ //fprintf(stderr, "writevalue<string>(%s,%s)\n", s.c_str(),ss.c_str());
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
impl->transmitMsg(s.c_str(), "s", ss.c_str());
}
void writeValue(string s, char c) override
{
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
- fprintf(stderr, "writevalue<char>(%s,%d)\n", s.c_str(),c);
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
+ //fprintf(stderr, "writevalue<char>(%s,%d)\n", s.c_str(),c);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
impl->transmitMsg(s.c_str(), "c", c);
}
void writeValue(string s, float f) override
{
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
- fprintf(stderr, "writevalue<float>(%s,%f)\n", s.c_str(),f);
- fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 4 + 30, 0 + 40);
+ //fprintf(stderr, "writevalue<float>(%s,%f)\n", s.c_str(),f);
+ //fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
impl->transmitMsg(s.c_str(), "f", f);
}
diff --git a/src/UI/FilterUI.fl b/src/UI/FilterUI.fl
@@ -235,12 +235,12 @@ delete (formantparswindow);} {}
}
Fl_Button {} {
label C
- callback {/*presetsui->copyArray(pars);*/}
+ callback {presetsui->copyArray(filterui->loc());}
xywh {186 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->pasteArray(pars,this);*/}
+ callback {presetsui->pasteArray(filterui->loc(),this);}
xywh {203 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
}
}
@@ -254,7 +254,7 @@ delete (formantparswindow);} {}
} {
Fl_Button {} {
label P
- callback {/*presetsui->paste(pars,this,nvowel);*/}
+ callback {presetsui->paste(loc(),this,nvowel);}
xywh {665 25 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7
code0 {formantparswindow->osc = osc;}
code1 {formantparswindow->base = loc();}
@@ -413,7 +413,7 @@ formantfiltergraph->redraw();}
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(pars,nvowel);*/}
+ callback {presetsui->copy(formantparsgroup->loc(),nvowel);}
xywh {635 25 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Box {} {
diff --git a/src/UI/MasterUI.fl b/src/UI/MasterUI.fl
@@ -560,14 +560,12 @@ syseffectui->refresh();}
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(master->sysefx[nsyseff]);*/}
+ callback {presetsui->copy("/sysefx"+to_s(nsyseff)+"/");}
xywh {185 192 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 7 hide
}
Fl_Button {} {
label P
- callback {/*pthread_mutex_lock(&master->mutex);
-presetsui->paste(master->sysefx[nsyseff],syseffectui);
-pthread_mutex_unlock(&master->mutex);*/} selected
+ callback { presetsui->paste("/sysefx"+to_s(nsyseff)+"/",syseffectui);} selected
xywh {215 192 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 hide
}
}
@@ -686,14 +684,12 @@ if ((int) o->value()==1){
} {}
Fl_Button {} {
label C
- callback {/*presetsui->copy(master->insefx[ninseff]);*/}
+ callback {presetsui->copy(inseffectuigroup->loc());}
xywh {185 190 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 hide
}
Fl_Button {} {
label P
- callback {/*pthread_mutex_lock(&master->mutex);
-presetsui->paste(master->insefx[ninseff],inseffectui);
-pthread_mutex_unlock(&master->mutex);*/}
+ callback {presetsui->paste(inseffectuigroup->loc(),inseffectui);}
xywh {215 190 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55 hide
}
}
diff --git a/src/UI/PADnoteUI.fl b/src/UI/PADnoteUI.fl
@@ -804,12 +804,12 @@ if (resui!=NULL) {
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(pars);*/}
+ callback {presetsui->copy(padnotewindow->loc());}
xywh {65 400 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->paste(pars,this);*/}
+ callback {presetsui->paste(padnotewindow->loc(),this);}
xywh {95 400 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
diff --git a/src/UI/PartUI.fl b/src/UI/PartUI.fl
@@ -708,12 +708,12 @@ if (x==2) part->partefx[ninseff]->setdryonly(true);
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(part->partefx[ninseff]);*/}
+ callback {presetsui->copy(partfx->loc());}
xywh {90 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->paste(part->partefx[ninseff],inseffectui);*/}
+ callback {presetsui->paste(partfx->loc(),inseffectui);}
xywh {120 127 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
}
diff --git a/src/UI/PresetsUI.fl b/src/UI/PresetsUI.fl
@@ -150,6 +150,12 @@ class PresetsUI {} {
}
}
}
+ Function {copyArray(std::string url_)} {} {
+ code {} {}}
+ Function {pasteArray(std::string url_, PresetsUI_ *pui)} {} {
+ code {} {}}
+ Function {paste(std::string url_, PresetsUI_ *pui, int idx)} {} {code {} {}}
+ Function {copy(std::string url_, int idx)} {} {code {} {}}
Function {copy(std::string url_)} {} {
code {copybutton->activate();
copypbutton->deactivate();
diff --git a/src/UI/ResonanceUI.fl b/src/UI/ResonanceUI.fl
@@ -183,12 +183,12 @@ redrawPADnoteApply();}
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(respar);*/}
+ callback {presetsui->copy(resonancewindow->loc());}
xywh {625 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->paste(respar,this);*/}
+ callback {presetsui->paste(resonancewindow->loc(),this);}
xywh {655 275 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button applybutton {
diff --git a/src/UI/SUBnoteUI.fl b/src/UI/SUBnoteUI.fl
@@ -418,12 +418,12 @@ globalfiltergroup->redraw();}
}
Fl_Button {} {
label C
- callback {/*presetsui->copy(pars);*/}
+ callback {presetsui->copy(SUBparameters->loc());}
xywh {540 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Button {} {
label P
- callback {/*presetsui->paste(pars,this);*/}
+ callback {presetsui->paste(SUBparameters->loc(),this);}
xywh {570 451 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
Fl_Group {} {