mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-14 12:08:33 -04:00
Merge pull request #145 from wongcc966422/ghostPeakController
Fixes Ghost Peak Controller Bug
This commit is contained in:
@@ -51,6 +51,8 @@ public:
|
||||
static ConstNotePlayHandleList nphsOfInstrumentTrack(
|
||||
const InstrumentTrack * _ct );
|
||||
|
||||
static bool isPreviewing();
|
||||
|
||||
|
||||
private:
|
||||
static previewTrackContainer * s_previewTC;
|
||||
|
||||
@@ -81,6 +81,7 @@ PeakControllerEffect::~PeakControllerEffect()
|
||||
if( idx >= 0 )
|
||||
{
|
||||
PeakController::s_effects.remove( idx );
|
||||
engine::getSong()->removeController( m_autoController );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "PeakController.h"
|
||||
#include "peak_controller_effect_controls.h"
|
||||
#include "peak_controller_effect.h"
|
||||
#include "preset_preview_play_handle.h"
|
||||
|
||||
|
||||
PeakControllerEffectControls::
|
||||
@@ -66,7 +67,7 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this )
|
||||
}
|
||||
m_effect->m_effectId = effectId;
|
||||
|
||||
if( m_effect->m_autoController )
|
||||
if( m_effect->m_autoController && presetPreviewPlayHandle::isPreviewing() == false )
|
||||
{
|
||||
delete m_effect->m_autoController;
|
||||
m_effect->m_autoController = 0;
|
||||
|
||||
@@ -89,12 +89,24 @@ public:
|
||||
m_dataMutex.unlock();
|
||||
}
|
||||
|
||||
bool isPreviewing()
|
||||
{
|
||||
bool ret = m_dataMutex.tryLock();
|
||||
if( ret == true )
|
||||
{
|
||||
m_dataMutex.unlock();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
InstrumentTrack * m_previewInstrumentTrack;
|
||||
notePlayHandle * m_previewNote;
|
||||
QMutex m_dataMutex;
|
||||
|
||||
friend class presetPreviewPlayHandle;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -242,3 +254,17 @@ ConstNotePlayHandleList presetPreviewPlayHandle::nphsOfInstrumentTrack(
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool presetPreviewPlayHandle::isPreviewing()
|
||||
{
|
||||
bool ret = s_previewTC->m_dataMutex.tryLock();
|
||||
if( ret == true )
|
||||
{
|
||||
s_previewTC->m_dataMutex.unlock();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user