C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguySoundInstance.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 1992-2013 Boston Dynamics
4  * ALL RIGHTS RESERVED.
5  *
6  * These coded instructions, statements, and computer programs
7  * contain unpublished proprietary information of Boston Dynamics
8  * and are protected by Copyright Laws of the United States.
9  * They may not be used, duplicated, or disclosed in any form, in
10  * whole or in part, without the prior written consent from Boston
11  * Dynamics.
12  *
13  * RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the government is subject
15  * to restrictions as set forth in FAR 52.227.19(c)(2) or
16  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
17  * Computer Software clause at DFARS 252.227-7013 and/or in
18  * similar or successor clauses in the FAR, or the DOD or NASA
19  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
20  * Commercial Computer Software--Restricted Rights at 48 CFR
21  * 52.227-19, as applicable. Unpublished-rights reserved under
22  * the Copyright Laws of the United States.
23  * Contractor/Manufacturer is:
24  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
25  */
26 
27 
28 /*********************************************************************
29  **
30  *t diguySoundInstance
31  **
32  */
33 
34 #ifndef __diguySoundInstance_H
35 #define __diguySoundInstance_H
36 
37 
38 #ifdef SWIG
39 %module diguySoundInstance
40 #else
41 #define CPLUSPLUS_ONLY
42 #endif
43 
44 #ifdef CPLUSPLUS_ONLY
45 class bdiSoundInstance;
46 class bdiScenarioCharacter;
47 #endif
48 
49 
50 #include <declspec_diguy.h>
51 
52 /****************************************************************************/
53 class BDI_DECLSPEC_diguy diguySoundInstance
54 {
55 
56 public:
57 
58  /*l
59  **
60  *b Returns:
61  **
62  ** name of the sound used by the sound instance.
63  **
64  *b Callable From:
65  **
66  *- - C++
67  *- - Script
68  */
69  const char* get_name();
70 
71  /*l
72  *b Returns:
73  **
74  ** type name of the object; this value will never be NULL
75  **
76  *b Callable From:
77  **
78  *- - C++
79  *- - Script
80  */
81  const char* get_type_name();
82 
83  /*l
84  *b Description:
85  **
86  ** This function causes the sound to play immediately, starting from
87  ** the specified time offset. The sound will continue until it has
88  ** completed, or it is stopped.
89  **
90  *b Returns:
91  **
92  ** 0 on success, -1 on failure
93  **
94  *b Callable From:
95  **
96  *- - C++
97  *- - Script
98  */
99  int play(double offset = 0.0);
100 
101  /*l
102  *b Returns:
103  **
104  ** 1 if the sound is playing; 0 if not
105  **
106  *b Callable From:
107  **
108  *- - C++
109  *- - Script
110  */
111  int get_is_playing();
112 
113  /*l
114  *b Returns:
115  **
116  ** 1 if the sound is stopping; 0 if not
117  **
118  *b Callable From:
119  **
120  *- - C++
121  *- - Script
122  */
123  int get_is_stopping();
124 
125  /*l
126  *b Description:
127  **
128  ** This function causes this sound to stop. It does not destroy the
129  ** sound instance. The sound instance can be played again if desired.
130  **
131  *b Arguments
132  **
133  *a rampdown_time - how long to take fading out the sound
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 stop(float rampdown_time = 0.0f);
145 
146  /*l
147  *b Description:
148  **
149  ** This function causes the sound instance to be automatically
150  ** deleted when the sound has completed. No further calls
151  ** through the diguySoundInstance object can or should
152  ** be made, so this function should only be called once all
153  ** durations, reps, etc. have been set.
154  **
155  *b Returns:
156  **
157  ** 0 on success, -1 on failure
158  **
159  *b Callable From:
160  **
161  *- - C++
162  *- - Script
163  */
164  int set_automatic_destroy_flag();
165 
166  /*l
167  *b Description:
168  **
169  ** This function sets whether the sound is "ambient" (it will
170  ** be equally audible from everywhere within the world), or
171  ** "3d" (it will move with the character.
172  **
173  *b Arguments
174  **
175  *a is_3d_sound_flag - pass 1 to make the sound 3d; pass 0 to make
176  *a the sound ambient
177  **
178  *b Callable From:
179  **
180  *- - C++
181  *- - Script
182  */
183  void set_is_3d_sound_flag(int is_3d_sound_flag);
184 
185  /*l
186  *b Returns:
187  **
188  ** 1 if the sound is 3d; 0 if not
189  **
190  *b Callable From:
191  **
192  *- - C++
193  *- - Script
194  */
195  int get_is_3d_sound_flag();
196 
197 
202 #ifdef CPLUSPLUS_ONLY
203 
204  bdiSoundInstance* get_scripted_object() {return m_scripted_object;}
205 
206 private:
207 
208  void clear_scripted_object() {m_scripted_object = NULL;}
209  /*l
210  ** A private constructor.
211  */
212  diguySoundInstance(bdiSoundInstance* scripted_object,
213  bdiScenarioCharacter* character);
215  /*l
216  ** A private destructor.
217  */
218  virtual ~diguySoundInstance();
219 
220  /*l
221  ** A pointer to internal data.
222  */
223  bdiSoundInstance* m_scripted_object;
224  bdiScenarioCharacter* m_character;
225 
226  friend class bdiScenarioCharacter;
227  friend class bdiSoundInstance;
228  friend class bdiSoundFactory;
229  friend class bdiSoundFactoryOpenAL;
230 #endif
231 
232 };
233 
234 #endif /* __diguySoundInstance_H */
235