Browse Source

Mixer: Refuse to bypass modules whose channel configuration makes bypassing illogical.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
b1eb988257
2 changed files with 23 additions and 3 deletions
  1. +17
    -3
      mixer/src/Module.C
  2. +6
    -0
      mixer/src/Module.H

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

@@ -700,7 +700,14 @@ Module::menu_cb ( const Fl_Menu_ *m )
if ( ! strcmp( picked, "Edit Parameters" ) )
command_open_parameter_editor();
else if ( ! strcmp( picked, "Bypass" ) )
bypass( ! ( m->mvalue()->flags & FL_MENU_VALUE ) );
if ( ! bypassable() )
{
fl_alert( "Due to its channel configuration, this module cannot be bypassed." );
}
else
{
bypass( ! ( m->mvalue()->flags & FL_MENU_VALUE ) );
}
else if ( ! strcmp( picked, "Cut" ) )
{
copy();
@@ -818,8 +825,15 @@ Module::handle ( int m )
}
else if ( test_press( FL_BUTTON2 ) )
{
bypass( !bypass() );
redraw();
if ( !bypassable() )
{
fl_alert( "Due to its channel configuration, this module cannot be bypassed." );
}
else
{
bypass( !bypass() );
redraw();
}
return 1;
}



+ 6
- 0
mixer/src/Module.H View File

@@ -354,6 +354,12 @@ public:
virtual bool bypass ( void ) const { return _bypass; }
virtual void bypass ( bool v ) { _bypass = v; redraw(); }

virtual bool bypassable ( void ) const
{
return ninputs() == noutputs() ||
( ninputs() == 1 && noutputs() == 2 );
}

int control_input_port_index ( Port *p )
{
for ( nframes_t i = control_input.size(); i--; )


Loading…
Cancel
Save