00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __AU_Input__
00020 #define __AU_Input__
00021
00022 #include "AU_API.h"
00023 #include <UT/UT_AudioInput.h>
00024
00025 #define AU_MAX_VOL_CHANNELS 4
00026
00027
00028 #if defined(WIN32)
00029 #include "AU_System.h"
00030 class AU_API AU_Input : public UT_AudioInput, public AU_System
00031 #elif defined(MBSD)
00032 class AU_MBSDUtilAudioInfo;
00033
00034 class AU_API AU_Input : public UT_AudioInput
00035 #else
00036 #ifdef IRIX6
00037 #include <dmedia/audio.h>
00038 #else
00039 #include <audio.h>
00040 #endif
00041
00042 class AU_API AU_Input : public UT_AudioInput
00043 #endif
00044 {
00045 public:
00046
00047 AU_Input(int channels, int rate);
00048 virtual ~AU_Input();
00049
00050 virtual int open(float queuesize);
00051 virtual void close();
00052
00053 virtual int hasInput();
00054 virtual short * getInput(int size);
00055
00056 virtual int getGlobalRate();
00057
00058 virtual int setSource(int source);
00059 virtual int getSource();
00060
00061 virtual int setMicrophoneMode(int stereo);
00062 virtual int getMicrophoneMode();
00063 virtual int getChannelMode();
00064
00065 virtual int setVolume(int speaker, float vol);
00066 virtual float getVolume(int speaker);
00067
00068 virtual UT_AudioInput * newAudioInputDevice(int channels, int rate);
00069
00070 private:
00071 #ifdef WIN32
00072
00073 void appendWaveHeader(int pos);
00074
00075 void applyVolume(char *data, int bytesPerChannel);
00076
00077
00078 int mySource;
00079
00080 int myBlockSize;
00081
00082 int myBlockOffset;
00083
00084 float myVolumes[4];
00085
00086 #elif defined(MBSD)
00087
00088 void applyVolume(char *data, int data_size );
00089
00090 AU_MBSDUtilAudioInfo * myInfo;
00091 int myRate;
00092 int myChannels;
00093 int mySource;
00094 float myVolumes[ AU_MAX_VOL_CHANNELS ];
00095
00096 #else
00097 void adjustRate(int read);
00098
00099 ALport myPort;
00100 short *myOverrunBuffer;
00101 int myRate;
00102 int myChannels;
00103 int myMode;
00104 int myIsOpen;
00105 #endif
00106 };
00107
00108 #endif