commit fb3177f1d7e307c4749ef1772479d9f15e854a04
parent 7bbf61e48c0aeadc1ccef75bb122486e168a0165
Author: fundamental <[email protected]>
Date: Thu, 18 Jun 2015 14:50:50 -0400
ConfigUI: Fix SampleRate/Buffersize
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/UI/Fl_Osc_Numeric_Input.H b/src/UI/Fl_Osc_Numeric_Input.H
@@ -13,5 +13,5 @@ class Fl_Osc_Numeric_Input: public Fl_Input, public Fl_Osc_Widget
virtual void OSC_value(int i) override;
virtual void OSC_value(float f) override;
- virtual void OSC_raw(const char *) override {printf("Fl_Osc_Numeric_Input\n");};
+ static void numeric_callback(Fl_Widget *w);
};
diff --git a/src/UI/Fl_Osc_Numeric_Input.cpp b/src/UI/Fl_Osc_Numeric_Input.cpp
@@ -3,6 +3,7 @@
Fl_Osc_Numeric_Input::Fl_Osc_Numeric_Input(int X, int Y, int W, int H, const char *label)
:Fl_Input(X,Y,W,H, label), Fl_Osc_Widget(this)
{
+ callback(numeric_callback);
}
Fl_Osc_Numeric_Input::~Fl_Osc_Numeric_Input(void)
@@ -24,5 +25,12 @@ void Fl_Osc_Numeric_Input::OSC_value(int i)
char buf[128];
snprintf(buf, 128, "%d", i);
value(buf);
- printf("Osc value here\n");
+}
+
+void Fl_Osc_Numeric_Input::numeric_callback(Fl_Widget *w)
+{
+ auto &ww = *(Fl_Osc_Numeric_Input *)w;
+ int x = atoi(ww.value());
+ if(x)
+ ww.oscWrite(ww.ext, "i", x);
}