Skip to content

Commit

Permalink
VST GUI fixes, improvements
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike-C authored and tobydox committed Jan 16, 2013
1 parent a184bc0 commit 1c9c76f
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 72 deletions.
34 changes: 27 additions & 7 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void vestigeInstrument::loadFile( const QString & _file )
return;
}

m_plugin->showEditor();
m_plugin->showEditor( NULL, false );

if( set_ch_name )
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
Expand All @@ -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);

Expand All @@ -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 );
Expand Down Expand Up @@ -973,6 +984,14 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume



void manageVestigeInstrumentView::closeWindow()
{
m_vi->m_subWindow->hide();
}




void manageVestigeInstrumentView::syncPlugin( void )
{
char paramStr[35];
Expand Down Expand Up @@ -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" ) );
}


Expand Down
2 changes: 2 additions & 0 deletions plugins/vestige/vestige.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ protected slots:
void syncPlugin( void );
void displayAutomatedOnly( void );
void setParameter( void );
void closeWindow();


protected:
Expand All @@ -130,6 +131,7 @@ protected slots:
QGridLayout * l;
QPushButton * m_syncButton;
QPushButton * m_displayAutomatedOnly;
QPushButton * m_closeButton;

} ;

Expand Down
8 changes: 5 additions & 3 deletions plugins/vst_base/RemoteVstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 38 additions & 7 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "MainWindow.h"
#include "song.h"
#include "templates.h"
#include <QtGui/QLayout>


class vstSubWin : public QMdiSubWindow
Expand Down Expand Up @@ -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;
}
Expand All @@ -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 )
Expand Down Expand Up @@ -258,7 +289,7 @@ void VstPlugin::loadSettings( const QDomElement & _this )
{
if( _this.attribute( "guivisible" ).toInt() )
{
showEditor();
showEditor( NULL, false );
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/vst_base/VstPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PLUGIN_EXPORT VstPlugin : public QObject, public JournallingObject,
return m_pluginWindowID != 0;
}

void showEditor( QWidget * _parent = NULL );
void showEditor( QWidget * _parent = NULL, bool isEffect = false );
void hideEditor();

inline const QString & name() const
Expand Down
Loading

0 comments on commit 1c9c76f

Please sign in to comment.