@@ -357,6 +357,23 @@ Chain::configure_ports ( void ) | |||||
parent()->redraw(); | parent()->redraw(); | ||||
} | } | ||||
int | |||||
Chain::get_module_instance_number ( Module *m ) | |||||
{ | |||||
int n = 0; | |||||
for ( int i = 0; i < modules(); ++i ) | |||||
{ | |||||
if ( module(i) == m ) | |||||
break; | |||||
if ( ! strcmp( module(i)->name(), m->name() ) ) | |||||
n++; | |||||
} | |||||
return n; | |||||
} | |||||
/* calculate the minimum number of buffers required to satisfy this chain */ | /* calculate the minimum number of buffers required to satisfy this chain */ | ||||
int | int | ||||
Chain::required_buffers ( void ) | Chain::required_buffers ( void ) | ||||
@@ -89,6 +89,8 @@ public: | |||||
const char *name ( void ) const { return _name; } | const char *name ( void ) const { return _name; } | ||||
void name ( const char *name ); | void name ( const char *name ); | ||||
int get_module_instance_number ( Module *m ); | |||||
void configure_ports ( void ); | void configure_ports ( void ); | ||||
int required_buffers ( void ); | int required_buffers ( void ); | ||||
@@ -200,7 +200,13 @@ Module::Port::generate_osc_path () | |||||
char *path; | char *path; | ||||
// /mixer/strip/STRIPNAME/control/MODULENAME/CONTROLNAME | // /mixer/strip/STRIPNAME/control/MODULENAME/CONTROLNAME | ||||
asprintf( &path, "/mixer/strip/%s/control/%s/%s", module()->chain()->name(), p->module()->label(), p->name() ); | |||||
int n = module()->chain()->get_module_instance_number( module() ); | |||||
if ( n > 0 ) | |||||
asprintf( &path, "/mixer/strip/%s/control/%s.%i/%s", module()->chain()->name(), p->module()->label(), n, p->name() ); | |||||
else | |||||
asprintf( &path, "/mixer/strip/%s/control/%s/%s", module()->chain()->name(), p->module()->label(), p->name() ); | |||||
// asprintf( &path, "/mixer/strip/control/%s/%s", p->module()->label(), p->name() ); | // asprintf( &path, "/mixer/strip/control/%s/%s", p->module()->label(), p->name() ); | ||||
@@ -220,6 +226,7 @@ Module::Port::change_osc_path ( char *path ) | |||||
if ( _osc_path ) | if ( _osc_path ) | ||||
{ | { | ||||
mixer->osc_endpoint->del_method( _osc_path, "f" ); | mixer->osc_endpoint->del_method( _osc_path, "f" ); | ||||
mixer->osc_endpoint->del_method( _osc_path_cv, "f" ); | |||||
free( _osc_path ); | free( _osc_path ); | ||||
free( _osc_path_cv ); | free( _osc_path_cv ); | ||||
@@ -158,6 +158,11 @@ public: | |||||
void buffer ( void *buf, nframes_t nframes ) { _buf = buf; _nframes = nframes; }; | void buffer ( void *buf, nframes_t nframes ) { _buf = buf; _nframes = nframes; }; | ||||
void *buffer ( void ) const { return _buf; } | void *buffer ( void ) const { return _buf; } | ||||
const char *osc_path ( ) | |||||
{ | |||||
return _osc_path; | |||||
} | |||||
void update_osc_port ( ) | void update_osc_port ( ) | ||||
{ | { | ||||
if ( INPUT == _direction ) | if ( INPUT == _direction ) | ||||
@@ -245,6 +245,8 @@ Module_Parameter_Editor::make_controls ( void ) | |||||
} | } | ||||
w->tooltip( p->osc_path() ); | |||||
Fl_Button *bound; | Fl_Button *bound; | ||||
w->align(FL_ALIGN_TOP); | w->align(FL_ALIGN_TOP); | ||||