HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AU_SoundManager.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: AU_SoundManager.h ( AU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __AU_SoundManager__
12 #define __AU_SoundManager__
13 
14 #include "AU_API.h"
15 #include "AU_Defines.h"
16 
17 class CL_Clip;
18 
20 {
21 public:
22 
24  ~AU_SoundManager();
25 
26  //
27  // General access methods
28  //
29 
30  void setMute(int onoff);
31  int getMute() const;
32  void setMono(int onoff);
33  int getMono() const;
34  void setLeftVolume(float volume);
35  float getLeftVolume() const;
36  void setRightVolume(float volume);
37  float getRightVolume() const;
38 
39 
40  //
41  // Test clip methods
42  //
43  // The test buffer allows you to load a test sound clip and
44  // play portions of it with resumable interruptions.
45  // Very similiar to a tape deck operation.
46  //
47 
48  int loadTest(const CL_Clip *clip, int rewind);
49  int unloadTest(void);
50 
51  int isTestActive(void) const;
52  int rewindTest(void);
53  int forwardTest(void);
54  void waitTestEnd(void);
55 
56  int setTestDirection(int dir); // -1=rev,0=stop,1=for
57  int setTestLoop(int yesno);
58 
59  int setTestFull(int yesno); // if no use range
60  void setTestRange(float min, float max);
61 
62  //
63  // Play methods
64  //
65  // The play buffer loads and plays a single uninterruptable sound clip
66  // It is mainly intended to play single sound effect files
67  //
68 
69  int playFile(const char *filename, float l, float r);
70  int isPlaying(void) const;
71 
72  //
73  // Scrub methods
74  //
75  // The scrub buffer loads a sound clip which can be sampled and
76  // scrubbed.
77  //
78 
79 
80  int loadScrub(const CL_Clip *clip);
81  int unloadScrub(void);
82  int isScrubbing(void) const;
83 
84  void scrubReset();
85  void setScrubRealTime(int level);
86  int getScrubRealTime() const;
87  void setScrubRepeat(int onoff);
88  int getScrubRepeat() const;
89  void setScrubSustain(float sustain);
90  float getScrubSustain() const;
91  void setScrubOffset(float offset);
92  float getScrubOffset() const;
93  void setScrubFrequency(int frequency);
94  int getScrubFrequency() const;
95  void setScrubDeltas(float fore, float back);
96  void getScrubDeltas(float &fore, float &back) const;
97  void setScrubIndex(float index);
98  float getScrubIndex() const;
99  void setScrubSmooth(int smooth);
100  int getScrubSmooth() const;
101  void setScrubReverse(bool is_reverse);
102  bool getScrubReverse() const;
103  void setScrubOneFrame(bool is_oneframe);
104  bool getScrubOneFrame() const;
105 
106  //
107  // Realtime methods
108  //
109 
110  int loadRealtime(const CL_Clip *clip, int start,int end,
111  float queue);
112  void startRealtime(int rate, int channels,float queue);
113  void stopRealtime();
114  int isRealtime(void) const;
115 
116  //
117  // Misc methods
118  //
119 
120  void getMaxLevel(float *l, float *r) const; // meter
121  void shutDown(); // unload test/scrub buffers
122  int isAUDeviceOpen() const;// query
123  void loseAUInterest() const;// reset
124  int obtainAUDevice() ; // get
125  int releaseAUDevice(); // release audio device
126 
127 protected:
128 
129 private:
130 
131  int sendAudioCommand(int command);
132  int loadFromClip(const CL_Clip *clip);
133  void loadSegmentFromClip(const CL_Clip *clip,
134  float *data[AU_MAX_CHANNELS],
135  int start, int end,
136  int &length);
137 
138 };
139 
140 
141 AU_API extern AU_SoundManager *AUgetSoundManager(); // Get sound interrupt ptr
142 
143 #endif
GT_API const UT_StringHolder filename
GLuint start
Definition: glcorearb.h:474
GLint level
Definition: glcorearb.h:107
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:133
#define AU_API
Definition: AU_API.h:10
GLuint GLuint end
Definition: glcorearb.h:474
GLintptr offset
Definition: glcorearb.h:664
AU_API AU_SoundManager * AUgetSoundManager()
GLboolean * data
Definition: glcorearb.h:130
virtual bool smooth(GA_AttributeOperand &d, GA_AttributeOperand &min, GA_AttributeOperand &max, GA_AttributeOperand &t) const
d = SYSsmooth(min, max, t);
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
GLuint index
Definition: glcorearb.h:785
GLboolean r
Definition: glcorearb.h:1221
const std::enable_if<!VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:129
#define AU_MAX_CHANNELS
Definition: AU_Defines.h:17
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794