From cc47fe4a74776b82d9d682ffa7fc64c5068d6cec Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Fri, 18 Oct 2013 15:06:27 +0100 Subject: [PATCH] -Midi bind target shown in UI --- src/goptions.cxx | 14 ++++++++++---- src/goptions.hxx | 6 ++++-- src/jack.cxx | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/goptions.cxx b/src/goptions.cxx index 2473678..0132bfc 100644 --- a/src/goptions.cxx +++ b/src/goptions.cxx @@ -30,7 +30,7 @@ OptionsWindow::OptionsWindow() Fl_Group* bindings = new Fl_Group( x, y, w, h, "Binding"); { - targetLabel = new Avtk::Button(x + 105, y + 5, 100, 25, "Target: "); + targetLabel = new Fl_Box(x + 110,y + 5, 200, 25,""); bindEnable = new Avtk::LightButton(x + 5, y + 5, 100, 25, "Bind Enable"); } bindings->end(); @@ -52,9 +52,14 @@ OptionsWindow::OptionsWindow() void OptionsWindow::setTarget(const char* t) { - target = t; - printf("%s\n", target.c_str() ); - targetLabel->setLabel( t ); + if ( target ) + free (target); + target = strdup(t); + + targetLabel->label( target ); + targetLabel->redraw(); + + //LUPPP_NOTE("New Target %s\n", target ); } void OptionsWindow::show() @@ -65,6 +70,7 @@ void OptionsWindow::show() void OptionsWindow::setBindEnable(bool e) { bindEnable->value( e ); + setTarget(""); } diff --git a/src/goptions.hxx b/src/goptions.hxx index 07d462f..8453379 100644 --- a/src/goptions.hxx +++ b/src/goptions.hxx @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -25,9 +26,10 @@ class OptionsWindow Fl_Double_Window* window; Fl_Tabs* tabs; - std::string target; + char* target; + + Fl_Box* targetLabel; - Avtk::Button* targetLabel; Avtk::Button* ctlrButton; Avtk::LightButton* bindEnable; }; diff --git a/src/jack.cxx b/src/jack.cxx index 64f110b..b195f5a 100644 --- a/src/jack.cxx +++ b/src/jack.cxx @@ -54,7 +54,7 @@ Jack::Jack() : // MIDI binding stuff - bindingEventRecordEnable = true; + bindingEventRecordEnable = false; bindingTrack = 0; bindingEventType = EVENT_NULL;