Skip to content
Permalink
Browse files

Add VST always-on-top config option

  • Loading branch information...
DomClark authored and PhysSong committed Mar 3, 2019
1 parent 295b899 commit 17f6235500ca3b820ba53891681ac8f443514a65
Showing with 45 additions and 8 deletions.
  1. +5 −0 include/SetupDialog.h
  2. +3 −1 plugins/vst_base/VstPlugin.cpp
  3. +37 −7 src/gui/SetupDialog.cpp
@@ -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 slots:

QComboBox* m_vstEmbedComboBox;
QString m_vstEmbedMethod;
LedCheckBox * m_vstAlwaysOnTopCheckBox;
bool m_vstAlwaysOnTop;
} ;


@@ -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,
@@ -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];

0 comments on commit 17f6235

Please sign in to comment.
You can’t perform that action at this time.