00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __AU_SoundManager__
00020 #define __AU_SoundManager__
00021
00022 #include "AU_API.h"
00023 #include "AU_Defines.h"
00024
00025 class CL_Clip;
00026
00027 class AU_API AU_SoundManager
00028 {
00029 public:
00030
00031 AU_SoundManager();
00032 ~AU_SoundManager();
00033
00034
00035
00036
00037
00038 void setMute(int onoff);
00039 int getMute() const;
00040 void setMono(int onoff);
00041 int getMono() const;
00042 void setLeftVolume(float volume);
00043 float getLeftVolume() const;
00044 void setRightVolume(float volume);
00045 float getRightVolume() const;
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 int loadTest(const CL_Clip *clip, int rewind);
00057 int unloadTest(void);
00058
00059 int isTestActive(void) const;
00060 int rewindTest(void);
00061 int forwardTest(void);
00062 void waitTestEnd(void);
00063
00064 int setTestDirection(int dir);
00065 int setTestLoop(int yesno);
00066
00067 int setTestFull(int yesno);
00068 void setTestRange(float min, float max);
00069
00070
00071
00072
00073
00074
00075
00076
00077 int playFile(const char *filename, float l, float r);
00078 int isPlaying(void) const;
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 int loadScrub(const CL_Clip *clip);
00089 int unloadScrub(void);
00090 int isScrubbing(void) const;
00091
00092 void scrubReset();
00093 void setScrubRealTime(int level);
00094 int getScrubRealTime() const;
00095 void setScrubRepeat(int onoff);
00096 int getScrubRepeat() const;
00097 void setScrubSustain(float sustain);
00098 float getScrubSustain() const;
00099 void setScrubOffset(float offset);
00100 float getScrubOffset() const;
00101 void setScrubFrequency(int frequency);
00102 int getScrubFrequency() const;
00103 void setScrubDeltas(float fore, float back);
00104 void getScrubDeltas(float &fore, float &back) const;
00105 void setScrubIndex(float index);
00106 float getScrubIndex() const;
00107 void setScrubSmooth(int smooth);
00108 int getScrubSmooth() const;
00109 void setScrubReverse(bool is_reverse);
00110 bool getScrubReverse() const;
00111 void setScrubOneFrame(bool is_oneframe);
00112 bool getScrubOneFrame() const;
00113
00114
00115
00116
00117
00118 int loadRealtime(const CL_Clip *clip, int start,int end,
00119 float queue);
00120 void startRealtime(int rate, int channels,float queue);
00121 void stopRealtime();
00122 int isRealtime(void) const;
00123
00124
00125
00126
00127
00128 void getMaxLevel(float *l, float *r) const;
00129 void shutDown();
00130 int isAUDeviceOpen() const;
00131 void loseAUInterest() const;
00132 int obtainAUDevice() ;
00133 int releaseAUDevice();
00134
00135 protected:
00136
00137 private:
00138
00139 int sendAudioCommand(int command);
00140 int loadFromClip(const CL_Clip *clip);
00141 void loadSegmentFromClip(const CL_Clip *clip,
00142 float *data[AU_MAX_CHANNELS],
00143 int start, int end,
00144 int &length);
00145
00146 };
00147
00148
00149 AU_API extern AU_SoundManager *AUgetSoundManager();
00150
00151 #endif