| @@ -191,13 +191,22 @@ Module::paste_before ( void ) | |||||
| m->copy(); | m->copy(); | ||||
| } | } | ||||
| void | |||||
| Module::handle_control_changed ( Port *p ) | |||||
| { | |||||
| if ( _editor ) | |||||
| _editor->handle_control_changed ( p ); | |||||
| } | |||||
| char * | char * | ||||
| Module::Port::generate_osc_path () | Module::Port::generate_osc_path () | ||||
| { | { | ||||
| const Port *p = this; | const Port *p = this; | ||||
| char *path; | |||||
| char *path = NULL; | |||||
| // /mixer/strip/STRIPNAME/control/MODULENAME/CONTROLNAME | // /mixer/strip/STRIPNAME/control/MODULENAME/CONTROLNAME | ||||
| @@ -237,11 +246,9 @@ Module::Port::change_osc_path ( char *path ) | |||||
| if ( path ) | if ( path ) | ||||
| { | { | ||||
| _osc_path_cv = (char*)malloc( strlen( path ) + 4 ); | |||||
| _osc_path_cv[0] = 0; | |||||
| _osc_path_cv = NULL; | |||||
| strcpy( _osc_path_cv, path ); | |||||
| strcat( _osc_path_cv, "/unscaled" ); | |||||
| asprintf( &_osc_path_cv, "%s/unscaled", path ); | |||||
| mixer->osc_endpoint->add_method( path, "f", &Module::Port::osc_control_change_cv, this, "value" ); | mixer->osc_endpoint->add_method( path, "f", &Module::Port::osc_control_change_cv, this, "value" ); | ||||
| @@ -381,7 +381,7 @@ public: | |||||
| /* called whenever the value of a control port is changed. | /* called whenever the value of a control port is changed. | ||||
| This can be used to take appropriate action from the GUI thread */ | This can be used to take appropriate action from the GUI thread */ | ||||
| virtual void handle_control_changed ( Port * ) { } | |||||
| virtual void handle_control_changed ( Port * ); | |||||
| /* called whenever the name of the chain changes (usually because | /* called whenever the name of the chain changes (usually because | ||||
| * the name of the mixer strip changed). */ | * the name of the mixer strip changed). */ | ||||
| @@ -168,7 +168,6 @@ Module_Parameter_Editor::make_controls ( void ) | |||||
| o->selection_color( FL_GREEN ); | o->selection_color( FL_GREEN ); | ||||
| o->type( FL_TOGGLE_BUTTON ); | o->type( FL_TOGGLE_BUTTON ); | ||||
| o->value( p->control_value() ); | o->value( p->control_value() ); | ||||
| } | } | ||||
| else if ( p->hints.type == Module::Port::Hints::INTEGER ) | else if ( p->hints.type == Module::Port::Hints::INTEGER ) | ||||
| { | { | ||||
| @@ -370,6 +369,19 @@ Module_Parameter_Editor::bind_control ( int i ) | |||||
| _module->redraw(); | _module->redraw(); | ||||
| } | } | ||||
| /* Display changes initiated via automation or from other parts of the GUI */ | |||||
| void | |||||
| Module_Parameter_Editor::handle_control_changed ( Module::Port *p ) | |||||
| { | |||||
| int i = _module->control_input_port_index( p ); | |||||
| Fl_Group *g = (Fl_Group*)control_pack->child( i ); | |||||
| Fl_Group *g2 = (Fl_Group*)g->child( 0 ); | |||||
| Fl_Valuator *v = (Fl_Valuator*)g2->child( 0 ); | |||||
| v->value( p->control_value() ); | |||||
| } | |||||
| void | void | ||||
| Module_Parameter_Editor::set_value (int i, float value ) | Module_Parameter_Editor::set_value (int i, float value ) | ||||
| { | { | ||||
| @@ -67,6 +67,8 @@ class Module_Parameter_Editor : public Fl_Double_Window | |||||
| public: | public: | ||||
| void handle_control_changed ( Module::Port *p ); | |||||
| Module_Parameter_Editor ( Module *module ); | Module_Parameter_Editor ( Module *module ); | ||||
| virtual ~Module_Parameter_Editor ( ); | virtual ~Module_Parameter_Editor ( ); | ||||
| }; | }; | ||||
| @@ -111,10 +111,10 @@ namespace OSC | |||||
| lo_server_add_method( _server, path, typespec, handler, user_data ); | lo_server_add_method( _server, path, typespec, handler, user_data ); | ||||
| char *stored_path; | |||||
| char *stored_path = NULL; | |||||
| asprintf( &stored_path, "%s (%s); %s", path, typespec, argument_description ); | asprintf( &stored_path, "%s (%s); %s", path, typespec, argument_description ); | ||||
| _path_names.push_back( stored_path ); | _path_names.push_back( stored_path ); | ||||
| } | } | ||||