InOut.h

Go to the documentation of this file.
00001 //
00002 //  InOut.h -- copies the input buffer to the output buffer, possibly with channel remap and scaling
00003 // Constructor: InOut(UnitGenerator &, unsigned inChan, [unsigned outChan, ch-1 ... ch-outChan]);
00004 //
00005 //  See the copyright notice and acknowledgment of authors in the file COPYRIGHT
00006 //
00007 
00008 #ifndef CSL_InOut_H
00009 #define CSL_InOut_H
00010 
00011 #include "CSL_Core.h"
00012 #include <stdarg.h>     // for varargs
00013 
00014 namespace csl {
00015 
00016 #ifdef CSL_ENUMS
00017 typedef enum {
00018     kNoProc,        // tries to keep it mono or stereo if in_chans == out_chans
00019     kLR2M,          // mixes the L and R inputs down to a mono signal
00020     kL2M,           // Copies left input to make mono
00021     kR2M,           // Copies right input to make mono
00022     kN2M,           // Copies N-channel input to M-channel output using a map
00023 } InOutFlags;
00024 #else
00025     #define kNoProc 0
00026     #define kLR2M 1
00027     #define kL2M 2
00028     #define kR2M 3
00029     #define kN2M 4
00030     typedef int InOutFlags;
00031 #endif
00032 
00036 
00037 class InOut : public Effect {
00038 public:
00040     InOut(IO * anIO, unsigned inChan, unsigned outChan, InOutFlags f );
00041     InOut(IO * anIO, unsigned inChan, unsigned outChan, InOutFlags f, ...);
00042     InOut(UnitGenerator & myInput, unsigned inChan, unsigned outChan, InOutFlags f);
00043     InOut(UnitGenerator & myInput, unsigned inChan, unsigned outChan, InOutFlags, ...);
00044     ~InOut();
00045 
00046     void setInChan(unsigned chan) { mInChan= chan; };           
00047     void setOutChan(unsigned chan) { mOutChan= chan; };
00048     unsigned getInChan(void) { return mInChan; };                   
00049     unsigned getOutChan(void) { return mOutChan; }; 
00050 
00051     void setChanMap(unsigned * chans);              
00052     void setChanGains(float * values);              
00053     void setGain(unsigned index, float value);      
00054 
00055     virtual void nextBuffer(Buffer & outputBuffer) throw (CException);
00056 
00057 private:
00058     IO * mIO;               
00059     BufferCMap mMap;        
00060     unsigned mInChan;       
00061     unsigned mOutChan;      
00062     InOutFlags mFlags;      //< copy/process flag
00063     float *mGains;          
00064 };
00065 
00066 }
00067 
00068 #endif

Generated on Sat Oct 17 14:12:31 2009 for CSL by  doxygen 1.4.5-20051010