Spinning Topp Logo BlackTopp Studios
inc
soundscapemanager.h
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _audiosoundscapemanager_h
41 #define _audiosoundscapemanager_h
42 
43 #include "worldmanager.h"
44 #include "managerfactory.h"
45 #include "Audio/audioenumerations.h"
46 #include "Threading/workunit.h"
47 
48 namespace Mezzanine
49 {
50  namespace Audio
51  {
52  class iListener;
53  class SoundProxy;
54 
55  ///////////////////////////////////////////////////////////////////////////////
56  /// @brief This is the work unit for updating audio buffers as necessary for audio playback.
57  /// @details
58  ///////////////////////////////////////
60  {
61  public:
62  /// @brief Class destructor.
64 
65  ///////////////////////////////////////////////////////////////////////////////
66  // Utility
67 
68  /// @brief This does any required updating of audio buffers belonging to sound proxies in this manager.
69  /// @param CurrentThreadStorage The storage class for all resources owned by this work unit during it's execution.
70  virtual void DoWork(Threading::DefaultThreadSpecificStorage::Type& CurrentThreadStorage) = 0;
71  };//iBufferUpdate3DWorkUnit
72 
73  ///////////////////////////////////////////////////////////////////////////////
74  /// @brief This is the base manager class for audio being played in a 3D environment.
75  /// @details
76  ///////////////////////////////////////
78  {
79  public:
80  protected:
81  public:
82  /// @brief Class constructor.
83  SoundScapeManager(World* Creator);
84  /// @brief XML constructor.
85  /// @param XMLNode The node of the xml document to construct from.
86  SoundScapeManager(World* Creator, XML::Node& XMLNode);
87  /// @brief Class destructor.
88  virtual ~SoundScapeManager();
89 
90  ///////////////////////////////////////////////////////////////////////////////
91  // Listener Management
92 
93  /// @brief Creates a new @ref iListener.
94  /// @return Returns a pointer to the @ref iListener instance that was created.
95  virtual iListener* CreateListener() = 0;
96  /// @brief Gets an @ref iListener instance by index.
97  /// @param Index The index of the @ref iListener to be retrieved.
98  /// @return Returns a pointer to the @ref iListener at the specified index.
99  virtual iListener* GetListener(const UInt32 Index) const = 0;
100  /// @brief Gets the number of @ref iListener instances in this manager.
101  /// @return Returns a UInt32 representing the number of @ref iListener instances contained in this manager.
102  virtual UInt32 GetNumListeners() const = 0;
103  /// @brief Deletes a @ref iListener.
104  /// @param ToBeDestroyed A pointer to the @ref iListener you want deleted.
105  virtual void DestroyListener(iListener* ToBeDestroyed) = 0;
106  /// @brief Deletes all stored @ref iListener instances.
107  virtual void DestroyAllListeners() = 0;
108 
109  ///////////////////////////////////////////////////////////////////////////////
110  // Proxy Management
111 
112  /// @brief Creates a blank @ref SoundProxy without a stream attached to it.
113  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
114  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
115  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
116  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, const Boole AddToWorld) = 0;
117  /// @brief Creates a new @ref SoundProxy from a custom stream that is encoded.
118  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
119  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
120  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
121  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
122  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
123  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, Resource::DataStreamPtr Stream, const Audio::Encoding Encode, const Boole AddToWorld) = 0;
124  /// @brief Creates a new @ref SoundProxy from a custom stream that is unencoded.
125  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
126  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
127  /// @param Frequency The frequency (or sample rate) of the audio data.
128  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
129  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
130  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
131  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, Resource::DataStreamPtr Stream, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld) = 0;
132  /// @brief Creates a new @ref SoundProxy from a file.
133  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
134  /// @param FileName The name of the file to read audio data from.
135  /// @param Group The resource group in which the file resides.
136  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
137  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
138  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, const String& FileName, const String& Group, const Boole AddToWorld) = 0;
139  /// @brief Creates a new @ref SoundProxy from a memory buffer that is encoded.
140  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
141  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
142  /// @param StreamName The name to be given to the stream being created.
143  /// @param Buffer A pointer to the buffer where the audio data is located.
144  /// @param Length The length of the buffer provided to this method(in bytes).
145  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
146  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
147  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
148  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, const String& StreamName, Char8* Buffer, const UInt32 Length, const Audio::Encoding Encode, const Boole AddToWorld) = 0;
149  /// @brief Creates a new @ref SoundProxy from a memory buffer that is unencoded.
150  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
151  /// @param Type A UInt16 that is the ID for the type of sound the created @ref SoundProxy is to be categorized as.
152  /// @param StreamName The name to be given to the stream being created.
153  /// @param Buffer A pointer to the buffer where the audio data is located.
154  /// @param Length The length of the buffer provided to this method(in bytes).
155  /// @param Frequency The frequency (or sample rate) of the audio data.
156  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
157  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
158  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
159  virtual SoundProxy* CreateSoundProxy(const UInt16 Type, const String& StreamName, Char8* Buffer, const UInt32 Length, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld) = 0;
160 
161  /// @brief Gets an @ref SoundProxy instance by index.
162  /// @param Index The index of the @ref SoundProxy to be retrieved.
163  /// @return Returns a pointer to the @ref SoundProxy at the specified index.
164  virtual SoundProxy* GetProxy(const UInt32 Index) const = 0;
165  /// @brief Gets the n-th proxy of the specified type.
166  /// @note This manager only stores SoundProxy types. As such, specifying a type of proxy that isn't SoundProxy or derived from SoundProxy will always return NULL.
167  /// @param Type The type of proxy to retrieve.
168  /// @param Which Which proxy of the specified type to retrieve.
169  /// @return Returns a pointer to the specified proxy, or NULL if there is no n-th proxy.
170  virtual SoundProxy* GetProxy(const Mezzanine::ProxyType Type, UInt32 Which) const = 0;
171  /// @brief Gets the number of @ref SoundProxy instances in this manager.
172  /// @return Returns a UInt32 representing the number of @ref SoundProxy instances contained in this manager.
173  virtual UInt32 GetNumProxies() const = 0;
174  /// @brief Deletes a @ref SoundProxy.
175  /// @param ToBeDestroyed A pointer to the @ref SoundProxy you want deleted.
176  virtual void DestroyProxy(SoundProxy* ToBeDestroyed) = 0;
177  /// @brief Deletes all stored @ref SoundProxy instances.
178  virtual void DestroyAllProxies() = 0;
179 
180  ///////////////////////////////////////////////////////////////////////////////
181  // Convenience Creation Methods
182 
183  /// @brief Creates a blank Ambient @ref SoundProxy without a stream attached to it.
184  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
185  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
186  virtual SoundProxy* CreateAmbientSoundProxy(const Boole AddToWorld);
187  /// @brief Creates a blank Dialog @ref SoundProxy without a stream attached to it.
188  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
189  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
190  virtual SoundProxy* CreateDialogSoundProxy(const Boole AddToWorld);
191  /// @brief Creates a blank Effect @ref SoundProxy without a stream attached to it.
192  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
193  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
194  virtual SoundProxy* CreateEffectSoundProxy(const Boole AddToWorld);
195  /// @brief Creates a blank Music @ref SoundProxy without a stream attached to it.
196  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
197  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
198  virtual SoundProxy* CreateMusicSoundProxy(const Boole AddToWorld);
199 
200  /// @brief Creates a new Ambient @ref SoundProxy from a custom stream that is encoded.
201  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
202  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
203  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
204  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
205  virtual SoundProxy* CreateAmbientSoundProxy(Resource::DataStreamPtr Stream, const Audio::Encoding Encode, const Boole AddToWorld);
206  /// @brief Creates a new Dialog @ref SoundProxy from a custom stream that is encoded.
207  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
208  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
209  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
210  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
211  virtual SoundProxy* CreateDialogSoundProxy(Resource::DataStreamPtr Stream, const Audio::Encoding Encode, const Boole AddToWorld);
212  /// @brief Creates a new Effect @ref SoundProxy from a custom stream that is encoded.
213  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
214  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
215  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
216  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
217  virtual SoundProxy* CreateEffectSoundProxy(Resource::DataStreamPtr Stream, const Audio::Encoding Encode, const Boole AddToWorld);
218  /// @brief Creates a new Music @ref SoundProxy from a custom stream that is encoded.
219  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
220  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
221  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
222  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
223  virtual SoundProxy* CreateMusicSoundProxy(Resource::DataStreamPtr Stream, const Audio::Encoding Encode, const Boole AddToWorld);
224 
225  /// @brief Creates a new Ambient @ref SoundProxy from a custom stream that is unencoded.
226  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
227  /// @param Frequency The frequency (or sample rate) of the audio data.
228  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
229  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
230  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
231  virtual SoundProxy* CreateAmbientSoundProxy(Resource::DataStreamPtr Stream, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
232  /// @brief Creates a new Dialog @ref SoundProxy from a custom stream that is unencoded.
233  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
234  /// @param Frequency The frequency (or sample rate) of the audio data.
235  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
236  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
237  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
238  virtual SoundProxy* CreateDialogSoundProxy(Resource::DataStreamPtr Stream, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
239  /// @brief Creates a new Effect @ref SoundProxy from a custom stream that is unencoded.
240  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
241  /// @param Frequency The frequency (or sample rate) of the audio data.
242  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
243  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
244  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
245  virtual SoundProxy* CreateEffectSoundProxy(Resource::DataStreamPtr Stream, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
246  /// @brief Creates a new Music @ref SoundProxy from a custom stream that is unencoded.
247  /// @param Stream A Datastream containing the data to be streamed for this @ref SoundProxy.
248  /// @param Frequency The frequency (or sample rate) of the audio data.
249  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
250  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
251  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
252  virtual SoundProxy* CreateMusicSoundProxy(Resource::DataStreamPtr Stream, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
253 
254  /// @brief Creates a new Ambient @ref SoundProxy from a file.
255  /// @param FileName The name of the file to read audio data from.
256  /// @param Group The resource group in which the file resides.
257  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
258  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
259  virtual SoundProxy* CreateAmbientSoundProxy(const String& FileName, const String& Group, const Boole AddToWorld);
260  /// @brief Creates a new Dialog @ref SoundProxy from a file.
261  /// @param FileName The name of the file to read audio data from.
262  /// @param Group The resource group in which the file resides.
263  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
264  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
265  virtual SoundProxy* CreateDialogSoundProxy(const String& FileName, const String& Group, const Boole AddToWorld);
266  /// @brief Creates a new Effect @ref SoundProxy from a file.
267  /// @param FileName The name of the file to read audio data from.
268  /// @param Group The resource group in which the file resides.
269  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
270  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
271  virtual SoundProxy* CreateEffectSoundProxy(const String& FileName, const String& Group, const Boole AddToWorld);
272  /// @brief Creates a new Music @ref SoundProxy from a file.
273  /// @param FileName The name of the file to read audio data from.
274  /// @param Group The resource group in which the file resides.
275  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
276  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
277  virtual SoundProxy* CreateMusicSoundProxy(const String& FileName, const String& Group, const Boole AddToWorld);
278 
279  /// @brief Creates a new Ambient @ref SoundProxy from a memory buffer that is encoded.
280  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
281  /// @param StreamName The name to be given to the stream being created.
282  /// @param Buffer A pointer to the buffer where the audio data is located.
283  /// @param Length The length of the buffer provided to this method(in bytes).
284  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
285  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
286  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
287  virtual SoundProxy* CreateAmbientSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const Audio::Encoding Encode, const Boole AddToWorld);
288  /// @brief Creates a new Dialog @ref SoundProxy from a memory buffer that is encoded.
289  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
290  /// @param StreamName The name of the @ref SoundProxy instance.
291  /// @param Buffer A pointer to the buffer where the audio data is located.
292  /// @param Length The length of the buffer provided to this method(in bytes).
293  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
294  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
295  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
296  virtual SoundProxy* CreateDialogSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const Audio::Encoding Encode, const Boole AddToWorld);
297  /// @brief Creates a new Effect @ref SoundProxy from a memory buffer that is encoded.
298  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
299  /// @param StreamName The name to be given to the stream being created.
300  /// @param Buffer A pointer to the buffer where the audio data is located.
301  /// @param Length The length of the buffer provided to this method(in bytes).
302  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
303  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
304  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
305  virtual SoundProxy* CreateEffectSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const Audio::Encoding Encode, const Boole AddToWorld);
306  /// @brief Creates a new Music @ref SoundProxy from a memory buffer that is encoded.
307  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
308  /// @param StreamName The name to be given to the stream being created.
309  /// @param Buffer A pointer to the buffer where the audio data is located.
310  /// @param Length The length of the buffer provided to this method(in bytes).
311  /// @param Encode The encoding to be expected when decoding audio for this @ref SoundProxy.
312  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
313  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
314  virtual SoundProxy* CreateMusicSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const Audio::Encoding Encode, const Boole AddToWorld);
315 
316  /// @brief Creates a new Ambient @ref SoundProxy from a memory buffer that is unencoded.
317  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
318  /// @param StreamName The name to be given to the stream being created.
319  /// @param Buffer A pointer to the buffer where the audio data is located.
320  /// @param Length The length of the buffer provided to this method(in bytes).
321  /// @param Frequency The frequency (or sample rate) of the audio data.
322  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
323  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
324  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
325  virtual SoundProxy* CreateAmbientSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
326  /// @brief Creates a new Dialog @ref SoundProxy from a memory buffer that is unencoded.
327  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
328  /// @param StreamName The name to be given to the stream being created.
329  /// @param Buffer A pointer to the buffer where the audio data is located.
330  /// @param Length The length of the buffer provided to this method(in bytes).
331  /// @param Frequency The frequency (or sample rate) of the audio data.
332  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
333  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
334  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
335  virtual SoundProxy* CreateDialogSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
336  /// @brief Creates a new Effect @ref SoundProxy from a memory buffer that is unencoded.
337  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
338  /// @param StreamName The name to be given to the stream being created.
339  /// @param Buffer A pointer to the buffer where the audio data is located.
340  /// @param Length The length of the buffer provided to this method(in bytes).
341  /// @param Frequency The frequency (or sample rate) of the audio data.
342  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
343  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
344  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
345  virtual SoundProxy* CreateEffectSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
346  /// @brief Creates a new Music @ref SoundProxy from a memory buffer that is unencoded.
347  /// @note The buffer is copied and put into a memory stream. Thus safe for disposal afterward.
348  /// @param StreamName The name to be given to the stream being created.
349  /// @param Buffer A pointer to the buffer where the audio data is located.
350  /// @param Length The length of the buffer provided to this method(in bytes).
351  /// @param Frequency The frequency (or sample rate) of the audio data.
352  /// @param Config The bit configuration of the audio data. Helps to determine sample size.
353  /// @param AddToWorld Wether or not the new @ref SoundProxy instance should be added to the world after it has been created.
354  /// @return Returns a pointer to the @ref SoundProxy instance that was created.
355  virtual SoundProxy* CreateMusicSoundProxy(const String& StreamName, Char8* Buffer, const UInt32 Length, const UInt32 Frequency, const Audio::BitConfig Config, const Boole AddToWorld);
356 
357  ///////////////////////////////////////////////////////////////////////////////
358  // Utility
359 
360  /// @copydoc WorldManager::Pause(const UInt32)
361  virtual void Pause(const UInt32 PL) = 0;
362 
363  /// @copydoc WorldManager::Initialize()
364  virtual void Initialize() = 0;
365  /// @copydoc ManagerBase::Deinitialize()
366  virtual void Deinitialize() = 0;
367 
368  /// @brief Gets the work unit responsible for updating the buffers of soundproxies.
369  /// @return Returns a pointer to the iBufferUpdate3DWorkUnit used by this manager.
370  virtual iBufferUpdate3DWorkUnit* GetBufferUpdate3DWork() = 0;
371 
372  ///////////////////////////////////////////////////////////////////////////////
373  // Type Identifier Methods
374 
375  /// @copydoc ManagerBase::GetInterfaceType()
376  virtual ManagerType GetInterfaceType() const;
377  };//SoundScapeManager
378  }//Audio
379 }//Mezzanine
380 
381 #endif
This is a proxy class for representing a sound being played in 3D space.
Definition: soundproxy.h:57
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
Default implementation of WorkUnit. This represents on piece of work through time.
Definition: workunit.h:160
ManagerType
A listing of Manager Types.
Definition: managerbase.h:65
A simple reference counting pointer.
Definition: countedptr.h:70
char Char8
A datatype to represent one character.
Definition: datatypes.h:169
A thread specific collection of double-buffered and algorithm specific resources. ...
uint16_t UInt16
An 16-bit unsigned integer.
Definition: datatypes.h:122
virtual ~iBufferUpdate3DWorkUnit()
Class destructor.
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
ProxyType
Used by all World proxies to describe what their derived types are.
Definition: enumerations.h:91
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
This is the base class for all managers that belong to a single world instance.
Definition: worldmanager.h:55
This is an interface class for a listener (such as a player) in the 3D audio world.
Definition: listener.h:56
Encoding
The encoding to use when reading or writing an audio buffer.
#define MEZZ_LIB
Some platforms require special decorations to denote what is exported/imported in a share library...
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
This class represents a world for objects to interact within.
Definition: world.h:74
This is the work unit for updating audio buffers as necessary for audio playback. ...
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
This is the base manager class for audio being played in a 3D environment.
BitConfig
Used to describe the different bit configurations supported by this audio system. ...
This file has the definition of the workunit.