00001 // 00002 // CAIO.h -- DAC IO using CoreAudio 00003 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT 00004 // 00005 00006 #ifndef CSL_CAIO_H 00007 #define CSL_CAIO_H 00008 00009 #include "CSL_Core.h" 00010 00011 #include <AudioUnit/AudioUnit.h> 00012 00013 namespace csl { 00014 00015 class AUIO : public IO { 00016 public: 00017 AUIO(); 00018 ~AUIO(); 00019 00020 virtual void open() throw(CException); 00021 virtual void close() throw(CException); 00022 virtual void start() throw(CException); 00023 virtual void stop() throw(CException); 00024 00025 virtual Buffer & getInput() throw(CException); 00026 virtual Buffer & getInput(unsigned numFrames, unsigned numChannels) throw(CException); 00027 00028 void setAudioUnit(AudioUnit au) { mAudioUnit = au; }; 00029 00030 protected: 00031 // The AudioUnit we play out 00032 AudioUnit mAudioUnit; 00033 void handleError(OSStatus result) throw(CException); 00034 00035 }; 00036 00037 class CAIO : public AUIO { 00038 public: 00039 CAIO(); 00040 ~CAIO(); 00041 00042 virtual void open() throw(CException); 00043 virtual void close() throw(CException); 00044 virtual void start() throw(CException); 00045 virtual void stop() throw(CException); 00046 00047 // virtual Buffer & getInput() throw(CException); ///< get the current input buffer 00048 // virtual Buffer & getInput(unsigned numFrames, unsigned numChannels) throw(CException); ///< get the current input buffer 00049 00050 protected: 00051 void handleError(OSStatus result) throw(CException); 00052 00053 }; 00054 00055 } 00056 00057 #endif 00058
1.4.5-20051010