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

Generated on Thu Sep 17 23:14:15 2009 for CSL by  doxygen 1.5.8