Partially decouple Mixer from VisualizationWidget

This commit is contained in:
M374LX
2015-09-30 22:38:10 -03:00
parent de7d83d158
commit 5489040f20
4 changed files with 9 additions and 16 deletions

View File

@@ -231,11 +231,6 @@ public:
return m_framesPerPeriod;
}
inline const surroundSampleFrame * currentReadBuffer() const
{
return m_readBuf;
}
MixerProfiler& profiler()
{
@@ -362,7 +357,7 @@ public:
signals:
void qualitySettingsChanged();
void sampleRateChanged();
void nextAudioBuffer();
void nextAudioBuffer( const surroundSampleFrame * buffer );
private:

View File

@@ -54,7 +54,7 @@ protected:
protected slots:
void updateAudioBuffer();
void updateAudioBuffer( const surroundSampleFrame * buffer );
private:

View File

@@ -447,7 +447,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
unlock();
emit nextAudioBuffer();
emit nextAudioBuffer( m_readBuf );
// and trigger LFOs
EnvelopeAndLfoParameters::instances()->trigger();

View File

@@ -72,14 +72,12 @@ VisualizationWidget::~VisualizationWidget()
void VisualizationWidget::updateAudioBuffer()
void VisualizationWidget::updateAudioBuffer( const surroundSampleFrame * buffer )
{
if( !Engine::getSong()->isExporting() )
{
const surroundSampleFrame * c = Engine::mixer()->
currentReadBuffer();
const fpp_t fpp = Engine::mixer()->framesPerPeriod();
memcpy( m_buffer, c, sizeof( surroundSampleFrame ) * fpp );
memcpy( m_buffer, buffer, sizeof( surroundSampleFrame ) * fpp );
}
}
@@ -95,8 +93,8 @@ void VisualizationWidget::setActive( bool _active )
SIGNAL( periodicUpdate() ),
this, SLOT( update() ) );
connect( Engine::mixer(),
SIGNAL( nextAudioBuffer() ),
this, SLOT( updateAudioBuffer() ) );
SIGNAL( nextAudioBuffer( const surroundSampleFrame* ) ),
this, SLOT( updateAudioBuffer( const surroundSampleFrame* ) ) );
}
else
{
@@ -104,8 +102,8 @@ void VisualizationWidget::setActive( bool _active )
SIGNAL( periodicUpdate() ),
this, SLOT( update() ) );
disconnect( Engine::mixer(),
SIGNAL( nextAudioBuffer() ),
this, SLOT( updateAudioBuffer() ) );
SIGNAL( nextAudioBuffer( const surroundSampleFrame* ) ),
this, SLOT( updateAudioBuffer( const surroundSampleFrame* ) ) );
// we have to update (remove last waves),
// because timer doesn't do that anymore
update();