diff --git a/include/song.h b/include/song.h index ed6c18872..58536ba25 100644 --- a/include/song.h +++ b/include/song.h @@ -278,6 +278,8 @@ public slots: void addBBTrack(); + bool isLoadingProject(); + private slots: void insertBar(); diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index 34ee79a11..740b2c416 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -30,6 +30,7 @@ #include "peak_controller_effect_controls.h" #include "peak_controller_effect.h" #include "preset_preview_play_handle.h" +#include "song.h" PeakControllerEffectControls:: @@ -67,7 +68,7 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) } m_effect->m_effectId = effectId; - if( m_effect->m_autoController && presetPreviewPlayHandle::isPreviewing() == false ) + if( m_effect->m_autoController && ( engine::getSong()->isLoadingProject() == true || presetPreviewPlayHandle::isPreviewing() == false ) ) { delete m_effect->m_autoController; m_effect->m_autoController = 0; diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 22ff31a50..ca247c44a 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -258,12 +258,7 @@ ConstNotePlayHandleList presetPreviewPlayHandle::nphsOfInstrumentTrack( bool presetPreviewPlayHandle::isPreviewing() { - bool ret = s_previewTC->m_dataMutex.tryLock(); - if( ret == true ) - { - s_previewTC->m_dataMutex.unlock(); - } - return ret; + return s_previewTC->isPreviewing(); } diff --git a/src/core/song.cpp b/src/core/song.cpp index a2c5457aa..ab787ceba 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1500,6 +1500,13 @@ void song::removeController( Controller * _controller ) + +bool song::isLoadingProject() +{ + return m_loadingProject; +} + + #include "moc_song.cxx"