Partially decouple Mixer from VisualizationWidget
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -54,7 +54,7 @@ protected:
|
||||
|
||||
|
||||
protected slots:
|
||||
void updateAudioBuffer();
|
||||
void updateAudioBuffer( const surroundSampleFrame * buffer );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -447,7 +447,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
unlock();
|
||||
|
||||
|
||||
emit nextAudioBuffer();
|
||||
emit nextAudioBuffer( m_readBuf );
|
||||
|
||||
// and trigger LFOs
|
||||
EnvelopeAndLfoParameters::instances()->trigger();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user