Skip to content

Commit

Permalink
LADSPA debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
zonkmachine committed Feb 1, 2017
1 parent 3e21e4e commit 28b30d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
// additional range-checkings) should be compiled

#ifdef LMMS_DEBUG
#define LADSPA_DEBUG TRUE
#include <assert.h>
#else
#define LADSPA_DEBUG FALSE
#define assert(x) ((void)(x))
#endif
#include <cstdio>
Expand Down
11 changes: 11 additions & 0 deletions plugins/LadspaEffect/LadspaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
*/


#include <QDebug>
#include <QMessageBox>

#include "debug.h"
#include "LadspaEffect.h"
#include "DataFile.h"
#include "AudioDevice.h"
Expand Down Expand Up @@ -241,6 +243,15 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
for( fpp_t frame = 0;
frame < frames; ++frame )
{
if ( LADSPA_DEBUG &&
( isnan( pp->buffer[frame] ) ||
isinf( pp->buffer[frame] ) ) )
{
qDebug() << "name: " << m_descriptor->Label;
assert( ! isnan( pp->buffer[frame] ) );
assert( ! isinf( pp->buffer[frame] ) );
}

_buf[frame][channel] = d * _buf[frame][channel] + w * pp->buffer[frame];
out_sum += _buf[frame][channel] * _buf[frame][channel];
}
Expand Down

0 comments on commit 28b30d6

Please sign in to comment.