commit 995e0f7df6b59611a4407d51b30e94dbac5aa1be
parent 5bc589224b5c57d3eda0ff077dd809d4c3f9cbd5
Author: Christopher A. Oliver <caowasteland@gmail.com>
Date: Sun, 18 Oct 2015 23:41:43 -0400
Restore ADVoiceList icon to former glory
Diffstat:
M | src/UI/ADnoteUI.fl | | | 77 | +++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------ |
1 file changed, 53 insertions(+), 24 deletions(-)
diff --git a/src/UI/ADnoteUI.fl b/src/UI/ADnoteUI.fl
@@ -52,6 +52,9 @@ decl {\#include "Fl_Osc_Slider.H"} {public local
decl {\#include "Fl_Osc_VSlider.H"} {public local
}
+decl {\#include "Osc_IntModel.h"} {private local
+}
+
decl {\#include "Fl_Oscilloscope.h"} {public local
}
@@ -142,7 +145,7 @@ class ADvoicelistitem {open : {public Fl_Osc_Group}
Fl_Group voiceoscil {open
xywh {102 5 30 20} box THIN_DOWN_BOX color 32 selection_color 71 labelcolor 179
code0 {voiceoscil->ext = "OscilSmp/";}
- code1 {oscil=new Fl_Oscilloscope(o->x(),o->y(),o->w(),o->h(),"");}
+ code1 {oscil=new Fl_Oscilloscope(o->x(),o->y()+1,o->w(),o->h(),"");}
code2 {oscil->init(false);}
class Fl_Osc_Group
} {}
@@ -159,27 +162,11 @@ class ADvoicelistitem {open : {public Fl_Osc_Group}
}
Fl_Box whitenoiselabel {
label N
- xywh {107 5 20 20} labelfont 1 labelsize 13 labelcolor 7
+ xywh {107 5 20 20} labelfont 1 labelsize 13 labelcolor 54 hide
}
- Fl_Check_Button noisehack {
- callback {if (o->value()==0) {
- whitenoiselabel->hide();
- voiceresonanceenabled->activate();
- detunevalueoutput->activate();
- voicedetune->activate();
- voicelfofreq->activate();
- voiceoscil->activate();
-} else {
- whitenoiselabel->show();
- voiceresonanceenabled->deactivate();
- detunevalueoutput->deactivate();
- voicedetune->deactivate();
- voicelfofreq->deactivate();
- voiceoscil->deactivate();
-};}
- xywh {0 0 0 0} down_box DOWN_BOX
- code0 {o->init("Type");o->hide();}
- class Fl_Osc_Check
+ Fl_Box pinknoiselabel {
+ label N
+ xywh {107 5 20 20} labelfont 1 labelsize 13 labelcolor 212 hide
}
}
Fl_Check_Button voiceenabled {
@@ -212,12 +199,47 @@ else
Function {ADvoicelistitem(int x,int y, int w, int h, const char *label=0):Fl_Osc_Group(x,y,w,h,label)} {open
} {
code {assert(osc);
+ voice_phase = new Osc_IntModel(osc);
+ voice_phase->callback=[this](int phase) {
+ oscil->phase=phase;
+ voiceoscil->redraw();
+ return;
+};
+ sound_type = new Osc_IntModel(osc);
+ sound_type->callback=[this](int voice_type) {
+ switch (voice_type) {
+ case 0:
+ whitenoiselabel->hide();
+ pinknoiselabel->hide();
+ voiceresonanceenabled->activate();
+ detunevalueoutput->activate();
+ voicedetune->activate();
+ voicelfofreq->activate();
+ voiceoscil->activate();
+ return;
+ case 1:
+ whitenoiselabel->show();
+ pinknoiselabel->hide();
+ break;
+ default:
+ pinknoiselabel->show();
+ whitenoiselabel->hide();
+ }
+
+ voiceresonanceenabled->deactivate();
+ detunevalueoutput->deactivate();
+ voicedetune->deactivate();
+ voicelfofreq->deactivate();
+ voiceoscil->deactivate();
+ };
nvoice=0;} {}
}
Function {init(int nvoice_, std::string loc_, Fl_Osc_Interface *osc_)} {open
} {
code {assert(osc_);
assert(!loc_.empty());
+ voice_phase->doUpdate(loc_ + "Poscilphase");
+ sound_type->doUpdate(loc_ + "Type");
nvoice=nvoice_;
loc = loc_;
@@ -233,10 +255,17 @@ detunevalueoutput->do_callback();
ADnoteVoiceListItem->redraw();} {}
}
Function {~ADvoicelistitem()} {} {
- code {ADnoteVoiceListItem->hide();} {}
+ code {ADnoteVoiceListItem->hide();
+ osc->removeLink(voice_phase);
+ osc->removeLink(sound_type);
+ } {}
}
decl {int nvoice;} {private local
}
+ decl {class Osc_IntModel *voice_phase;} {private local
+ }
+ decl {class Osc_IntModel *sound_type;} {private local
+ }
decl {Fl_Oscilloscope *oscil;} {private local
}
decl {std::string loc;} {private local
@@ -772,7 +801,7 @@ o->redraw();}
}
MenuItem {} {
label Pink
- xywh {25 25 100 20} labelfont 1 labelsize 11 labelcolor 211
+ xywh {25 25 100 20} labelfont 1 labelsize 11 labelcolor 212
}
}
Fl_Check_Button bypassfiltercheckbutton {
@@ -803,7 +832,7 @@ bypassfiltercheckbutton->redraw();}
}
Fl_Box whitenoiselabel {
label {White Noise}
- xywh {150 430 300 65} labelfont 1 labelsize 50 labelcolor 53 hide
+ xywh {150 430 300 65} labelfont 1 labelsize 50 labelcolor 54 hide
}
Fl_Box pinknoiselabel {
label {Pink Noise}