diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 338ea93dd..d0607022d 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -126,6 +126,9 @@ private slots: void toggleDisplayWaveform( bool en ); void toggleDisableAutoquit( bool en ); + void vstEmbedMethodChanged(); + void toggleVSTAlwaysOnTop( bool en ); + void setLanguage( int lang ); @@ -207,6 +210,8 @@ private: QComboBox* m_vstEmbedComboBox; QString m_vstEmbedMethod; + LedCheckBox * m_vstAlwaysOnTopCheckBox; + bool m_vstAlwaysOnTop; } ; diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index a97802bdc..e0e1347fe 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -329,7 +329,9 @@ bool VstPlugin::processMessage( const message & _m ) case IdVstPluginWindowID: m_pluginWindowID = _m.getInt(); - if( m_embedMethod == "none" ) + if( m_embedMethod == "none" + && ConfigManager::inst()->value( + "ui", "vstalwaysontop" ).toInt() ) { #ifdef LMMS_BUILD_WIN32 // We're changing the owner, not the parent, diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 4c261f581..746e7e651 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -138,7 +138,9 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : "displaywaveform").toInt() ), m_disableAutoQuit(ConfigManager::inst()->value( "ui", "disableautoquit", "1" ).toInt() ), - m_vstEmbedMethod( ConfigManager::inst()->vstEmbedMethod() ) + m_vstEmbedMethod( ConfigManager::inst()->vstEmbedMethod() ), + m_vstAlwaysOnTop( ConfigManager::inst()->value( "ui", + "vstalwaysontop" ).toInt() ) { setWindowIcon( embed::getIconPixmap( "setup_general" ) ); setWindowTitle( tr( "Setup LMMS" ) ); @@ -346,7 +348,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : } TabWidget* embed_tw = new TabWidget( tr( "PLUGIN EMBEDDING" ), general); - embed_tw->setFixedHeight( 48 ); + embed_tw->setFixedHeight( 66 ); m_vstEmbedComboBox = new QComboBox( embed_tw ); m_vstEmbedComboBox->move( XDelta, YDelta ); @@ -365,6 +367,17 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_vstEmbedComboBox->addItem( tr( "Embed using XEmbed protocol" ), "xembed" ); } m_vstEmbedComboBox->setCurrentIndex( m_vstEmbedComboBox->findData( m_vstEmbedMethod ) ); + connect( m_vstEmbedComboBox, SIGNAL( currentIndexChanged( int ) ), + this, SLOT( vstEmbedMethodChanged() ) ); + + m_vstAlwaysOnTopCheckBox = new LedCheckBox( + tr( "Keep plugin windows on top when not embedded" ), + embed_tw ); + m_vstAlwaysOnTopCheckBox->move( 20, 44 ); + m_vstAlwaysOnTopCheckBox->setChecked( m_vstAlwaysOnTop ); + m_vstAlwaysOnTopCheckBox->setVisible( m_vstEmbedMethod == "none" ); + connect( m_vstAlwaysOnTopCheckBox, SIGNAL( toggled( bool ) ), + this, SLOT( toggleVSTAlwaysOnTop( bool ) ) ); TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general ); lang_tw->setFixedHeight( 48 ); @@ -1094,11 +1107,9 @@ void SetupDialog::accept() QString::number( m_disableAutoQuit ) ); ConfigManager::inst()->setValue( "app", "language", m_lang ); ConfigManager::inst()->setValue( "ui", "vstembedmethod", -#if QT_VERSION >= 0x050000 - m_vstEmbedComboBox->currentData().toString() ); -#else - m_vstEmbedComboBox->itemData(m_vstEmbedComboBox->currentIndex()).toString() ); -#endif + m_vstEmbedMethod ); + ConfigManager::inst()->setValue( "ui", "vstalwaysontop", + QString::number( m_vstAlwaysOnTop ) ); ConfigManager::inst()->setWorkingDir(QDir::fromNativeSeparators(m_workingDir)); @@ -1316,6 +1327,25 @@ void SetupDialog::toggleOneInstrumentTrackWindow( bool _enabled ) m_oneInstrumentTrackWindow = _enabled; } + +void SetupDialog::vstEmbedMethodChanged() +{ +#if QT_VERSION >= 0x050000 + m_vstEmbedMethod = m_vstEmbedComboBox->currentData().toString(); +#else + m_vstEmbedMethod = m_vstEmbedComboBox->itemData( + m_vstEmbedComboBox->currentIndex()).toString(); +#endif + m_vstAlwaysOnTopCheckBox->setVisible( m_vstEmbedMethod == "none" ); +} + + +void SetupDialog::toggleVSTAlwaysOnTop( bool en ) +{ + m_vstAlwaysOnTop = en; +} + + void SetupDialog::setLanguage( int lang ) { m_lang = m_languages[lang];