VST GUI fixes, improvements

Various fixes improvements:

+ Added support for VST parameters control for windows.
+ New `Close` button for VST parameter controls.
+ Faster GUI for all instruments, effects-loading, not only VSTs,
  and both one-instrument track window mode and normal window
  mode should be supported.
+ Better integration for VST GUIs on Linux, e.g. plugin window
  should not stay always on top of other windows.
+ VST GUI overlook should remain same with different wine setups
  ( except for whole virtual desktops emulations ).
+ VST effect control window merged with VST effect editor window
  should be more easier to control.
+ Little corections at effectviews model updates of instrument
  tracks effect chains.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Mike Choi
2013-01-15 00:13:21 +01:00
committed by Tobias Doerffel
parent a184bc039e
commit 1c9c76f399
12 changed files with 190 additions and 70 deletions

View File

@@ -263,7 +263,7 @@ void vestigeInstrument::loadFile( const QString & _file )
return;
}
m_plugin->showEditor();
m_plugin->showEditor( NULL, false );
if( set_ch_name )
{
@@ -743,8 +743,7 @@ void VestigeInstrumentView::selPreset( void )
void VestigeInstrumentView::toggleGUI( void )
{
QMutexLocker ml( &m_vi->m_pluginMutex );
if( m_vi->m_plugin == NULL )
if( m_vi == NULL || m_vi->m_plugin == NULL )
{
return;
}
@@ -848,14 +847,15 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
p.setPen( QColor( 251, 41, 8 ) );
f.setBold( false );
p.setFont( pointSize<8>( f ) );
p.drawText( 10, 114, tr( "by" ) + " " +
p.drawText( 10, 114, tr( "by " ) +
m_vi->m_plugin->vendorString() );
p.drawText( 10, 225, m_vi->m_plugin->currentProgramName() );
}
if( m_vi->m_subWindow != NULL )
{
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name() );
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name()
+ tr( " - VST plugin control" ) );
}
// m_pluginMutex.unlock();
}
@@ -877,7 +877,8 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
m_vi->m_subWindow->setFixedSize( 960, 300);
m_vi->m_subWindow->setWidget(m_vi->m_scrollArea);
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name() );
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name()
+ tr( " - VST plugin control" ) );
m_vi->m_subWindow->setWindowIcon( PLUGIN_NAME::getIconPixmap( "logo" ) );
//m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
@@ -902,6 +903,16 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
l->addWidget( m_displayAutomatedOnly, 0, 1, 1, 2, Qt::AlignLeft );
m_closeButton = new QPushButton( tr( " Close " ), widget );
connect( m_closeButton, SIGNAL( clicked() ), this,
SLOT( closeWindow() ) );
m_closeButton->setWhatsThis(
tr( "Close VST plugin knob-controller window." ) );
l->addWidget( m_closeButton, 0, 2, 1, 7, Qt::AlignLeft );
for( int i = 0; i < 10; i++ )
{
l->addItem( new QSpacerItem( 68, 45, QSizePolicy::Fixed, QSizePolicy::Fixed ), 0, i );
@@ -973,6 +984,14 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
void manageVestigeInstrumentView::closeWindow()
{
m_vi->m_subWindow->hide();
}
void manageVestigeInstrumentView::syncPlugin( void )
{
char paramStr[35];
@@ -1119,7 +1138,8 @@ void manageVestigeInstrumentView::dropEvent( QDropEvent * _de )
void manageVestigeInstrumentView::paintEvent( QPaintEvent * )
{
m_vi->m_subWindow->setWindowTitle(m_vi->instrumentTrack()->name());
m_vi->m_subWindow->setWindowTitle( m_vi->instrumentTrack()->name()
+ tr( " - VST plugin control" ) );
}

View File

@@ -113,6 +113,7 @@ protected slots:
void syncPlugin( void );
void displayAutomatedOnly( void );
void setParameter( void );
void closeWindow();
protected:
@@ -130,6 +131,7 @@ private:
QGridLayout * l;
QPushButton * m_syncButton;
QPushButton * m_displayAutomatedOnly;
QPushButton * m_closeButton;
} ;

View File

@@ -558,10 +558,12 @@ void RemoteVstPlugin::initEditor()
}
#ifdef LMMS_BUILD_LINUX
m_window = CreateWindowEx( 0, "LVSL", m_shortName.c_str(),
( WS_OVERLAPPEDWINDOW | WS_THICKFRAME ) & ~WS_MAXIMIZEBOX,
0, 0, 10, 10, NULL, NULL, hInst, NULL );
//m_window = CreateWindowEx( 0, "LVSL", m_shortName.c_str(),
// ( WS_OVERLAPPEDWINDOW | WS_THICKFRAME ) & ~WS_MAXIMIZEBOX,
// 0, 0, 10, 10, NULL, NULL, hInst, NULL );
m_window = CreateWindowEx( 0 , "LVSL", m_shortName.c_str(),
WS_POPUP | WS_SYSMENU | WS_BORDER , 0, 0, 10, 10, NULL, NULL, hInst, NULL);
#else
m_windowID = 1; // arbitrary value on win32 to signal
// vstPlugin-class that we have an editor

View File

@@ -49,6 +49,7 @@
#include "MainWindow.h"
#include "song.h"
#include "templates.h"
#include <QtGui/QLayout>
class vstSubWin : public QMdiSubWindow
@@ -200,11 +201,24 @@ void VstPlugin::tryLoad( const QString &remoteVstPluginExecutable )
void VstPlugin::showEditor( QWidget * _parent )
void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
{
QWidget * w = pluginWidget();
if( w )
{
#ifdef LMMS_BUILD_WIN32
// hide sw, plugin window wrapper on win32
// this is obtained from pluginWidget()
if( isEffect )
{
w->setWindowFlags( Qt::FramelessWindowHint );
w->setAttribute( Qt::WA_TranslucentBackground );
}
else
{
w->setWindowFlags( Qt::WindowCloseButtonHint );
}
#endif
w->show();
return;
}
@@ -222,13 +236,30 @@ void VstPlugin::showEditor( QWidget * _parent )
{
vstSubWin * sw = new vstSubWin(
engine::mainWindow()->workspace() );
sw->setWidget( m_pluginWidget );
if( isEffect )
{
sw->setAttribute( Qt::WA_TranslucentBackground );
sw->setWindowFlags( Qt::FramelessWindowHint );
sw->setWidget( m_pluginWidget );
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->show();
}
else
{
sw->setWindowFlags( Qt::WindowCloseButtonHint );
sw->setWidget( m_pluginWidget );
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->move( 4, 24 );
xe->show();
}
}
QX11EmbedContainer * xe = new QX11EmbedContainer( m_pluginWidget );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->show();
#endif
if( m_pluginWidget )
@@ -258,7 +289,7 @@ void VstPlugin::loadSettings( const QDomElement & _this )
{
if( _this.attribute( "guivisible" ).toInt() )
{
showEditor();
showEditor( NULL, false );
}
else
{

View File

@@ -53,7 +53,7 @@ public:
return m_pluginWindowID != 0;
}
void showEditor( QWidget * _parent = NULL );
void showEditor( QWidget * _parent = NULL, bool isEffect = false );
void hideEditor();
inline const QString & name() const

View File

@@ -36,34 +36,50 @@
#include <QObject>
#include <QtGui/QPainter>
#include "gui_templates.h"
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
EffectControlDialog( _ctl ),
m_pluginWidget( NULL )
m_pluginWidget( NULL ),
m_plugin( NULL )
{
QGridLayout * l = new QGridLayout( this );
l->setContentsMargins( 20, 10, 10, 10 );
l->setContentsMargins( 10, 10, 10, 10 );
l->setVerticalSpacing( 2 );
l->setHorizontalSpacing( 2 );
#ifdef LMMS_BUILD_LINUX
_ctl->m_effect->m_plugin->showEditor();
m_pluginWidget = _ctl->m_effect->m_plugin->pluginWidget();
if( _ctl != NULL && _ctl->m_effect != NULL &&
_ctl->m_effect->m_plugin != NULL )
{
m_plugin = _ctl->m_effect->m_plugin;
m_plugin->showEditor( NULL, true );
m_pluginWidget = m_plugin->pluginWidget();
#ifdef LMMS_BUILD_WIN32
if( !m_pluginWidget )
{
m_pluginWidget = m_plugin->pluginWidget( false );
}
#endif
}
if( m_pluginWidget )
{
setWindowTitle( m_pluginWidget->windowTitle() );
QPushButton * btn = new QPushButton( tr( "Show/hide VST FX GUI" ) );
btn->setCheckable( true );
l->addWidget( btn, 0, 0, 1, 13, Qt::AlignCenter );
l->addWidget( btn, 0, 0, 1, 80, Qt::AlignLeft );
connect( btn, SIGNAL( toggled( bool ) ),
m_pluginWidget, SLOT( setVisible( bool ) ) );
emit btn->click();
btn->setMinimumWidth( 200 );
btn->setMaximumWidth( 200 );
btn->setMinimumHeight( 24 );
btn->setMaximumHeight( 24 );
m_managePluginButton = new pixmapButton( this, "" );
m_managePluginButton->setCheckable( false );
m_managePluginButton->setCursor( Qt::PointingHandCursor );
@@ -78,13 +94,11 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
m_managePluginButton->setWhatsThis(
tr( "Click here, if you want to control VST-plugin from host." ) );
m_managePluginButton->setMinimumWidth( 21 );
m_managePluginButton->setMaximumWidth( 21 );
m_managePluginButton->setMinimumHeight( 21 );
m_managePluginButton->setMaximumHeight( 21 );
m_openPresetButton = new pixmapButton( this, "" );
m_openPresetButton->setCheckable( false );
m_openPresetButton->setCursor( Qt::PointingHandCursor );
@@ -104,7 +118,6 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
m_openPresetButton->setMinimumHeight( 16 );
m_openPresetButton->setMaximumHeight( 16 );
m_rolLPresetButton = new pixmapButton( this, "" );
m_rolLPresetButton->setCheckable( false );
m_rolLPresetButton->setCursor( Qt::PointingHandCursor );
@@ -114,6 +127,10 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
"stepper-left" ) );
connect( m_rolLPresetButton, SIGNAL( clicked() ), _ctl,
SLOT( rolrPreset() ) );
connect( m_rolLPresetButton, SIGNAL( clicked() ), this,
SLOT( update() ) );
toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) );
m_rolLPresetButton->setShortcut( Qt::Key_Minus );
@@ -126,7 +143,6 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
m_rolLPresetButton->setMinimumHeight( 16 );
m_rolLPresetButton->setMaximumHeight( 16 );
m_rolRPresetButton = new pixmapButton( this, "" );
m_rolRPresetButton->setCheckable( false );
m_rolRPresetButton->setCursor( Qt::PointingHandCursor );
@@ -136,6 +152,10 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
"stepper-right" ) );
connect( m_rolRPresetButton, SIGNAL( clicked() ), _ctl,
SLOT( rollPreset() ) );
connect( m_rolRPresetButton, SIGNAL( clicked() ), this,
SLOT( update() ) );
toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) );
m_rolRPresetButton->setShortcut( Qt::Key_Plus );
@@ -148,8 +168,6 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
m_rolRPresetButton->setMinimumHeight( 16 );
m_rolRPresetButton->setMaximumHeight( 16 );
_ctl->m_selPresetButton = new QPushButton( tr( "" ), this );
_ctl->m_selPresetButton->setCheckable( false );
@@ -160,13 +178,11 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
_ctl->m_selPresetButton->setMenu(_ctl->menu);
_ctl->m_selPresetButton->setMinimumWidth( 16 );
_ctl->m_selPresetButton->setMaximumWidth( 16 );
_ctl->m_selPresetButton->setMinimumHeight( 16 );
_ctl->m_selPresetButton->setMaximumHeight( 16 );
m_savePresetButton = new pixmapButton( this, "" );
m_savePresetButton->setCheckable( false );
m_savePresetButton->setCursor( Qt::PointingHandCursor );
@@ -181,36 +197,28 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
m_savePresetButton->setWhatsThis(
tr( "Click here, if you want to save current VST-plugin preset program." ) );
m_savePresetButton->setMinimumWidth( 21 );
m_savePresetButton->setMaximumWidth( 21 );
m_savePresetButton->setMinimumHeight( 21 );
m_savePresetButton->setMaximumHeight( 21 );
for( int i = 0; i < 13; i++ )
{
l->addItem( new QSpacerItem( 15, 30, QSizePolicy::Fixed,
QSizePolicy::Fixed ), 1, i );
}
l->addWidget( m_openPresetButton, 1, 6, 1, 1, Qt::AlignLeft );
l->addWidget( m_rolLPresetButton, 1, 3, 1, 1, Qt::AlignLeft );
l->addWidget( m_rolRPresetButton, 1, 4, 1, 1, Qt::AlignLeft );
l->addWidget( _ctl->m_selPresetButton, 1, 5, 1, 1, Qt::AlignLeft );
l->addWidget( m_openPresetButton, 1, 7, Qt::AlignCenter );
l->addWidget( m_rolLPresetButton, 1, 4, Qt::AlignCenter );
l->addWidget( m_rolRPresetButton, 1, 5, Qt::AlignCenter );
l->addWidget(_ctl->m_selPresetButton, 1, 6, Qt::AlignLeft );
l->addWidget( m_managePluginButton, 1, 10, 2, 2, Qt::AlignLeft );
l->addWidget( m_savePresetButton, 1, 8, 2, 2, Qt::AlignCenter );
l->setRowStretch( 3, 1 );
l->setColumnStretch( 13, 1 );
l->addWidget( m_savePresetButton, 1, 7, 2, 2, Qt::AlignLeft );
l->addWidget( m_managePluginButton, 1, 8, 2, 2, Qt::AlignCenter );
l->addWidget( m_pluginWidget, 3, 0, 1, 80, Qt::AlignCenter );
l->setRowStretch( 5, 1 );
l->setColumnStretch( 80, 1 );
}
#endif
#ifdef LMMS_BUILD_WIN32
_ctl->m_effect->m_plugin->showEditor( this );
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget( false );
if( w )
{
setWindowTitle( w->windowTitle() );
l->addWidget( w );
}
#endif
}
@@ -218,7 +226,23 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
void VstEffectControlDialog::paintEvent( QPaintEvent * )
{
if( m_plugin != NULL )
{
QString plugin_name = m_plugin->name();
QPainter p( this );
QFont f = p.font();
f.setBold( true );
p.setFont( pointSize<10>( f ) );
p.setPen( QColor( 32, 160, 54 ) );
p.drawText( 225, 20, plugin_name );
p.setPen( QColor( 251, 41, 8 ) );
f.setBold( false );
p.setFont( pointSize<8>( f ) );
p.drawText( 225, 34, tr( "Effect by: " ) + m_plugin->vendorString() );
p.drawText( 225, 47, m_plugin->currentProgramName() );
}
}

View File

@@ -26,6 +26,7 @@
#define _VST_EFFECT_CONTROL_DIALOG_H
#include "EffectControlDialog.h"
#include "VstPlugin.h"
#include <QObject>
#include <QPainter>
@@ -57,6 +58,7 @@ private:
pixmapButton * m_managePluginButton;
pixmapButton * m_savePresetButton;
VstPlugin * m_plugin;
} ;
#endif

View File

@@ -314,7 +314,7 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
m_vi->m_subWindow->setFixedSize( 960, 300);
m_vi->m_subWindow->setWidget(m_vi->m_scrollArea);
m_vi->m_subWindow->setWindowTitle(_eff->m_plugin->name());
m_vi->m_subWindow->setWindowTitle( _eff->m_plugin->name() + tr( " - VST parameter control" ) );
m_vi->m_subWindow->setWindowIcon( PLUGIN_NAME::getIconPixmap( "logo" ) );
//m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
@@ -339,6 +339,16 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
l->addWidget( m_displayAutomatedOnly, 0, 1, 1, 2, Qt::AlignLeft );
m_closeButton = new QPushButton( tr( " Close " ), widget );
connect( m_closeButton, SIGNAL( clicked() ), this,
SLOT( closeWindow() ) );
m_closeButton->setWhatsThis(
tr( "Close VST effect knob-controller window." ) );
l->addWidget( m_closeButton, 0, 2, 1, 7, Qt::AlignLeft );
for( int i = 0; i < 10; i++ )
{
l->addItem( new QSpacerItem( 68, 45, QSizePolicy::Fixed, QSizePolicy::Fixed ), 0, i );
@@ -413,6 +423,14 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
void manageVSTEffectView::closeWindow()
{
m_vi2->m_subWindow->hide();
}
void manageVSTEffectView::syncPlugin( void )
{
char paramStr[35];

View File

@@ -115,6 +115,7 @@ protected slots:
void syncPlugin( void );
void displayAutomatedOnly( void );
void setParameter( void );
void closeWindow();
private:
@@ -131,6 +132,7 @@ private:
QPushButton * m_syncButton;
QPushButton * m_displayAutomatedOnly;
QPushButton * m_closeButton;
} ;

View File

@@ -175,29 +175,36 @@ void EffectRackView::update()
Qt::QueuedConnection );
view->show();
m_effectViews.append( view );
view_map[i] = true;
if( i < view_map.size() )
{
view_map[i] = true;
}
else
{
view_map.append( true );
}
}
}
int i = m_lastY = 0;
int i = m_lastY = 0, nView = 0;
for( QVector<EffectView *>::Iterator it = m_effectViews.begin();
it != m_effectViews.end(); )
it != m_effectViews.end(); i++ )
{
if( i < view_map.size() && i < m_effectViews.size() &&
view_map[i] == false )
if( i < view_map.size() && view_map[i] == false )
{
delete m_effectViews[i];
delete m_effectViews[nView];
it = m_effectViews.erase( it );
}
else
{
( *it )->move( 0, m_lastY );
m_lastY += ( *it )->height();
++nView;
++it;
++i;
}
}
w->setFixedSize( 210, m_lastY );
QWidget::update();
@@ -242,7 +249,7 @@ void EffectRackView::addEffect()
void EffectRackView::modelChanged()
{
clearViews();
//clearViews();
m_effectsGroupBox->setModel( &fxChain()->m_enabledModel );
connect( fxChain(), SIGNAL( aboutToClear() ),
this, SLOT( clearViews() ) );

View File

@@ -85,6 +85,8 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
"while deciding when to stop processing signals." ) );
setModel( _model );
if( effect()->controls()->controlCount() > 0 )
{
QPushButton * ctls_btn = new QPushButton( tr( "Controls" ),
@@ -94,6 +96,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
ctls_btn->setGeometry( 140, 14, 50, 20 );
connect( ctls_btn, SIGNAL( clicked() ),
this, SLOT( editControls() ) );
m_controlView = effect()->controls()->createView();
if( m_controlView )
{
@@ -141,7 +144,8 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
"Right clicking will bring up a context menu where you can change the order "
"in which the effects are processed or delete an effect altogether." ) );
setModel( _model );
//move above vst effect view creation
//setModel( _model );
}
@@ -149,7 +153,15 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
EffectView::~EffectView()
{
#ifdef LMMS_BUILD_LINUX
delete m_subWindow;
#else
// otherwise on win32 build VST GUI can get lost
m_subWindow->hide();
#endif
}
@@ -159,7 +171,7 @@ void EffectView::editControls()
{
if( m_subWindow )
{
if( !effect()->controls()->isViewVisible() )
if( !m_subWindow->isVisible() )
{
m_subWindow->show();
m_subWindow->raise();

View File

@@ -1047,9 +1047,9 @@ void InstrumentTrackView::freeInstrumentTrackWindow()
model()->setHook( NULL );
m_window->setInstrumentTrackView( NULL );
m_window->parentWidget()->hide();
m_window->setModel(
engine::dummyTrackContainer()->
dummyInstrumentTrack() );
//m_window->setModel(
// engine::dummyTrackContainer()->
// dummyInstrumentTrack() );
m_window->updateInstrumentView();
s_windowCache << m_window;
}