From 2e010141adfc3f647903b69ddac6a5e01ddbde0f Mon Sep 17 00:00:00 2001 From: Colin Wallace Date: Mon, 22 Jun 2015 03:01:49 +0000 Subject: [PATCH] Remove FxMixer friendship privileges from FxMixerView and MixerWorkerThread --- include/FxMixer.h | 3 --- src/core/FxMixer.cpp | 3 +++ src/gui/FxMixerView.cpp | 23 ++++++++++------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/FxMixer.h b/include/FxMixer.h index ddc2b7434..ac5c72530 100644 --- a/include/FxMixer.h +++ b/include/FxMixer.h @@ -211,9 +211,6 @@ private: int m_lastSoloed; - friend class MixerWorkerThread; - friend class FxMixerView; - } ; diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 083a84b9f..07b3cd694 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -380,6 +380,9 @@ void FxMixer::moveChannelLeft( int index ) } } } + + // Swap positions in array + qSwap(m_fxChannels[index], m_fxChannels[index - 1]); } diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 2a8271048..6c523da52 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -455,11 +455,8 @@ void FxMixerView::moveChannelLeft(int index, int focusIndex) m->moveChannelLeft( index ); // Update widgets models - m_fxChannelViews[index]->setChannelIndex( index - 1 ); - m_fxChannelViews[index - 1]->setChannelIndex( index ); - - // Swap positions in array - qSwap(m->m_fxChannels[index], m->m_fxChannels[index - 1]); + m_fxChannelViews[index]->setChannelIndex( index ); + m_fxChannelViews[index - 1]->setChannelIndex( index - 1 ); // Focus on new position setCurrentFxLine( focusIndex ); @@ -561,28 +558,28 @@ void FxMixerView::updateFaders() FxMixer * m = Engine::fxMixer(); // apply master gain - m->m_fxChannels[0]->m_peakLeft *= Engine::mixer()->masterGain(); - m->m_fxChannels[0]->m_peakRight *= Engine::mixer()->masterGain(); + m->effectChannel(0)->m_peakLeft *= Engine::mixer()->masterGain(); + m->effectChannel(0)->m_peakRight *= Engine::mixer()->masterGain(); for( int i = 0; i < m_fxChannelViews.size(); ++i ) { const float opl = m_fxChannelViews[i]->m_fader->getPeak_L(); const float opr = m_fxChannelViews[i]->m_fader->getPeak_R(); const float fall_off = 1.2; - if( m->m_fxChannels[i]->m_peakLeft > opl ) + if( m->effectChannel(i)->m_peakLeft > opl ) { - m_fxChannelViews[i]->m_fader->setPeak_L( m->m_fxChannels[i]->m_peakLeft ); - m->m_fxChannels[i]->m_peakLeft = 0; + m_fxChannelViews[i]->m_fader->setPeak_L( m->effectChannel(i)->m_peakLeft ); + m->effectChannel(i)->m_peakLeft = 0; } else { m_fxChannelViews[i]->m_fader->setPeak_L( opl/fall_off ); } - if( m->m_fxChannels[i]->m_peakRight > opr ) + if( m->effectChannel(i)->m_peakRight > opr ) { - m_fxChannelViews[i]->m_fader->setPeak_R( m->m_fxChannels[i]->m_peakRight ); - m->m_fxChannels[i]->m_peakRight = 0; + m_fxChannelViews[i]->m_fader->setPeak_R( m->effectChannel(i)->m_peakRight ); + m->effectChannel(i)->m_peakRight = 0; } else {