Fix preset preview issues with peak controllers (#3904)

This commit is contained in:
Hyunjin Song
2018-04-04 09:06:58 +09:00
committed by GitHub
parent d30a22487e
commit 00f9590b18
3 changed files with 3 additions and 14 deletions

View File

@@ -26,6 +26,7 @@
#include "Controller.h"
#include "Song.h"
#include "PresetPreviewPlayHandle.h"
#include "PeakController.h"
#include "peak_controller_effect.h"
#include "lmms_math.h"
@@ -67,7 +68,7 @@ PeakControllerEffect::PeakControllerEffect(
m_autoController( NULL )
{
m_autoController = new PeakController( Engine::getSong(), this );
if( !Engine::getSong()->isLoadingProject() )
if( !Engine::getSong()->isLoadingProject() && !PresetPreviewPlayHandle::isPreviewing() )
{
Engine::getSong()->addController( m_autoController );
}

View File

@@ -29,7 +29,6 @@
#include "PeakController.h"
#include "peak_controller_effect_controls.h"
#include "peak_controller_effect.h"
#include "PresetPreviewPlayHandle.h"
#include "Song.h"
@@ -80,12 +79,6 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
{
m_effect->m_effectId = rand();
}
if( m_effect->m_autoController && PresetPreviewPlayHandle::isPreviewing() == true )
{
delete m_effect->m_autoController;
m_effect->m_autoController = 0;
}
}