Fix bug in plugin input configuration.

This commit is contained in:
Jonathan Moore Liles 2010-01-16 20:42:47 -06:00
parent 5248b90880
commit 5b8040b165
1 changed files with 39 additions and 35 deletions

View File

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