Mixer/Plugin_Module: Properly manage number of plugin instances.

This commit is contained in:
Jonathan Moore Liles 2010-01-15 01:54:25 -06:00
parent 26230bac61
commit 82e1c50b8f
1 changed files with 6 additions and 2 deletions

View File

@ -226,6 +226,8 @@ Plugin_Module::can_support_inputs ( int n )
bool bool
Plugin_Module::configure_inputs( int n ) Plugin_Module::configure_inputs( int n )
{ {
if ( ninputs() == n )
return true;
int inst = 1; int inst = 1;
_crosswire = false; _crosswire = false;
@ -240,7 +242,7 @@ Plugin_Module::configure_inputs( int n )
for ( int i = n; i--; ) for ( int i = n; i--; )
audio_input.push_back( Port( this, Port::INPUT, Port::AUDIO ) ); audio_input.push_back( Port( this, Port::INPUT, Port::AUDIO ) );
} }
else if ( n > plugin_ins() && else if ( n >= plugin_ins() &&
( plugin_ins() == 1 && plugin_outs() == 1 ) ) ( plugin_ins() == 1 && plugin_outs() == 1 ) )
{ {
DMESSAGE( "Running multiple instances of plugin" ); DMESSAGE( "Running multiple instances of plugin" );
@ -256,7 +258,7 @@ Plugin_Module::configure_inputs( int n )
inst = n; inst = n;
} }
else if ( n == plugin_ins() ) if ( n == plugin_ins() )
{ {
} }
@ -309,6 +311,8 @@ Plugin_Module::plugin_instances ( unsigned int n )
{ {
for ( int i = _idata->handle.size() - n; i--; ) for ( int i = _idata->handle.size() - n; i--; )
{ {
DMESSAGE( "Destroying plugin instance" );
LADSPA_Handle h = _idata->handle.back(); LADSPA_Handle h = _idata->handle.back();
if ( _idata->descriptor->deactivate ) if ( _idata->descriptor->deactivate )