VST preset preview (#5441)

* Enable vestige presets preview.

* Don't destroy vestige instrument on every preset change.

* Don't reload VST dll plugin when it's not necessary. Always hide plugin UI in preview mode.

* Don't remove other instruments in preview mode, don't send instrument change signal.

* Minor changes

* Add a change I missed

Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
This commit is contained in:
akimaze
2020-05-09 06:23:40 +02:00
committed by GitHub
parent 1a6f4c1104
commit ab107f01f9
4 changed files with 68 additions and 34 deletions

View File

@@ -198,9 +198,15 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
{
m_plugin->loadSettings( _this );
if ( _this.attribute( "guivisible" ).toInt() ) {
if (instrumentTrack() != NULL && instrumentTrack()->isPreviewMode())
{
m_plugin->hideUI();
}
else if (_this.attribute( "guivisible" ).toInt())
{
m_plugin->showUI();
} else {
} else
{
m_plugin->hideUI();
}
@@ -322,12 +328,17 @@ void vestigeInstrument::loadFile( const QString & _file )
{
m_pluginMutex.lock();
const bool set_ch_name = ( m_plugin != NULL &&
instrumentTrack()->name() == m_plugin->name() ) ||
instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) ||
instrumentTrack()->name() == displayName();
instrumentTrack()->name() == m_plugin->name() ) ||
instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) ||
instrumentTrack()->name() == displayName();
m_pluginMutex.unlock();
// if the same is loaded don't load again (for preview)
if (instrumentTrack() != NULL && instrumentTrack()->isPreviewMode() &&
m_pluginDLL == SampleBuffer::tryToMakeRelative( _file ))
return;
if ( m_plugin != NULL )
{
closePlugin();
@@ -354,8 +365,11 @@ void vestigeInstrument::loadFile( const QString & _file )
return;
}
m_plugin->createUI(nullptr);
m_plugin->showUI();
if ( !(instrumentTrack() != NULL && instrumentTrack()->isPreviewMode()))
{
m_plugin->createUI(nullptr);
m_plugin->showUI();
}
if( set_ch_name )
{