Browse Source

Mixer: Add 'visible' property to port hints.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
eff5189638
5 changed files with 22 additions and 7 deletions
  1. +0
    -1
      mixer/src/JACK_Module.H
  2. +2
    -0
      mixer/src/Meter_Indicator_Module.C
  3. +2
    -3
      mixer/src/Module.C
  4. +15
    -3
      mixer/src/Module.H
  5. +3
    -0
      mixer/src/Module_Parameter_Editor.C

+ 0
- 1
mixer/src/JACK_Module.H View File

@@ -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 );


+ 2
- 0
mixer/src/Meter_Indicator_Module.C View File

@@ -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 );


+ 2
- 3
mixer/src/Module.C View File

@@ -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 );


+ 15
- 3
mixer/src/Module.H View File

@@ -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<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 void bypass ( bool v ) { _bypass = v; redraw(); }



+ 3
- 0
mixer/src/Module_Parameter_Editor.C View File

@@ -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 )


Loading…
Cancel
Save