commit c6dedb43ddf70e28f936d195282c4a90821ad83a
parent 2e37c9277e3adc4b8d2ca51673dd91905ba086b2
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Thu, 7 May 2015 14:51:12 -0400
UI: Only Applicable Presets Are Shown In UI
Diffstat:
6 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/src/Params/FilterParams.cpp b/src/Params/FilterParams.cpp
@@ -132,7 +132,7 @@ FilterParams::FilterParams(unsigned char Ptype_,
unsigned char Pfreq_,
unsigned char Pq_)
{
- //setpresettype("Pfilter");
+ setpresettype("Pfilter");
Dtype = Ptype_;
Dfreq = Pfreq_;
Dq = Pq_;
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(loc);}
+ callback {presetsui->copy(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(loc,this);}
+ callback {presetsui->paste(loc,this);}
xywh {435 405 25 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 11 labelcolor 55
}
}
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(filterui->loc());}
+ callback {presetsui->copy(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(filterui->loc(),this);}
+ callback {presetsui->paste(filterui->loc(),this);}
xywh {203 5 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
}
}
diff --git a/src/UI/Fl_PADnoteOvertonePosition.h b/src/UI/Fl_PADnoteOvertonePosition.h
@@ -66,6 +66,15 @@ class PADnoteOvertonePosition: public Fl_Box, Fl_Osc_Widget
virtual void OSC_value(unsigned N, void *data, const char *name)
override
{
+ if(N/4 != nsamples) {
+ nsamples = N/4;
+ delete [] spc;
+ delete [] nhr;
+ spc = new float[nsamples];
+ nhr = new float[nsamples];
+ memset(spc, 0, nsamples*sizeof(float));
+ memset(nhr, 0, nsamples*sizeof(float));
+ }
assert(N==(4*nsamples));
float *d = (float*)data;
if(!strcmp(name, "spectrum"))
diff --git a/src/UI/LFOUI.fl b/src/UI/LFOUI.fl
@@ -150,12 +150,12 @@ hide();} {}
Fl_Button {} {
label C
callback {presetsui->copy(lfoparamswindow->loc());}
- xywh {145 10 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55 deactivate
+ xywh {145 10 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
}
Fl_Button {} {
label P
callback {presetsui->paste(lfoparamswindow->loc(),this);}
- xywh {162 10 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55 deactivate
+ xywh {162 10 15 15} box THIN_UP_BOX color 179 labelfont 1 labelsize 10 labelcolor 55
}
}
}
diff --git a/src/UI/PresetsUI.fl b/src/UI/PresetsUI.fl
@@ -37,12 +37,21 @@ class PresetsUI {} {
listmodel.callback = [this](Osc_ListModel::list_t list) {
copybrowse->clear();
pastebrowse->clear();
+ printf("adding entries<%s>...\\n", datamodel.value.c_str());
+ if(datamodel.value.empty())
+ return;
for(unsigned i=0;i<list.size();++i){
+ std::string type = std::get<2>(list[i]);
+ bool same = datamodel.value.substr(1) == type;
+ same |= strstr(type.c_str(), "Plfo") && strstr(datamodel.value.c_str(), "Plfo");
+ if(!same)
+ continue;
copybrowse->add(std::get<1>(list[i]).c_str());
pastebrowse->add(std::get<1>(list[i]).c_str());
}};
datamodel.callback = [this](Osc_DataModel::value_t val) {
printf("Value = %s\\n", val.c_str());
+ listmodel.update("/presets/scan-for-presets");
};
} {}
@@ -161,12 +170,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 {paste(std::string url_, PresetsUI_ *pui, int idx)} {} {code {
+ printf("UNIMPLEMENTED PASTE\\n");
+ } {}}
+ Function {copy(std::string url_, int idx)} {} {code {
+ printf("UNIMPLEMENTED COPY\\n");
+ } {}}
Function {copy(std::string url_)} {} {
code {copybutton->activate();
copypbutton->deactivate();
@@ -207,8 +216,8 @@ class PresetsUI {} {
code {copybrowse->clear();
pastebrowse->clear();
+ printf("Datamodel Update...");
datamodel.update(url+"preset-type");
- listmodel.update("/presets/scan-for-presets");
/*presetRescan();*/
/*