commit 26687a1a449247027ac173eed8c555323961a5d6
parent 175b88b5f00e5d8e0b2bdb5c16d56881da5157c5
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Tue, 13 Aug 2013 11:09:17 -0400
PartUI: Fix Invalid Rebase Addresses
Diffstat:
8 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/src/UI/Fl_Osc_Button.H b/src/UI/Fl_Osc_Button.H
@@ -14,6 +14,8 @@ class Fl_Osc_Button:public Fl_Button, public Fl_Osc_Widget
virtual ~Fl_Osc_Button(void);
virtual void OSC_value(bool);
+ virtual void rebase(std::string) override;
+
//void init(Fl_Osc_Interface *, std::string);
//void init(std::string);
diff --git a/src/UI/Fl_Osc_Button.cpp b/src/UI/Fl_Osc_Button.cpp
@@ -20,3 +20,6 @@ void Fl_Osc_Button::OSC_value(bool v)
Fl_Button::value(v);
}
+void Fl_Osc_Button::rebase(std::string)
+{
+}
diff --git a/src/UI/Fl_Osc_Counter.H b/src/UI/Fl_Osc_Counter.H
@@ -19,6 +19,5 @@ class Fl_Osc_Counter: public Fl_Counter, public Fl_Osc_Widget
void cb(void);
char cb_type;
private:
- std::string path;
std::pair<Fl_Callback*, void*> cb_data;
};
diff --git a/src/UI/Fl_Osc_Counter.cpp b/src/UI/Fl_Osc_Counter.cpp
@@ -13,13 +13,13 @@ Fl_Osc_Counter::Fl_Osc_Counter(int x, int y, int w, int h, const char *label)
void Fl_Osc_Counter::update(void)
{
- oscWrite(path);
+ oscWrite(ext);
}
void Fl_Osc_Counter::init(const char *path_, char type_)
{
oscRegister(path_);
- path = path_;
+ ext = path_;
cb_type = type_;
}
@@ -44,9 +44,9 @@ void Fl_Osc_Counter::cb(void)
assert(osc);
if(cb_type == 'c')
- oscWrite(path, "c", (char)(value()));
+ oscWrite(ext, "c", (char)(value()));
else
- oscWrite(path, "i", (int)value());
+ oscWrite(ext, "i", (int)value());
if(cb_data.first)
cb_data.first(this, cb_data.second);
diff --git a/src/UI/Fl_Osc_Input.cpp b/src/UI/Fl_Osc_Input.cpp
@@ -9,4 +9,7 @@ Fl_Osc_Input::~Fl_Osc_Input(void)
{}
void Fl_Osc_Input::init(const char *path)
-{}
+{
+ ext = path;
+ oscRegister(path);
+}
diff --git a/src/UI/Fl_Osc_Pane.cpp b/src/UI/Fl_Osc_Pane.cpp
@@ -29,13 +29,10 @@ static void nested_rebase(Fl_Group *g, std::string new_base)
for(unsigned i=0; i < nchildren; ++i) {
Fl_Widget *widget = g->child(i);
if(Fl_Osc_Widget *o = dynamic_cast<Fl_Osc_Widget*>(widget)) {
- printf("nested_rebase rebasing widget...\n");
o->rebase(new_base);
} else if(Fl_Osc_Group *o = dynamic_cast<Fl_Osc_Group*>(widget)) {
- printf("Fl_Osc_Group\n");
o->rebase(new_base);
} else if(Fl_Group *o = dynamic_cast<Fl_Group*>(widget)) {
- printf("nested_rebase recur...\n");
nested_rebase(o, new_base);
}
diff --git a/src/UI/Fl_Osc_Widget.H b/src/UI/Fl_Osc_Widget.H
@@ -37,7 +37,7 @@ class Fl_Osc_Widget
void oscRegister(const char *path);
//Smoothly change the base path
- void rebase(std::string new_base);
+ virtual void rebase(std::string new_base);
void oscMove(std::string new_ext);
//Base path
diff --git a/src/UI/Fl_Osc_Widget.cpp b/src/UI/Fl_Osc_Widget.cpp
@@ -43,6 +43,7 @@ void Fl_Osc_Widget::oscWrite(std::string path, const char *args, ...)
char buffer[1024];
puts("writing OSC");
printf("Path = '%s'\n", path.c_str());
+ assert(!path.empty());
va_list va;
va_start(va, args);