fixed crash when adding VST effects
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1960 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1717,12 +1717,12 @@ p->putValue( jt->pos, value, false );
|
||||
break;
|
||||
}
|
||||
if( effName.isEmpty() || it->fxChannel < 0 ||
|
||||
it->fxChannel > 64 )
|
||||
it->fxChannel > NumFxChannels )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
effectChain * ec = &engine::getFxMixer()->
|
||||
getEffectChannel( it->fxChannel )->
|
||||
getEffectChannel( it->fxChannel )->
|
||||
m_fxChain;
|
||||
printf("adding %s to %d\n", effName.toAscii().constData(),
|
||||
it->fxChannel );
|
||||
|
||||
@@ -222,6 +222,10 @@ bool vestigeInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
void vestigeInstrument::closePlugin( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin )
|
||||
{
|
||||
delete m_plugin->pluginWidget();
|
||||
}
|
||||
delete m_plugin;
|
||||
m_plugin = NULL;
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
@@ -159,7 +159,6 @@ vstPlugin::vstPlugin( const QString & _plugin ) :
|
||||
|
||||
vstPlugin::~vstPlugin()
|
||||
{
|
||||
delete pluginWidget();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ public:
|
||||
void setParameterDump( const QMap<QString, QString> & _pdump );
|
||||
|
||||
|
||||
inline QWidget * pluginWidget( void )
|
||||
inline QWidget * pluginWidget( bool _top_widget = true )
|
||||
{
|
||||
if( m_pluginWidget )
|
||||
if( _top_widget && m_pluginWidget )
|
||||
{
|
||||
if( m_pluginWidget->parentWidget() )
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_plugin )
|
||||
@@ -180,9 +180,9 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( model * _parent, void * _data )
|
||||
{
|
||||
return( new vstEffect( _parent,
|
||||
return new vstEffect( _parent,
|
||||
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
|
||||
_data ) ) );
|
||||
_data ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,10 +35,14 @@ vstEffectControlDialog::vstEffectControlDialog( vstEffectControls * _ctl ) :
|
||||
effectControlDialog( _ctl )
|
||||
{
|
||||
QVBoxLayout * l = new QVBoxLayout( this );
|
||||
l->setMargin( 0 );
|
||||
l->setSpacing( 0 );
|
||||
|
||||
_ctl->m_effect->m_plugin->showEditor( this );
|
||||
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget();
|
||||
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget( false );
|
||||
if( w )
|
||||
{
|
||||
setWindowTitle( w->windowTitle() );
|
||||
l->addWidget( w );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user