00001
00002
00003
00004
00005
00006 #ifndef CSL_Mixer_H
00007 #define CSL_Mixer_H
00008
00009 #include "CSL_Core.h"
00010
00011 namespace csl {
00012
00019
00020 class Mixer : public UnitGenerator, public Scalable {
00021 public:
00022 Mixer();
00023 Mixer(unsigned chans);
00024 Mixer(UnitGenerator & mScale);
00025 Mixer(unsigned chans, UnitGenerator & mScale);
00026 virtual ~Mixer();
00027
00028 UGenVector getInputs(void) { return(mSources); };
00029 unsigned getNumInputs(void) { return(mSources.size()); };
00030
00031 void addInput(UnitGenerator & inp);
00032 void addInput(UnitGenerator * inp);
00033 void removeInput(UnitGenerator & inp);
00035 void nextBuffer(Buffer &outputBuffer) throw (CException);
00037 void dump();
00038
00039 protected:
00040 UGenVector mSources;
00041 Buffer mOpBuffer;
00042 void allocateOpBuffer(unsigned chans);
00043 };
00044
00052
00053 class Panner : public Effect, public Scalable {
00054 public:
00056 Panner();
00057 Panner(UnitGenerator &input);
00058 Panner(UnitGenerator &input, UnitGenerator &position);
00059 Panner(UnitGenerator &input, float position);
00060 Panner(UnitGenerator &input, UnitGenerator &position, UnitGenerator &litude);
00061 Panner(UnitGenerator &input, UnitGenerator &position, float amplitude);
00062 Panner(UnitGenerator &input, float position, float amplitude);
00063 ~Panner();
00065 void setPosition(UnitGenerator &pan);
00066 void setPosition(float pan);
00067 virtual unsigned numChannels() const { return 2; };
00068
00069 virtual void nextBuffer(Buffer &outputBuffer) throw (CException);
00070 };
00071
00072 #ifdef NOT_PORTED_YET
00073
00074
00075
00076 #define MAX_OUTPUTS 16
00077
00078 class NtoMPanner : public Panner {
00079
00080 protected:
00081 unsigned mInCh, mOutCh;
00082 CPoint ** mSpeakers;
00083 SampleStream * mPosY;
00084 float mSpread;
00085 Buffer mOpBuffer;
00086 void initSpeakers(void);
00087
00088 public:
00089
00090
00091 NtoMPanner() : Panner() { };
00092 NtoMPanner(UnitGenerator & i, float a, unsigned in_c, unsigned out_c);
00093 NtoMPanner(UnitGenerator & i, SampleStream & pX, SampleStream & pY, SampleStream & a, unsigned in_c, unsigned out_c);
00094 NtoMPanner(UnitGenerator & i, SampleStream & pX, SampleStream & pY, SampleStream & a, unsigned in_c, unsigned out_c, float spr);
00095 NtoMPanner(UnitGenerator & i, SampleStream & pX, SampleStream & pY, float a, unsigned in_c, unsigned out_c, float spr);
00096 ~NtoMPanner();
00097
00098 void init_stereo(float dist);
00099 void init_quad(float dist);
00100 void init_5point1(float dist);
00101 void init_6ch(float x, float y);
00102
00103 void setX(float x) { _pos->set_value(x); };
00104 void setY(float y) { _posY->set_value(y); };
00105
00106 virtual void nextBuffer(Buffer &outputBuffer) throw (CException);
00107 };
00108
00109
00110
00111 class StereoWidth : public Effect {
00112
00113 protected:
00114 float mWidth;
00115 float mGain;
00116 float mPan;
00117
00118 public:
00119
00120 StereoWidth ();
00121 ~StereoWidth();
00122
00123 void set_width(float width) { _width = width; }
00124 void set_pan(float pan) { _pan = pan; }
00125 void set_gain(float gain) { _gain = gain; }
00126
00127 status next_buffer(Buffer & inputBuffer, Buffer & outputBuffer);
00128 };
00129
00130 #endif NOT_PORTED_YET
00131
00132 }
00133
00134 #endif
00135