fixed crash when adding VST effects

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1962 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-12-19 16:22:10 +00:00
parent 10f2fab3d2
commit 541d9d5ad6
6 changed files with 29 additions and 7 deletions

View File

@@ -1,3 +1,18 @@
2008-12-19 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/vst_base/vst_plugin.h:
* plugins/vst_base/vst_plugin.cpp:
* plugins/vst_effect/vst_effect_control_dialog.cpp:
* plugins/vst_effect/vst_effect.cpp:
* plugins/vestige/vestige.cpp:
fixed crash when adding VST effects
* include/project_version.h:
* src/core/project_version.cpp:
fixed broken version comparing which indicated 0.x.y to be less than
0.x.y-patch - fixes messed up projects when loading files created
with LMMS 0.4.0
2008-12-17 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* CMakeLists.txt:

View File

@@ -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();

View File

@@ -159,7 +159,6 @@ vstPlugin::vstPlugin( const QString & _plugin ) :
vstPlugin::~vstPlugin()
{
delete pluginWidget();
}

View File

@@ -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() )
{

View File

@@ -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 ) );
}
}

View File

@@ -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 );
}
}