Start reworking log output

This commit is contained in:
Chris Cannam
2022-06-21 16:06:16 +01:00
parent e546767a6d
commit 35653f3a86
13 changed files with 258 additions and 71 deletions

View File

@@ -65,7 +65,8 @@ R2Stretcher::R2Stretcher(size_t sampleRate,
size_t channels,
RubberBandStretcher::Options options,
double initialTimeRatio,
double initialPitchScale) :
double initialPitchScale,
Log log) :
m_sampleRate(sampleRate),
m_channels(channels),
m_timeRatio(initialTimeRatio),
@@ -82,6 +83,7 @@ R2Stretcher::R2Stretcher(size_t sampleRate,
#endif
m_realtime(false),
m_options(options),
m_log(log),
m_debugLevel(m_defaultDebugLevel),
m_mode(JustCreated),
m_awindow(0),
@@ -700,7 +702,8 @@ R2Stretcher::configure()
delete m_stretchCalculator;
m_stretchCalculator = new StretchCalculator
(m_sampleRate, m_increment,
!(m_options & RubberBandStretcher::OptionTransientsSmooth));
!(m_options & RubberBandStretcher::OptionTransientsSmooth),
m_log);
m_stretchCalculator->setDebugLevel(m_debugLevel);
m_inputDuration = 0;

View File

@@ -31,6 +31,7 @@
#include "../common/RingBuffer.h"
#include "../common/Scavenger.h"
#include "../common/Thread.h"
#include "../common/Log.h"
#include "../common/sysutils.h"
#include "SincWindow.h"
@@ -50,7 +51,8 @@ class R2Stretcher
public:
R2Stretcher(size_t sampleRate, size_t channels,
RubberBandStretcher::Options options,
double initialTimeRatio, double initialPitchScale);
double initialTimeRatio, double initialPitchScale,
Log log);
~R2Stretcher();
void reset();
@@ -174,7 +176,8 @@ protected:
bool m_realtime;
RubberBandStretcher::Options m_options;
int m_debugLevel;
Log m_log;
int m_debugLevel; //!!! to go once Log switch complete
enum ProcessMode {
JustCreated,
@@ -251,7 +254,7 @@ protected:
void writeOutput(RingBuffer<float> &to, float *from,
size_t qty, size_t &outCount, size_t theoreticalOut);
static int m_defaultDebugLevel;
static int m_defaultDebugLevel; //!!! to go
static const size_t m_defaultIncrement;
static const size_t m_defaultFftSize;
};