From eff51896382783435d134c5365d89f948ef11f90 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 16 Apr 2013 19:18:02 -0700 Subject: [PATCH] Mixer: Add 'visible' property to port hints. --- mixer/src/JACK_Module.H | 1 - mixer/src/Meter_Indicator_Module.C | 2 ++ mixer/src/Module.C | 5 ++--- mixer/src/Module.H | 18 +++++++++++++++--- mixer/src/Module_Parameter_Editor.C | 3 +++ 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mixer/src/JACK_Module.H b/mixer/src/JACK_Module.H index cd8c922..a7e3e33 100644 --- a/mixer/src/JACK_Module.H +++ b/mixer/src/JACK_Module.H @@ -36,7 +36,6 @@ public: JACK_Module ( ); virtual ~JACK_Module ( ); - bool allows_external_control ( void ) const { return false; } const char *name ( void ) const { return "JACK"; } bool initialize ( void ); diff --git a/mixer/src/Meter_Indicator_Module.C b/mixer/src/Meter_Indicator_Module.C index 2defb29..2460e50 100644 --- a/mixer/src/Meter_Indicator_Module.C +++ b/mixer/src/Meter_Indicator_Module.C @@ -56,6 +56,8 @@ Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default ) 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->color( FL_BACKGROUND_COLOR ); dpm_pack->box( FL_FLAT_BOX ); diff --git a/mixer/src/Module.C b/mixer/src/Module.C index 1003693..8a953a3 100644 --- a/mixer/src/Module.C +++ b/mixer/src/Module.C @@ -246,9 +246,8 @@ Module::Port::generate_osc_path () // /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; } @@ -854,7 +853,7 @@ Module::command_open_parameter_editor ( void ) { _editor->show(); } - else if ( ncontrol_inputs() ) + else if ( ncontrol_inputs() && nvisible_control_inputs() ) { DMESSAGE( "Opening module parameters for \"%s\"", label() ); _editor = new Module_Parameter_Editor( this ); diff --git a/mixer/src/Module.H b/mixer/src/Module.H index 04fe8e6..7d1abd2 100644 --- a/mixer/src/Module.H +++ b/mixer/src/Module.H @@ -74,8 +74,6 @@ public: bool is_default ( void ) const { return _is_default; } void is_default ( bool v ) { _is_default = v; } - virtual bool allows_external_control ( void ) const { return true; } - class Port { /* char *type_names[] = { "Audio", "Control" }; */ @@ -103,7 +101,8 @@ public: float maximum; float default_value; int dimensions; - + bool visible; + Hints ( ) { type = LINEAR; @@ -112,6 +111,7 @@ public: maximum = 0; default_value = 0.0f; dimensions = 1; + visible = true; } }; @@ -354,6 +354,18 @@ public: return control_output.size(); } + int nvisible_control_inputs ( void ) const + { + int n = 0; + for ( std::vector::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 void bypass ( bool v ) { _bypass = v; redraw(); } diff --git a/mixer/src/Module_Parameter_Editor.C b/mixer/src/Module_Parameter_Editor.C index 7786e7e..5087296 100644 --- a/mixer/src/Module_Parameter_Editor.C +++ b/mixer/src/Module_Parameter_Editor.C @@ -153,6 +153,9 @@ Module_Parameter_Editor::make_controls ( void ) Module::Port *p = &module->control_input[i]; + if ( !p->hints.visible ) + continue; + if ( !strcasecmp( "Azimuth", p->name() ) && 180.0f == p->hints.maximum && -180.0f == p->hints.minimum )