Mixer: Add 'visible' property to port hints.

This commit is contained in:
Jonathan Moore Liles 2013-04-16 19:18:02 -07:00
parent cbba71a0c8
commit eff5189638
5 changed files with 22 additions and 7 deletions

View File

@ -36,7 +36,6 @@ public:
JACK_Module ( ); JACK_Module ( );
virtual ~JACK_Module ( ); virtual ~JACK_Module ( );
bool allows_external_control ( void ) const { return false; }
const char *name ( void ) const { return "JACK"; } const char *name ( void ) const { return "JACK"; }
bool initialize ( void ); bool initialize ( void );

View File

@ -56,6 +56,8 @@ Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default )
add_port( Port( this, Port::INPUT, Port::CONTROL ) ); add_port( Port( this, Port::INPUT, Port::CONTROL ) );
control_input[0].hints.visible = false;
dpm_pack = new Fl_Scalepack( x(), y(), w(), h() ); dpm_pack = new Fl_Scalepack( x(), y(), w(), h() );
dpm_pack->color( FL_BACKGROUND_COLOR ); dpm_pack->color( FL_BACKGROUND_COLOR );
dpm_pack->box( FL_FLAT_BOX ); dpm_pack->box( FL_FLAT_BOX );

View File

@ -246,9 +246,8 @@ Module::Port::generate_osc_path ()
// /strip/STRIPNAME/MODULENAME/CONTROLNAME // /strip/STRIPNAME/MODULENAME/CONTROLNAME
if ( ! module()->allows_external_control() ) if ( ! p->hints.visible )
{ {
/* Don't create signals for the default modules other than Gain */
return NULL; return NULL;
} }
@ -854,7 +853,7 @@ Module::command_open_parameter_editor ( void )
{ {
_editor->show(); _editor->show();
} }
else if ( ncontrol_inputs() ) else if ( ncontrol_inputs() && nvisible_control_inputs() )
{ {
DMESSAGE( "Opening module parameters for \"%s\"", label() ); DMESSAGE( "Opening module parameters for \"%s\"", label() );
_editor = new Module_Parameter_Editor( this ); _editor = new Module_Parameter_Editor( this );

View File

@ -74,8 +74,6 @@ public:
bool is_default ( void ) const { return _is_default; } bool is_default ( void ) const { return _is_default; }
void is_default ( bool v ) { _is_default = v; } void is_default ( bool v ) { _is_default = v; }
virtual bool allows_external_control ( void ) const { return true; }
class Port class Port
{ {
/* char *type_names[] = { "Audio", "Control" }; */ /* char *type_names[] = { "Audio", "Control" }; */
@ -103,6 +101,7 @@ public:
float maximum; float maximum;
float default_value; float default_value;
int dimensions; int dimensions;
bool visible;
Hints ( ) Hints ( )
{ {
@ -112,6 +111,7 @@ public:
maximum = 0; maximum = 0;
default_value = 0.0f; default_value = 0.0f;
dimensions = 1; dimensions = 1;
visible = true;
} }
}; };
@ -354,6 +354,18 @@ public:
return control_output.size(); return control_output.size();
} }
int nvisible_control_inputs ( void ) const
{
int n = 0;
for ( std::vector<Port>::const_iterator i = control_input.begin();
i != control_input.end();
i++ )
if ( i->hints.visible )
n++;
return n;
}
virtual bool bypass ( void ) const { return _bypass; } virtual bool bypass ( void ) const { return _bypass; }
virtual void bypass ( bool v ) { _bypass = v; redraw(); } virtual void bypass ( bool v ) { _bypass = v; redraw(); }

View File

@ -153,6 +153,9 @@ Module_Parameter_Editor::make_controls ( void )
Module::Port *p = &module->control_input[i]; Module::Port *p = &module->control_input[i];
if ( !p->hints.visible )
continue;
if ( !strcasecmp( "Azimuth", p->name() ) && if ( !strcasecmp( "Azimuth", p->name() ) &&
180.0f == p->hints.maximum && 180.0f == p->hints.maximum &&
-180.0f == p->hints.minimum ) -180.0f == p->hints.minimum )