Skip to content

Commit

Permalink
Merge branch 'master' into features_effects
Browse files Browse the repository at this point in the history
Conflicts:
	src/engine/enginedeck.cpp
	src/engine/enginedeck.h
	src/engine/enginefiltereffect.cpp
	src/engine/enginefiltereffect.h
	src/engine/engineflanger.cpp
	src/engine/engineflanger.h
	src/engine/enginemaster.cpp
	src/engine/enginemaster.h
  • Loading branch information
rryan committed Dec 19, 2013
2 parents a8eada9 + 32fbf6f commit edb2e43
Show file tree
Hide file tree
Showing 56 changed files with 248 additions and 280 deletions.
2 changes: 1 addition & 1 deletion src/engine/clockcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ControlObjectSlave;
class ClockControl: public EngineControl {
Q_OBJECT
public:
ClockControl(const char * pGroup,
ClockControl(const char* pGroup,
ConfigObject<ConfigValue>* pConfig);

virtual ~ClockControl();
Expand Down
4 changes: 2 additions & 2 deletions src/engine/cuecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "cachingreader.h"
#include "mathstuff.h"

CueControl::CueControl(const char * _group,
ConfigObject<ConfigValue> * _config) :
CueControl::CueControl(const char* _group,
ConfigObject<ConfigValue>* _config) :
EngineControl(_group, _config),
m_bHotcueCancel(false),
m_bPreviewing(false),
Expand Down
4 changes: 2 additions & 2 deletions src/engine/cuecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class HotcueControl : public QObject {
class CueControl : public EngineControl {
Q_OBJECT
public:
CueControl(const char * _group,
ConfigObject<ConfigValue> * _config);
CueControl(const char* _group,
ConfigObject<ConfigValue>* _config);
virtual ~CueControl();

virtual void hintReader(QVector<Hint>* pHintList);
Expand Down
7 changes: 3 additions & 4 deletions src/engine/enginebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ double EngineBuffer::getFileBpm() {
return m_pBpmControl->getFileBpm();
}

void EngineBuffer::setEngineMaster(EngineMaster * pEngineMaster) {
void EngineBuffer::setEngineMaster(EngineMaster* pEngineMaster) {
m_engineLock.lock();
foreach (EngineControl* pControl, m_engineControls) {
pControl->setEngineMaster(pEngineMaster);
Expand Down Expand Up @@ -399,7 +399,7 @@ void EngineBuffer::setNewPlaypos(double newpos) {
m_engineLock.unlock();
}

const char * EngineBuffer::getGroup()
const char* EngineBuffer::getGroup()
{
return m_group;
}
Expand Down Expand Up @@ -581,7 +581,7 @@ void EngineBuffer::slotControlSlip(double v)
}


void EngineBuffer::process(const CSAMPLE *, const CSAMPLE * pOut, const int iBufferSize)
void EngineBuffer::process(const CSAMPLE*, CSAMPLE* pOutput, const int iBufferSize)
{
Q_ASSERT(even(iBufferSize));
m_pReader->process();
Expand All @@ -595,7 +595,6 @@ void EngineBuffer::process(const CSAMPLE *, const CSAMPLE * pOut, const int iBuf
// - Set last sample value (m_fLastSampleValue) so that rampOut works? Other
// miscellaneous upkeep issues.

CSAMPLE * pOutput = (CSAMPLE *)pOut; // strip const attribute TODO(XXX): avoid this hack
bool bCurBufferPaused = false;
double rate = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/engine/enginebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ const int ENGINE_RAMP_UP = 1;

class EngineBuffer : public EngineObject {
Q_OBJECT
public:
EngineBuffer(const char *_group, ConfigObject<ConfigValue> *_config,
public:
EngineBuffer(const char* _group, ConfigObject<ConfigValue>* _config,
EngineChannel* pChannel, EngineMaster* pMixingEngine);
virtual ~EngineBuffer();
bool getPitchIndpTimeStretch(void);
Expand All @@ -118,7 +118,7 @@ class EngineBuffer : public EngineObject {
// while holding the pause mutex
void setNewPlaypos(double playpos);

void process(const CSAMPLE *pIn, const CSAMPLE *pOut, const int iBufferSize);
void process(const CSAMPLE* pIn, CSAMPLE* pOut, const int iBufferSize);

void processSlip(int iBufferSize);

Expand Down
4 changes: 2 additions & 2 deletions src/engine/enginebufferscale.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ class EngineBufferScale : public QObject {
/** Called from EngineBuffer when seeking, to ensure the buffers are flushed */
virtual void clear() = 0;
/** Scale buffer */
virtual CSAMPLE *getScaled(unsigned long buf_size) = 0;
virtual CSAMPLE* getScaled(unsigned long buf_size) = 0;

protected:
int m_iSampleRate;
double m_dRateAdjust;
double m_dTempoAdjust;
double m_dPitchAdjust;
/** Pointer to internal buffer */
CSAMPLE *m_buffer;
CSAMPLE* m_buffer;
/** New playpos after call to scale */
double m_samplesRead;
};
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginebufferscaledummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void EngineBufferScaleDummy::clear()
}


CSAMPLE *EngineBufferScaleDummy::getScaled(unsigned long buf_size) {
CSAMPLE* EngineBufferScaleDummy::getScaled(unsigned long buf_size) {
m_samplesRead = 0.0;
double rate = m_dRateAdjust * m_dTempoAdjust * m_dPitchAdjust;
if (rate == 0.0f) {
Expand Down
10 changes: 5 additions & 5 deletions src/engine/enginebufferscaledummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
#ifndef ENGINEBUFFERSCALEDUMMY_H
#define ENGINEBUFFERSCALEDUMMY_H

#include "defs.h"
#include <QObject>

#include "defs.h"
#include "engine/enginebufferscale.h"

class ReadAheadManager;

class EngineBufferScaleDummy : public EngineBufferScale
{
public:
class EngineBufferScaleDummy : public EngineBufferScale {
public:
EngineBufferScaleDummy(ReadAheadManager* pReadAheadManager);
~EngineBufferScaleDummy();
virtual ~EngineBufferScaleDummy();

/** Get new playpos after call to scale() */
double getNewPlaypos();
Expand Down
6 changes: 3 additions & 3 deletions src/engine/enginebufferscalelinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ inline float hermite4(float frac_pos, float xm1, float x0, float x1, float x2)

/** Determine if we're changing directions (scratching) and then perform
a stretch */
CSAMPLE * EngineBufferScaleLinear::getScaled(unsigned long buf_size) {
CSAMPLE* EngineBufferScaleLinear::getScaled(unsigned long buf_size) {
if (m_bClear) {
m_dOldRate = m_dRate; // If cleared, don't interpolate rate.
m_bClear = false;
Expand Down Expand Up @@ -159,8 +159,8 @@ CSAMPLE * EngineBufferScaleLinear::getScaled(unsigned long buf_size) {
}

/** Stretch a specified buffer worth of audio using linear interpolation */
CSAMPLE * EngineBufferScaleLinear::do_scale(CSAMPLE* buf,
unsigned long buf_size, int* samples_read) {
CSAMPLE* EngineBufferScaleLinear::do_scale(CSAMPLE* buf,
unsigned long buf_size, int* samples_read) {
float rate_add_old = m_dOldRate;
float rate_add_new = m_dRate;
float rate_add_diff = rate_add_new - rate_add_old;
Expand Down
15 changes: 8 additions & 7 deletions src/engine/enginebufferscalelinear.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef ENGINEBUFFERSCALELINEAR_H
#define ENGINEBUFFERSCALELINEAR_H

#include "enginebufferscale.h"
#include "readaheadmanager.h"
#include "engine/enginebufferscale.h"
#include "engine/readaheadmanager.h"

/**
*@author Tue & Ken Haste Andersen
Expand All @@ -31,10 +31,11 @@ const int kiLinearScaleReadAheadLength = 10240;


class EngineBufferScaleLinear : public EngineBufferScale {
public:
public:
EngineBufferScaleLinear(ReadAheadManager *pReadAheadManager);
~EngineBufferScaleLinear();
CSAMPLE *getScaled(unsigned long buf_size);
virtual ~EngineBufferScaleLinear();

CSAMPLE* getScaled(unsigned long buf_size);
void clear();

void setScaleParameters(int iSampleRate,
Expand All @@ -43,7 +44,7 @@ class EngineBufferScaleLinear : public EngineBufferScale {
double* pitch_adjust);

private:
CSAMPLE *do_scale(CSAMPLE* buf, unsigned long buf_size,
CSAMPLE* do_scale(CSAMPLE* buf, unsigned long buf_size,
int *samples_read);

/** Holds playback direction */
Expand All @@ -53,7 +54,7 @@ class EngineBufferScaleLinear : public EngineBufferScale {
double m_dOldRate;

/** Buffer for handling calls to ReadAheadManager */
CSAMPLE *buffer_int;
CSAMPLE* buffer_int;
int buffer_int_size;
CSAMPLE m_fPrevSample[2];
// The read-ahead manager that we use to fetch samples
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginebufferscalest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* *
***************************************************************************/

#include "enginebufferscalest.h"
#include "engine/enginebufferscalest.h"

// Fixes redefinition warnings from SoundTouch.
#undef TRUE
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginebufferscalest.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class EngineBufferScaleST : public EngineBufferScale {
bool m_bBackwards;

// Temporary buffer for reading from the RAMAN.
CSAMPLE *buffer_back;
CSAMPLE* buffer_back;

// SoundTouch time/pitch scaling lib
soundtouch::SoundTouch* m_pSoundTouch;
Expand Down
6 changes: 3 additions & 3 deletions src/engine/enginechannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef ENGINECHANNEL_H
#define ENGINECHANNEL_H

#include "engineobject.h"
#include "engine/engineobject.h"
#include "configobject.h"

class ControlObject;
Expand All @@ -39,7 +39,7 @@ class EngineChannel : public EngineObject {
RIGHT,
};

EngineChannel(const char *pGroup, ChannelOrientation defaultOrientation = CENTER);
EngineChannel(const char* pGroup, ChannelOrientation defaultOrientation = CENTER);
virtual ~EngineChannel();

virtual ChannelOrientation getOrientation() const;
Expand All @@ -49,7 +49,7 @@ class EngineChannel : public EngineObject {
virtual bool isPFL();
virtual bool isMaster();

virtual void process(const CSAMPLE *pIn, const CSAMPLE *pOut, const int iBufferSize) = 0;
virtual void process(const CSAMPLE* pIn, CSAMPLE* pOut, const int iBufferSize) = 0;

// TODO(XXX) This hack needs to be removed.
virtual EngineBuffer* getEngineBuffer() {
Expand Down
5 changes: 2 additions & 3 deletions src/engine/engineclipping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "controlpotmeter.h"
#include "sampleutil.h"

EngineClipping::EngineClipping(const char * group)
EngineClipping::EngineClipping(const char* group)
{
//Used controlpotmeter as the example used it :/ perhaps someone with more knowledge could use something more suitable...
m_ctrlClipping = new ControlPotmeter(ConfigKey(group, "PeakIndicator"), 0., 1.);
Expand All @@ -31,12 +31,11 @@ EngineClipping::~EngineClipping()
delete m_ctrlClipping;
}

void EngineClipping::process(const CSAMPLE * pIn, const CSAMPLE * pOut, const int iBufferSize)
void EngineClipping::process(const CSAMPLE* pIn, CSAMPLE* pOutput, const int iBufferSize)
{
static const FLOAT_TYPE kfMaxAmp = 32767.;
// static const FLOAT_TYPE kfClip = 0.8*kfMaxAmp;

CSAMPLE * pOutput = (CSAMPLE *)pOut;
// SampleUtil clamps the buffer and if pIn and pOut are aliased will not copy.
clipped = SampleUtil::copyClampBuffer(kfMaxAmp, -kfMaxAmp,
pOutput, pIn, iBufferSize);
Expand Down
38 changes: 11 additions & 27 deletions src/engine/engineclipping.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,22 @@
#ifndef ENGINECLIPPING_H
#define ENGINECLIPPING_H

#include "engineobject.h"
#include "engine/engineobject.h"
#include "controlpotmeter.h"

class EngineClipping : public EngineObject
{
private:
class EngineClipping : public EngineObject {
Q_OBJECT
public:
EngineClipping(const char* group);
virtual ~EngineClipping();

void process(const CSAMPLE* pIn, CSAMPLE* pOut, const int iBufferSize);
bool hasClipped();

private:
bool clipped;
ControlPotmeter *m_ctrlClipping;
int m_duration;
public:
EngineClipping(const char *group);
~EngineClipping();
void process(const CSAMPLE *pIn, const CSAMPLE *pOut, const int iBufferSize);
bool hasClipped();
};

#endif // ENGINECLIPPING_H


















10 changes: 5 additions & 5 deletions src/engine/enginecontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "engine/enginebuffer.h"
#include "playermanager.h"

EngineControl::EngineControl(const char * _group,
ConfigObject<ConfigValue> * _config)
EngineControl::EngineControl(const char* _group,
ConfigObject<ConfigValue>* _config)
: m_pGroup(_group),
m_pConfig(_config),
m_dTotalSamples(0),
Expand All @@ -21,9 +21,9 @@ EngineControl::~EngineControl() {
}

double EngineControl::process(const double,
const double,
const double,
const int) {
const double,
const double,
const int) {
return kNoTrigger;
}

Expand Down
4 changes: 2 additions & 2 deletions src/engine/enginecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const double kNoTrigger = -1;
class EngineControl : public QObject {
Q_OBJECT
public:
EngineControl(const char * _group,
ConfigObject<ConfigValue> * _config);
EngineControl(const char* _group,
ConfigObject<ConfigValue>* _config);
virtual ~EngineControl();

// Called by EngineBuffer::process every latency period. See the above
Expand Down
20 changes: 9 additions & 11 deletions src/engine/enginedeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
#include "controlpushbutton.h"
#include "effects/effectsmanager.h"
#include "engine/effects/engineeffectsmanager.h"
#include "enginebuffer.h"
#include "enginevinylsoundemu.h"
#include "enginedeck.h"
#include "engineclipping.h"
#include "enginepregain.h"
#include "enginefilterblock.h"
#include "enginevumeter.h"
#include "enginefilteriir.h"
#include "engine/enginebuffer.h"
#include "engine/enginevinylsoundemu.h"
#include "engine/enginedeck.h"
#include "engine/engineclipping.h"
#include "engine/enginepregain.h"
#include "engine/enginefilterblock.h"
#include "engine/enginevumeter.h"
#include "engine/enginefilteriir.h"

#include "sampleutil.h"

Expand Down Expand Up @@ -75,9 +75,7 @@ EngineDeck::~EngineDeck() {
delete m_pVUMeter;
}

void EngineDeck::process(const CSAMPLE*, const CSAMPLE * pOutput, const int iBufferSize) {
CSAMPLE* pOut = const_cast<CSAMPLE*>(pOutput);

void EngineDeck::process(const CSAMPLE*, CSAMPLE* pOut, const int iBufferSize) {
// Feed the incoming audio through if passthrough is active
if (isPassthroughActive()) {
int samplesRead = m_sampleBuffer.read(pOut, iBufferSize);
Expand Down
Loading

0 comments on commit edb2e43

Please sign in to comment.