VstEmbed: Support changing embed method without restart
This commit is contained in:
@@ -352,12 +352,15 @@ void ConfigManager::setValue( const QString & cls,
|
||||
{
|
||||
if( m_settings.contains( cls ) )
|
||||
{
|
||||
for( stringPairVector::iterator it = m_settings[cls].begin();
|
||||
it != m_settings[cls].end(); ++it )
|
||||
for( QPair<QString, QString>& pair : m_settings[cls])
|
||||
{
|
||||
if( ( *it ).first == attribute )
|
||||
if( pair.first == attribute )
|
||||
{
|
||||
( *it ).second = value;
|
||||
if ( pair.second != value )
|
||||
{
|
||||
pair.second = value;
|
||||
emit valueChanged( cls, attribute, value );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1019,6 +1019,20 @@ SetupDialog::~SetupDialog()
|
||||
|
||||
void SetupDialog::accept()
|
||||
{
|
||||
if( m_warnAfterSetup )
|
||||
{
|
||||
QMessageBox::information( NULL, tr( "Restart LMMS" ),
|
||||
tr( "Please note that most changes "
|
||||
"won't take effect until "
|
||||
"you restart LMMS!" ),
|
||||
QMessageBox::Ok );
|
||||
}
|
||||
|
||||
// Hide dialog before setting values. This prevents an obscure bug
|
||||
// where non-embedded VST windows would steal focus and prevent LMMS
|
||||
// from taking mouse input, rendering the application unusable.
|
||||
QDialog::accept();
|
||||
|
||||
ConfigManager::inst()->setValue( "mixer", "framesperaudiobuffer",
|
||||
QString::number( m_bufferSize ) );
|
||||
ConfigManager::inst()->setValue( "mixer", "audiodev",
|
||||
@@ -1094,16 +1108,6 @@ void SetupDialog::accept()
|
||||
}
|
||||
|
||||
ConfigManager::inst()->saveConfigFile();
|
||||
|
||||
QDialog::accept();
|
||||
if( m_warnAfterSetup )
|
||||
{
|
||||
QMessageBox::information( NULL, tr( "Restart LMMS" ),
|
||||
tr( "Please note that most changes "
|
||||
"won't take effect until "
|
||||
"you restart LMMS!" ),
|
||||
QMessageBox::Ok );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user