VstEffectControlDialog: workaround for invisible GUI on Linux

For some reaons with recent versions of Qt we can't embed the VST FX
GUI into an existing EffectControlDialog anymore. As a workaround, embed
it into a new subwindow and added an additional show/hide button.

Closes #3028717.
(cherry picked from commit fa9e0f762c)
This commit is contained in:
Tobias Doerffel
2010-09-02 17:33:48 +02:00
parent d396a29c06
commit 1bf3768c1c
2 changed files with 25 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
/*
* VstEffectControlDialog.cpp - dialog for displaying VST-effect GUI
*
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
#include <QtGui/QLayout>
#include <QtGui/QMdiArea>
#include <QtGui/QPushButton>
#include "VstEffectControlDialog.h"
#include "VstEffect.h"
@@ -31,12 +32,26 @@
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
EffectControlDialog( _ctl )
EffectControlDialog( _ctl ),
m_pluginWidget( NULL )
{
QVBoxLayout * l = new QVBoxLayout( this );
l->setMargin( 0 );
l->setSpacing( 0 );
#ifdef LMMS_BUILD_LINUX
_ctl->m_effect->m_plugin->showEditor();
m_pluginWidget = _ctl->m_effect->m_plugin->pluginWidget();
if( m_pluginWidget )
{
setWindowTitle( m_pluginWidget->windowTitle() );
QPushButton * btn = new QPushButton( tr( "Show/hide VST FX GUI" ) );
btn->setCheckable( true );
l->addWidget( btn );
connect( btn, SIGNAL( toggled( bool ) ),
m_pluginWidget, SLOT( setVisible( bool ) ) );
}
#elif LMMS_BUILD_WIN32
_ctl->m_effect->m_plugin->showEditor( this );
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget( false );
if( w )
@@ -44,6 +59,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
setWindowTitle( w->windowTitle() );
l->addWidget( w );
}
#endif
}
@@ -51,6 +67,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
VstEffectControlDialog::~VstEffectControlDialog()
{
delete m_pluginWidget;
}

View File

@@ -1,8 +1,8 @@
/*
* VstEffectControlDialog.h - dialog for displaying GUI of VST-effect-plugin
*
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
@@ -37,6 +37,9 @@ public:
VstEffectControlDialog( VstEffectControls * _controls );
virtual ~VstEffectControlDialog();
private:
QWidget * m_pluginWidget;
} ;
#endif