Mixer: Properly handle multiple plugin instances in one Plugin module..
This commit is contained in:
parent
b1d7d58d60
commit
4014b79c5c
|
@ -471,6 +471,8 @@ Chain::build_process_queue ( void )
|
||||||
{
|
{
|
||||||
m->audio_output[j].connect_to( &port[j] );
|
m->audio_output[j].connect_to( &port[j] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m->handle_port_connection_change();
|
||||||
}
|
}
|
||||||
|
|
||||||
DMESSAGE( "Process queue looks like:" );
|
DMESSAGE( "Process queue looks like:" );
|
||||||
|
|
|
@ -135,28 +135,6 @@ Meter_Indicator_Module::connect_to ( Port *p )
|
||||||
|
|
||||||
dpm_pack->add( o );
|
dpm_pack->add( o );
|
||||||
}
|
}
|
||||||
|
|
||||||
// control = o;
|
|
||||||
// w = o;
|
|
||||||
|
|
||||||
// o->value( p->control_value() );
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
/* w->align(FL_ALIGN_TOP); */
|
|
||||||
/* w->labelsize( 10 ); */
|
|
||||||
|
|
||||||
/* if ( _pad ) */
|
|
||||||
/* { */
|
|
||||||
/* Fl_Labelpad_Group *flg = new Fl_Labelpad_Group( w ); */
|
|
||||||
/* size( flg->w(), flg->h() ); */
|
|
||||||
/* add( flg ); */
|
|
||||||
/* } */
|
|
||||||
/* else */
|
|
||||||
/* { */
|
|
||||||
/* w->resize( x(), y(), this->w(), h() ); */
|
|
||||||
/* add( w ); */
|
|
||||||
/* resizable( w ); */
|
|
||||||
/* } */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -228,6 +228,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
int instances ( void ) const { return _instances; }
|
int instances ( void ) const { return _instances; }
|
||||||
|
void instances ( int i ) { _instances = i; }
|
||||||
|
|
||||||
bool is_being_controlled ( void ) const
|
bool is_being_controlled ( void ) const
|
||||||
{
|
{
|
||||||
|
@ -309,6 +310,8 @@ public:
|
||||||
* the name of the mixer strip changed). */
|
* the name of the mixer strip changed). */
|
||||||
virtual void handle_chain_name_changed () {}
|
virtual void handle_chain_name_changed () {}
|
||||||
|
|
||||||
|
virtual void handle_port_connection_change () {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void draw_connections ( void );
|
void draw_connections ( void );
|
||||||
|
|
|
@ -48,7 +48,7 @@ struct Plugin_Module::ImplementationData
|
||||||
{
|
{
|
||||||
const LADSPA_Descriptor *descriptor;
|
const LADSPA_Descriptor *descriptor;
|
||||||
// std::vector<LADSPA_Data*> m_LADSPABufVec;
|
// std::vector<LADSPA_Data*> m_LADSPABufVec;
|
||||||
LADSPA_Handle handle;
|
std::vector<LADSPA_Handle> handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ Plugin_Module::Plugin_Module ( int , int , const char *L ) : Module( 50, 50, L )
|
||||||
|
|
||||||
Plugin_Module::~Plugin_Module ( )
|
Plugin_Module::~Plugin_Module ( )
|
||||||
{
|
{
|
||||||
|
plugin_instances( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,7 +81,6 @@ Plugin_Module::~Plugin_Module ( )
|
||||||
Plugin_Module *
|
Plugin_Module *
|
||||||
Plugin_Module::pick_plugin ( void )
|
Plugin_Module::pick_plugin ( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
/**************/
|
/**************/
|
||||||
/* build menu */
|
/* build menu */
|
||||||
/**************/
|
/**************/
|
||||||
|
@ -109,8 +108,6 @@ Plugin_Module::pick_plugin ( void )
|
||||||
|
|
||||||
Plugin_Module *m = new Plugin_Module( 50, 50 );
|
Plugin_Module *m = new Plugin_Module( 50, 50 );
|
||||||
|
|
||||||
// Plugin_Module *plugin = new Plugin_Module();
|
|
||||||
|
|
||||||
m->load( pi );
|
m->load( pi );
|
||||||
|
|
||||||
const char *plugin_name = pi->path;
|
const char *plugin_name = pi->path;
|
||||||
|
@ -129,12 +126,10 @@ void
|
||||||
Plugin_Module::init ( void )
|
Plugin_Module::init ( void )
|
||||||
{
|
{
|
||||||
_idata = new Plugin_Module::ImplementationData();
|
_idata = new Plugin_Module::ImplementationData();
|
||||||
|
_idata->handle.clear();
|
||||||
_active = false;
|
_active = false;
|
||||||
_crosswire = true;
|
_crosswire = false;
|
||||||
|
|
||||||
_instances = 1;
|
|
||||||
// box( FL_ROUNDED_BOX );
|
|
||||||
// box( FL_NO_BOX );
|
|
||||||
align( (Fl_Align)FL_ALIGN_CENTER | FL_ALIGN_INSIDE );
|
align( (Fl_Align)FL_ALIGN_CENTER | FL_ALIGN_INSIDE );
|
||||||
color( (Fl_Color)fl_color_average( FL_BLUE, FL_GREEN, 0.5f ) );
|
color( (Fl_Color)fl_color_average( FL_BLUE, FL_GREEN, 0.5f ) );
|
||||||
int tw, th, tx, ty;
|
int tw, th, tx, ty;
|
||||||
|
@ -198,10 +193,9 @@ Plugin_Module::can_support_inputs ( int n )
|
||||||
/* e.g. STEREO going into MONO */
|
/* e.g. STEREO going into MONO */
|
||||||
/* we'll run multiple instances of the plugin */
|
/* we'll run multiple instances of the plugin */
|
||||||
else if ( n > plugin_ins() &&
|
else if ( n > plugin_ins() &&
|
||||||
plugin_ins() == 1 && plugin_outs() == 1 )
|
( plugin_ins() == 1 && plugin_outs() == 1 ) )
|
||||||
{
|
{
|
||||||
return plugin_outs() * n;
|
return n;
|
||||||
// instances( i );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -210,45 +204,56 @@ Plugin_Module::can_support_inputs ( int n )
|
||||||
bool
|
bool
|
||||||
Plugin_Module::configure_inputs( int n )
|
Plugin_Module::configure_inputs( int n )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int inst = 1;
|
||||||
|
_crosswire = false;
|
||||||
|
|
||||||
if ( 1 == n && plugin_ins() > 1 )
|
if ( 1 == n && plugin_ins() > 1 )
|
||||||
{
|
{
|
||||||
|
DMESSAGE( "Cross-wiring plugin inputs" );
|
||||||
_crosswire = true;
|
_crosswire = true;
|
||||||
|
|
||||||
audio_input.clear();
|
audio_input.clear();
|
||||||
|
|
||||||
|
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() &&
|
||||||
|
( plugin_ins() == 1 && plugin_outs() == 1 ) )
|
||||||
|
{
|
||||||
|
DMESSAGE( "Running multiple instances of plugin" );
|
||||||
|
|
||||||
/* audio_input.clear(); */
|
audio_input.clear();
|
||||||
/* audio_output.clear(); */
|
audio_output.clear();
|
||||||
|
|
||||||
/* for ( int i = 0; i < n; ++i ) */
|
for ( int i = n; i--; )
|
||||||
/* { */
|
{
|
||||||
/* add_port( Port( Port::INPUT, Port::AUDIO ) ); */
|
add_port( Port( this, Port::INPUT, Port::AUDIO ) );
|
||||||
/* } */
|
add_port( Port( this, Port::OUTPUT, Port::AUDIO ) );
|
||||||
|
}
|
||||||
|
|
||||||
/* if ( n > plugin_ins() ) */
|
inst = n;
|
||||||
/* { */
|
}
|
||||||
/* /\* multiple instances *\/ */
|
else if ( n == plugin_ins() )
|
||||||
/* instances( n / plugin_ins() ); */
|
{
|
||||||
/* } */
|
|
||||||
/* else if ( n < plugin_ins() ) */
|
|
||||||
/* { */
|
|
||||||
/* /\* duplication of input *\/ */
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// unsupported configuration
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* } */
|
if ( _active )
|
||||||
|
deactivate();
|
||||||
|
|
||||||
/* for ( int i = 0; i < plugin_outs() * instances(); ++i ) */
|
if ( plugin_instances( inst ) )
|
||||||
/* { */
|
instances( inst );
|
||||||
/* add_port( Port( this, Port::OUTPUT, Port::AUDIO ) ); */
|
else
|
||||||
/* } */
|
return false;
|
||||||
|
|
||||||
if ( ! _active )
|
if ( ! _active )
|
||||||
activate();
|
activate();
|
||||||
/* // _plugin->deactivate(); */
|
|
||||||
/* /\* if ( _plugin->active() ) *\/ */
|
|
||||||
/* /\* _plugin->activate(); *\/ */
|
|
||||||
|
|
||||||
/* FIXME: do controls */
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -275,6 +280,67 @@ Plugin_Module::discover ( void )
|
||||||
return pi;
|
return pi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Plugin_Module::plugin_instances ( unsigned int n )
|
||||||
|
{
|
||||||
|
if ( _idata->handle.size() > n )
|
||||||
|
{
|
||||||
|
for ( int i = _idata->handle.size() - n; i--; )
|
||||||
|
{
|
||||||
|
LADSPA_Handle h = _idata->handle.back();
|
||||||
|
|
||||||
|
if ( _idata->descriptor->deactivate )
|
||||||
|
_idata->descriptor->deactivate( h );
|
||||||
|
if ( _idata->descriptor->cleanup )
|
||||||
|
_idata->descriptor->cleanup( h );
|
||||||
|
|
||||||
|
_idata->handle.pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( _idata->handle.size() < n )
|
||||||
|
{
|
||||||
|
for ( int i = n - _idata->handle.size(); i--; )
|
||||||
|
{
|
||||||
|
LADSPA_Handle h;
|
||||||
|
|
||||||
|
DMESSAGE( "Instantiating plugin..." );
|
||||||
|
|
||||||
|
if ( ! (h = _idata->descriptor->instantiate( _idata->descriptor, engine->sample_rate() ) ) )
|
||||||
|
{
|
||||||
|
WARNING( "Failed to instantiate plugin" );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DMESSAGE( "Instantiated: %p", h );
|
||||||
|
|
||||||
|
_idata->handle.push_back( h );
|
||||||
|
|
||||||
|
DMESSAGE( "Connecting control ports..." );
|
||||||
|
|
||||||
|
int ij = 0;
|
||||||
|
int oj = 0;
|
||||||
|
for ( unsigned int k = 0; k < _idata->descriptor->PortCount; ++k )
|
||||||
|
{
|
||||||
|
if ( LADSPA_IS_PORT_CONTROL( _idata->descriptor->PortDescriptors[k] ) )
|
||||||
|
{
|
||||||
|
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[k] ) )
|
||||||
|
_idata->descriptor->connect_port( h, k, (LADSPA_Data*)control_input[ij++].buffer() );
|
||||||
|
else if ( LADSPA_IS_PORT_OUTPUT( _idata->descriptor->PortDescriptors[k] ) )
|
||||||
|
_idata->descriptor->connect_port( h, k, (LADSPA_Data*)control_output[oj++].buffer() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// connect ports to magic bogus value to aid debugging.
|
||||||
|
for ( unsigned int k = 0; k < _idata->descriptor->PortCount; ++k )
|
||||||
|
if ( LADSPA_IS_PORT_AUDIO( _idata->descriptor->PortDescriptors[k] ) )
|
||||||
|
_idata->descriptor->connect_port( h, k, (LADSPA_Data*)0x42 );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
||||||
{
|
{
|
||||||
|
@ -295,14 +361,6 @@ Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: bogus rate */
|
|
||||||
if ( ! (_idata->handle = _idata->descriptor->instantiate( _idata->descriptor, engine->sample_rate() ) ) )
|
|
||||||
{
|
|
||||||
WARNING( "Failed to load plugin" );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// _idata->descriptor->activate( _idata->handle );
|
|
||||||
|
|
||||||
MESSAGE( "Name: %s", _idata->descriptor->Name );
|
MESSAGE( "Name: %s", _idata->descriptor->Name );
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
||||||
|
@ -328,7 +386,7 @@ Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
||||||
{
|
{
|
||||||
if ( LADSPA_IS_PORT_CONTROL( _idata->descriptor->PortDescriptors[i] ) )
|
if ( LADSPA_IS_PORT_CONTROL( _idata->descriptor->PortDescriptors[i] ) )
|
||||||
{
|
{
|
||||||
Port::Direction d;
|
Port::Direction d = Port::INPUT;
|
||||||
|
|
||||||
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[i] ) )
|
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[i] ) )
|
||||||
{
|
{
|
||||||
|
@ -474,8 +532,6 @@ Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
||||||
|
|
||||||
add_port( p );
|
add_port( p );
|
||||||
|
|
||||||
_idata->descriptor->connect_port( _idata->handle, i, (LADSPA_Data*)control_input.back().buffer() );
|
|
||||||
|
|
||||||
DMESSAGE( "Plugin has control port \"%s\" (default: %f)", _idata->descriptor->PortNames[ i ], p.hints.default_value );
|
DMESSAGE( "Plugin has control port \"%s\" (default: %f)", _idata->descriptor->PortNames[ i ], p.hints.default_value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,44 +542,47 @@ Plugin_Module::load ( Plugin_Module::Plugin_Info *pi )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return plugin_instances( 1 );
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* const char * */
|
|
||||||
/* Plugin_Module::name ( void ) const */
|
|
||||||
/* { */
|
|
||||||
/* return _idata->descriptor->Name; */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Plugin_Module::set_input_buffer ( int n, void *buf )
|
Plugin_Module::set_input_buffer ( int n, void *buf )
|
||||||
{
|
{
|
||||||
|
LADSPA_Handle h;
|
||||||
|
|
||||||
|
if ( instances() > 1 )
|
||||||
|
{
|
||||||
|
h = _idata->handle[n];
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
h = _idata->handle[0];
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
||||||
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[i] ) &&
|
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[i] ) &&
|
||||||
LADSPA_IS_PORT_AUDIO( _idata->descriptor->PortDescriptors[i] ) )
|
LADSPA_IS_PORT_AUDIO( _idata->descriptor->PortDescriptors[i] ) )
|
||||||
if ( n-- == 0 )
|
if ( n-- == 0 )
|
||||||
_idata->descriptor->connect_port( _idata->handle, i, (LADSPA_Data*)buf );
|
_idata->descriptor->connect_port( h, i, (LADSPA_Data*)buf );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Plugin_Module::set_output_buffer ( int n, void *buf )
|
Plugin_Module::set_output_buffer ( int n, void *buf )
|
||||||
{
|
{
|
||||||
|
LADSPA_Handle h;
|
||||||
|
|
||||||
|
if ( instances() > 1 )
|
||||||
|
{
|
||||||
|
h = _idata->handle[n];
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
h = _idata->handle[0];
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
||||||
if ( LADSPA_IS_PORT_OUTPUT( _idata->descriptor->PortDescriptors[i] ) &&
|
if ( LADSPA_IS_PORT_OUTPUT( _idata->descriptor->PortDescriptors[i] ) &&
|
||||||
LADSPA_IS_PORT_AUDIO( _idata->descriptor->PortDescriptors[i] ) )
|
LADSPA_IS_PORT_AUDIO( _idata->descriptor->PortDescriptors[i] ) )
|
||||||
if ( n-- == 0 )
|
if ( n-- == 0 )
|
||||||
_idata->descriptor->connect_port( _idata->handle, i, (LADSPA_Data*)buf );
|
_idata->descriptor->connect_port( h, i, (LADSPA_Data*)buf );
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Plugin_Module::set_control_buffer ( int n, void *buf )
|
|
||||||
{
|
|
||||||
for ( unsigned int i = 0; i < _idata->descriptor->PortCount; ++i )
|
|
||||||
if ( LADSPA_IS_PORT_INPUT( _idata->descriptor->PortDescriptors[i] ) &&
|
|
||||||
LADSPA_IS_PORT_CONTROL( _idata->descriptor->PortDescriptors[i] ) )
|
|
||||||
if ( n-- == 0 )
|
|
||||||
_idata->descriptor->connect_port( _idata->handle, i, (LADSPA_Data*)buf );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -533,7 +592,9 @@ Plugin_Module::activate ( void )
|
||||||
FATAL( "Attempt to activate already active plugin" );
|
FATAL( "Attempt to activate already active plugin" );
|
||||||
|
|
||||||
if ( _idata->descriptor->activate )
|
if ( _idata->descriptor->activate )
|
||||||
_idata->descriptor->activate( _idata->handle );
|
for ( unsigned int i = 0; i < _idata->handle.size(); ++i )
|
||||||
|
_idata->descriptor->activate( _idata->handle[i] );
|
||||||
|
|
||||||
_active = true;
|
_active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -541,36 +602,42 @@ void
|
||||||
Plugin_Module::deactivate( void )
|
Plugin_Module::deactivate( void )
|
||||||
{
|
{
|
||||||
if ( _idata->descriptor->deactivate )
|
if ( _idata->descriptor->deactivate )
|
||||||
_idata->descriptor->deactivate( _idata->handle );
|
for ( unsigned int i = 0; i < _idata->handle.size(); ++i )
|
||||||
|
_idata->descriptor->activate( _idata->handle[i] );
|
||||||
|
|
||||||
_active = false;
|
_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Plugin_Module::handle_port_connection_change ( void )
|
||||||
|
{
|
||||||
|
// DMESSAGE( "Connecting audio ports" );
|
||||||
|
|
||||||
|
if ( _crosswire )
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < plugin_ins(); ++i )
|
||||||
|
set_input_buffer( i, audio_input[0].buffer() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for ( unsigned int i = 0; i < audio_input.size(); ++i )
|
||||||
|
set_input_buffer( i, audio_input[i].buffer() );
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( unsigned int i = 0; i < audio_output.size(); ++i )
|
||||||
|
set_output_buffer( i, audio_output[i].buffer() );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Plugin_Module::process ( )
|
Plugin_Module::process ( )
|
||||||
{
|
{
|
||||||
if ( _crosswire )
|
handle_port_connection_change();
|
||||||
{
|
|
||||||
for ( int i = 0; i < plugin_ins(); ++i )
|
|
||||||
{
|
|
||||||
set_input_buffer( i, audio_input[0].buffer() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for ( unsigned int i = 0; i < audio_input.size(); ++i )
|
|
||||||
{
|
|
||||||
set_input_buffer( i, audio_input[i].buffer() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < audio_output.size(); ++i )
|
|
||||||
{
|
|
||||||
set_output_buffer( i, audio_output[i].buffer() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( _active )
|
if ( _active )
|
||||||
|
for ( unsigned int i = 0; i < _idata->handle.size(); ++i )
|
||||||
{
|
{
|
||||||
_idata->descriptor->run( _idata->handle, nframes() );
|
volatile int n = i;
|
||||||
|
_idata->descriptor->run( _idata->handle[n], nframes() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,6 @@ class Plugin_Module : Module {
|
||||||
|
|
||||||
void init ( void );
|
void init ( void );
|
||||||
|
|
||||||
int _ins;
|
|
||||||
int _outs;
|
|
||||||
int _instances;
|
|
||||||
|
|
||||||
void bbox ( int &X, int &Y, int &W, int &H )
|
void bbox ( int &X, int &Y, int &W, int &H )
|
||||||
{
|
{
|
||||||
X = x();
|
X = x();
|
||||||
|
@ -47,8 +43,6 @@ class Plugin_Module : Module {
|
||||||
ImplementationData *_idata;
|
ImplementationData *_idata;
|
||||||
|
|
||||||
bool _active;
|
bool _active;
|
||||||
|
|
||||||
|
|
||||||
int _plugin_ins;
|
int _plugin_ins;
|
||||||
int _plugin_outs;
|
int _plugin_outs;
|
||||||
bool _crosswire;
|
bool _crosswire;
|
||||||
|
@ -77,6 +71,10 @@ class Plugin_Module : Module {
|
||||||
void process ( unsigned long nframes );
|
void process ( unsigned long nframes );
|
||||||
bool active ( void ) const { return _active; }
|
bool active ( void ) const { return _active; }
|
||||||
|
|
||||||
|
bool plugin_instances ( unsigned int );
|
||||||
|
|
||||||
|
void connect_ports ( void );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Plugin_Module( int W, int H, const char *L = 0 );
|
Plugin_Module( int W, int H, const char *L = 0 );
|
||||||
|
@ -88,15 +86,6 @@ public:
|
||||||
int plugin_ins ( void ) const { return _plugin_ins; }
|
int plugin_ins ( void ) const { return _plugin_ins; }
|
||||||
int plugin_outs ( void ) const { return _plugin_outs; }
|
int plugin_outs ( void ) const { return _plugin_outs; }
|
||||||
|
|
||||||
bool ins ( int i );
|
|
||||||
int ins ( void ) const { return _ins; }
|
|
||||||
int outs ( void ) const { return plugin_outs() * _instances; }
|
|
||||||
|
|
||||||
bool controllable ( void ) const { return false; }
|
|
||||||
|
|
||||||
int instances ( void ) const { return _instances; }
|
|
||||||
void instances ( int i ) { _instances = i; }
|
|
||||||
|
|
||||||
void select_plugin ( unsigned long id );
|
void select_plugin ( unsigned long id );
|
||||||
|
|
||||||
const char *name ( void ) const { return "Plugin"; }
|
const char *name ( void ) const { return "Plugin"; }
|
||||||
|
@ -106,9 +95,10 @@ public:
|
||||||
|
|
||||||
void process ( void );
|
void process ( void );
|
||||||
|
|
||||||
|
void handle_port_connection_change ( void );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// virtual void draw ( void );
|
|
||||||
virtual int handle ( int );
|
virtual int handle ( int );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue