commit 9e3bde531c5d5c981c86e41526729870ed46e0cd
parent dbd7a19c219ae4f4b3e8d0556f4669880c9013a3
Author: fundamental <[email protected]>
Date: Sun, 7 Feb 2010 17:52:04 -0500
Effects: Removing Samples in unneeded locations
Looking back on it, it was just a bad idea
Diffstat:
18 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/src/Effects/Alienwah.cpp b/src/Effects/Alienwah.cpp
@@ -46,7 +46,7 @@ Alienwah::~Alienwah()
/*
* Apply the effect
*/
-void Alienwah::out(const Stereo<Sample> &smp)
+void Alienwah::out(const Stereo<float *> &smp)
{
REALTYPE lfol, lfor; //Left/Right LFOs
complex<REALTYPE> clfol, clfor, out, tmp;
diff --git a/src/Effects/Alienwah.h b/src/Effects/Alienwah.h
@@ -46,7 +46,7 @@ class Alienwah:public Effect
REALTYPE *const efxoutl_,
REALTYPE *const efxoutr_);
~Alienwah();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void setpreset(unsigned char npreset);
void changepar(int npar, unsigned char value);
diff --git a/src/Effects/Chorus.cpp b/src/Effects/Chorus.cpp
@@ -68,7 +68,7 @@ REALTYPE Chorus::getdelay(REALTYPE xlfo)
return result;
}
-void Chorus::out(const Stereo<Sample> &input)
+void Chorus::out(const Stereo<float *> &input)
{
const REALTYPE one = 1.0;
dl1 = dl2;
@@ -78,7 +78,7 @@ void Chorus::out(const Stereo<Sample> &input)
dl2 = getdelay(lfol);
dr2 = getdelay(lfor);
- for(int i = 0; i < input.l().size(); i++) {
+ for(int i = 0; i < SOUND_BUFFER_SIZE; i++) {
REALTYPE inl = input.l()[i];
REALTYPE inr = input.r()[i];
//LRcross
@@ -123,14 +123,14 @@ void Chorus::out(const Stereo<Sample> &input)
}
if(Poutsub != 0)
- for(int i = 0; i < input.l().size(); i++) {
+ for(int i = 0; i < SOUND_BUFFER_SIZE; i++) {
efxoutl[i] *= -1.0;
efxoutr[i] *= -1.0;
}
;
- for(int i = 0; i < input.l().size(); i++) {
+ for(int i = 0; i < SOUND_BUFFER_SIZE; i++) {
efxoutl[i] *= panning;
efxoutr[i] *= (1.0 - panning);
}
diff --git a/src/Effects/Chorus.h b/src/Effects/Chorus.h
@@ -37,7 +37,7 @@ class Chorus:public Effect
Chorus(const int &insetion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
/**Destructor*/
~Chorus();
- void out(const Stereo<Sample> &input);
+ void out(const Stereo<float *> &input);
void setpreset(unsigned char npreset);
/**
* Sets the value of the chosen variable
diff --git a/src/Effects/Distorsion.cpp b/src/Effects/Distorsion.cpp
@@ -260,7 +260,7 @@ void Distorsion::applyfilters(REALTYPE *efxoutl, REALTYPE *efxoutr)
/*
* Effect output
*/
-void Distorsion::out(const Stereo<Sample> &smp)
+void Distorsion::out(const Stereo<float *> &smp)
{
int i;
REALTYPE l, r, lout, rout;
@@ -270,7 +270,7 @@ void Distorsion::out(const Stereo<Sample> &smp)
inputvol *= -1.0;
if(Pstereo != 0) { //Stereo
- for(i = 0; i < smp.l().size(); i++) {
+ for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
efxoutl[i] = smp.l()[i] * inputvol * panning;
efxoutr[i] = smp.r()[i] * inputvol * (1.0 - panning);
}
diff --git a/src/Effects/Distorsion.h b/src/Effects/Distorsion.h
@@ -38,7 +38,7 @@ class Distorsion:public Effect
public:
Distorsion(const int &insertion, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
~Distorsion();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void setpreset(unsigned char npreset);
void changepar(int npar, unsigned char value);
unsigned char getpar(int npar) const;
diff --git a/src/Effects/DynamicFilter.cpp b/src/Effects/DynamicFilter.cpp
@@ -46,7 +46,7 @@ DynamicFilter::~DynamicFilter()
/*
* Apply the effect
*/
-void DynamicFilter::out(const Stereo<Sample> &smp)
+void DynamicFilter::out(const Stereo<float *> &smp)
{
int i;
if(filterpars->changed) {
diff --git a/src/Effects/DynamicFilter.h b/src/Effects/DynamicFilter.h
@@ -33,7 +33,7 @@ class DynamicFilter:public Effect
public:
DynamicFilter(int insetion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
~DynamicFilter();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void setpreset(unsigned char npreset);
void changepar(int npar, unsigned char value);
diff --git a/src/Effects/EQ.cpp b/src/Effects/EQ.cpp
@@ -53,7 +53,7 @@ void EQ::cleanup()
}
}
-void EQ::out(const Stereo<Sample> &smp)
+void EQ::out(const Stereo<float *> &smp)
{
int i;
for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
diff --git a/src/Effects/EQ.h b/src/Effects/EQ.h
@@ -33,7 +33,7 @@ class EQ:public Effect
public:
EQ(const int &insertion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
~EQ();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void setpreset(unsigned char npreset);
void changepar(int npar, unsigned char value);
unsigned char getpar(int npar) const;
diff --git a/src/Effects/Echo.cpp b/src/Effects/Echo.cpp
@@ -72,11 +72,11 @@ void Echo::initdelays()
delay.r() = Sample(dr, 0.0);
}
-void Echo::out(const Stereo<Sample> &input)
+void Echo::out(const Stereo<float *> &input)
{
REALTYPE ldl, rdl;
- for(int i = 0; i < input.l().size(); ++i) {
+ for(int i = 0; i < SOUND_BUFFER_SIZE; ++i) {
ldl = delay.l()[pos.l()];
rdl = delay.r()[pos.r()];
ldl = ldl * (1.0 - lrcross) + rdl * lrcross;
diff --git a/src/Effects/Echo.h b/src/Effects/Echo.h
@@ -25,8 +25,8 @@
#include "../globals.h"
#include "Effect.h"
-#include "../Samples/Sample.h"
#include "../Misc/Stereo.h"
+#include "../Samples/Sample.h"
#include "../Controls/DelayCtl.h"
/**Echo Effect*/
@@ -51,7 +51,7 @@ class Echo:public Effect
*/
~Echo();
- void out(const Stereo<Sample> &input);
+ void out(const Stereo<float *> &input);
/**
* Sets the state of Echo to the specified preset
diff --git a/src/Effects/Effect.cpp b/src/Effects/Effect.cpp
@@ -30,8 +30,5 @@ Effect::Effect(bool insertion_, REALTYPE *const efxoutl_,
{}
void Effect::out(REALTYPE *const smpsl, REALTYPE *const smpsr)
-{
- out(Stereo<Sample>(Sample(SOUND_BUFFER_SIZE, smpsl),
- Sample(SOUND_BUFFER_SIZE, smpsr)));
-}
+{};
diff --git a/src/Effects/Effect.h b/src/Effects/Effect.h
@@ -27,7 +27,6 @@
#include "../globals.h"
#include "../Params/FilterParams.h"
#include "../Misc/Stereo.h"
-#include "../Samples/Sample.h"
/**this class is inherited by the all effects(Reverb, Echo, ..)*/
@@ -74,7 +73,7 @@ class Effect
* @param smpsr Input buffer for the Right channel
*/
void out(REALTYPE *const smpsl, REALTYPE *const smpsr);
- virtual void out(const Stereo<Sample> &smp) = 0;
+ virtual void out(const Stereo<float *> &smp) = 0;
/**Reset the state of the effect*/
virtual void cleanup() {}
/**This is only used for EQ (for user interface)*/
@@ -85,7 +84,7 @@ class Effect
unsigned char Ppreset; /**<Currently used preset*/
REALTYPE *const efxoutl; /**<Effect out Left Channel*/
REALTYPE *const efxoutr; /**<Effect out Right Channel*/
- /**\todo make efxoutl and efxoutr private and replace them with a StereoSample*/
+ /**\todo make efxoutl and efxoutr private and replace them with a Stereo<float*>*/
REALTYPE outvolume;/**<This is the volume of effect and is public because
* it is needed in system effects.
diff --git a/src/Effects/Phaser.cpp b/src/Effects/Phaser.cpp
@@ -38,7 +38,7 @@ Phaser::~Phaser()
/*
* Effect output
*/
-void Phaser::out(const Stereo<Sample> &smp)
+void Phaser::out(const Stereo<float *> &smp)
{
int i, j;
REALTYPE lfol, lfor, lgain, rgain, tmp;
diff --git a/src/Effects/Phaser.h b/src/Effects/Phaser.h
@@ -35,7 +35,7 @@ class Phaser:public Effect
public:
Phaser(const int &insetion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
~Phaser();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void setpreset(unsigned char npreset);
void changepar(int npar, unsigned char value);
unsigned char getpar(int npar) const;
diff --git a/src/Effects/Reverb.cpp b/src/Effects/Reverb.cpp
@@ -165,7 +165,7 @@ void Reverb::processmono(int ch, REALTYPE *output)
/*
* Effect output
*/
-void Reverb::out(const Stereo<Sample> &smp)
+void Reverb::out(const Stereo<float *> &smp)
{
int i;
if((Pvolume == 0) && (insertion != 0))
diff --git a/src/Effects/Reverb.h b/src/Effects/Reverb.h
@@ -40,7 +40,7 @@ class Reverb:public Effect
public:
Reverb(const int &insertion_, REALTYPE *efxoutl_, REALTYPE *efxoutr_);
~Reverb();
- void out(const Stereo<Sample> &smp);
+ void out(const Stereo<float *> &smp);
void cleanup();
void setpreset(unsigned char npreset);