|
|
@@ -229,46 +229,50 @@ Plugin_Module::can_support_inputs ( int n ) |
|
|
|
bool |
|
|
|
Plugin_Module::configure_inputs( int n ) |
|
|
|
{ |
|
|
|
if ( ninputs() == n ) |
|
|
|
return true; |
|
|
|
int inst = _idata->handle.size(); |
|
|
|
|
|
|
|
int inst = 1; |
|
|
|
_crosswire = false; |
|
|
|
|
|
|
|
if ( 1 == n && plugin_ins() > 1 ) |
|
|
|
if ( ninputs() != n ) |
|
|
|
{ |
|
|
|
DMESSAGE( "Cross-wiring plugin inputs" ); |
|
|
|
_crosswire = true; |
|
|
|
_crosswire = false; |
|
|
|
|
|
|
|
audio_input.clear(); |
|
|
|
if ( n != ninputs() ) |
|
|
|
{ |
|
|
|
if ( 1 == n && plugin_ins() > 1 ) |
|
|
|
{ |
|
|
|
DMESSAGE( "Cross-wiring plugin inputs" ); |
|
|
|
_crosswire = true; |
|
|
|
|
|
|
|
for ( int i = n; i--; ) |
|
|
|
audio_input.push_back( Port( this, Port::INPUT, Port::AUDIO ) ); |
|
|
|
} |
|
|
|
else if ( n >= plugin_ins() && |
|
|
|
( plugin_ins() == 1 && plugin_outs() == 1 ) ) |
|
|
|
{ |
|
|
|
DMESSAGE( "Running multiple instances of plugin" ); |
|
|
|
audio_input.clear(); |
|
|
|
|
|
|
|
audio_input.clear(); |
|
|
|
audio_output.clear(); |
|
|
|
for ( int i = n; i--; ) |
|
|
|
audio_input.push_back( Port( this, Port::INPUT, Port::AUDIO ) ); |
|
|
|
} |
|
|
|
else if ( n >= plugin_ins() && |
|
|
|
( plugin_ins() == 1 && plugin_outs() == 1 ) ) |
|
|
|
{ |
|
|
|
DMESSAGE( "Running multiple instances of plugin" ); |
|
|
|
|
|
|
|
for ( int i = n; i--; ) |
|
|
|
{ |
|
|
|
add_port( Port( this, Port::INPUT, Port::AUDIO ) ); |
|
|
|
add_port( Port( this, Port::OUTPUT, Port::AUDIO ) ); |
|
|
|
} |
|
|
|
audio_input.clear(); |
|
|
|
audio_output.clear(); |
|
|
|
|
|
|
|
inst = n; |
|
|
|
} |
|
|
|
if ( n == plugin_ins() ) |
|
|
|
{ |
|
|
|
for ( int i = n; i--; ) |
|
|
|
{ |
|
|
|
add_port( Port( this, Port::INPUT, Port::AUDIO ) ); |
|
|
|
add_port( Port( this, Port::OUTPUT, Port::AUDIO ) ); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
// unsupported configuration |
|
|
|
return false; |
|
|
|
inst = n; |
|
|
|
} |
|
|
|
else if ( n == plugin_ins() ) |
|
|
|
{ |
|
|
|
DMESSAGE( "Plugin input configuration is a perfect match" ); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
DMESSAGE( "Unsupported input configuration" ); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ( _active ) |
|
|
|