DI-Guy SDK Documentation  13.6
diguySoundInstance.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2022 MAK Technologies, Inc.
4  ** All rights reserved.
5  *********************************************************************/
6 
7 
8 /*********************************************************************
9  **
10  *t diguySoundInstance
11  **
12  */
13 
14 #ifndef __diguySoundInstance_H
15 #define __diguySoundInstance_H
16 
17 
18 #ifdef SWIG
19 %module diguySoundInstance
20 #else
21 #define CPLUSPLUS_ONLY
22 #endif
23 
24 #ifdef CPLUSPLUS_ONLY
25 class bdiSoundInstance;
26 class bdiScenarioCharacter;
27 #endif
28 
29 
30 #include <declspec_diguy.h>
31 
32 /****************************************************************************/
33 class BDI_DECLSPEC_diguy diguySoundInstance
34 {
35 
36 public:
37 
38  /*l
39  **
40  *b Returns:
41  **
42  ** name of the sound used by the sound instance.
43  **
44  *b Callable From:
45  **
46  *- - C++
47  *- - Script
48  */
49  const char* get_name();
50 
51  /*l
52  *b Returns:
53  **
54  ** type name of the object; this value will never be NULL
55  **
56  *b Callable From:
57  **
58  *- - C++
59  *- - Script
60  */
61  const char* get_type_name();
62 
63  /*l
64  *b Description:
65  **
66  ** This function causes the sound to play immediately, starting from
67  ** the specified time offset. The sound will continue until it has
68  ** completed, or it is stopped.
69  **
70  *b Returns:
71  **
72  ** 0 on success, -1 on failure
73  **
74  *b Callable From:
75  **
76  *- - C++
77  *- - Script
78  */
79  int play(double offset = 0.0);
80 
81  /*l
82  *b Returns:
83  **
84  ** 1 if the sound is playing; 0 if not
85  **
86  *b Callable From:
87  **
88  *- - C++
89  *- - Script
90  */
91  int get_is_playing();
92 
93  /*l
94  *b Returns:
95  **
96  ** 1 if the sound is stopping; 0 if not
97  **
98  *b Callable From:
99  **
100  *- - C++
101  *- - Script
102  */
103  int get_is_stopping();
104 
105  /*l
106  *b Description:
107  **
108  ** This function causes this sound to stop. It does not destroy the
109  ** sound instance. The sound instance can be played again if desired.
110  **
111  *b Arguments
112  **
113  *a rampdown_time - how long to take fading out the sound
114  **
115  ** *b Returns:
116  **
117  ** 0 on success, -1 on failure
118  **
119  *b Callable From:
120  **
121  *- - C++
122  *- - Script
123  */
124  int stop(float rampdown_time = 0.0f);
125 
126  /*l
127  *b Description:
128  **
129  ** This function causes the sound instance to be automatically
130  ** deleted when the sound has completed. No further calls
131  ** through the diguySoundInstance object can or should
132  ** be made, so this function should only be called once all
133  ** durations, reps, etc. have been set.
134  **
135  *b Returns:
136  **
137  ** 0 on success, -1 on failure
138  **
139  *b Callable From:
140  **
141  *- - C++
142  *- - Script
143  */
144  int set_automatic_destroy_flag();
145 
146  /*l
147  *b Description:
148  **
149  ** This function sets whether the sound is "ambient" (it will
150  ** be equally audible from everywhere within the world), or
151  ** "3d" (it will move with the character.
152  **
153  *b Arguments
154  **
155  *a is_3d_sound_flag - pass 1 to make the sound 3d; pass 0 to make
156  *a the sound ambient
157  **
158  *b Callable From:
159  **
160  *- - C++
161  *- - Script
162  */
163  void set_is_3d_sound_flag(int is_3d_sound_flag);
164 
165  /*l
166  *b Returns:
167  **
168  ** 1 if the sound is 3d; 0 if not
169  **
170  *b Callable From:
171  **
172  *- - C++
173  *- - Script
174  */
175  int get_is_3d_sound_flag();
176 
177 
182 #ifdef CPLUSPLUS_ONLY
183 
184  bdiSoundInstance* get_scripted_object() {return m_scripted_object;}
185 
186 private:
187 
188  void clear_scripted_object() {m_scripted_object = NULL;}
189  /*l
190  ** A private constructor.
191  */
192  diguySoundInstance(bdiSoundInstance* scripted_object,
193  bdiScenarioCharacter* character);
195  /*l
196  ** A private destructor.
197  */
198  virtual ~diguySoundInstance();
199 
200  /*l
201  ** A pointer to internal data.
202  */
203  bdiSoundInstance* m_scripted_object;
204  bdiScenarioCharacter* m_character;
205 
206  friend class bdiScenarioCharacter;
207  friend class bdiSoundInstance;
208  friend class bdiSoundFactory;
209  friend class bdiSoundFactoryOpenAL;
210 #endif
211 
212 };
213 
214 #endif /* __diguySoundInstance_H */
215 
Definition: diguySoundInstance.h:29