Move BufferPool::clear to MixHelpers and rewrite

* Move out of BufferPool because it's not related to memory allocation
* Rewrite because memset() is not portable because it sets all bytes to
  zero which depends on the platform's float representation of 0.0 to be
  all zero bytes
This commit is contained in:
Lukas W
2019-08-25 23:47:03 +02:00
parent 5349be6a63
commit d35df8ee7b
11 changed files with 40 additions and 38 deletions

View File

@@ -31,11 +31,11 @@
#include "gui_templates.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "MixHelpers.h"
#include "Engine.h"
#include "ToolTip.h"
#include "Song.h"
#include "BufferPool.h"
VisualizationWidget::VisualizationWidget( const QPixmap & _bg, QWidget * _p,
@@ -55,7 +55,7 @@ VisualizationWidget::VisualizationWidget( const QPixmap & _bg, QWidget * _p,
const fpp_t frames = Engine::mixer()->framesPerPeriod();
m_buffer = new sampleFrame[frames];
BufferPool::clear( m_buffer, frames );
MixHelpers::clear( m_buffer, frames );
ToolTip::add( this, tr( "Oscilloscope" ) );