2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "../ComObject.h"
\r
25 #include "../multimedia/WaveFormatExtensible.h"
\r
27 #include "RuntimeParameters.h"
\r
28 #include "RendererDetails.h"
\r
33 using namespace Multimedia;
\r
37 ref class SoundBank;
\r
40 public ref class Engine : public ComObject
\r
42 COMOBJECT(IXACT3Engine, Engine);
\r
46 /// Initializes a new instance of the <see cref="Engine"/> class.
\r
49 Engine( CreationFlags flags );
\r
51 SoundBank^ CreateSoundBank( DataStream^ data );
\r
52 WaveBank^ CreateWaveBank( DataStream^ data );
\r
53 WaveBank^ CreateStreamingWaveBank( System::String^ fileName, int offset, int packetSize );
\r
56 /// Performs periodic work that is required by the XACT engine. Typically this should be called every 30 to 100 milliseconds.
\r
61 /// Get the sound category index that corresponds to a friendly name string.
\r
63 /// <param name="friendlyName">A string describing the category's friendly name.</param>
\r
64 /// <returns>The category index for the friendly name if successful, otherwise -1.</returns>
\r
65 int GetCategory(System::String^ friendlyName);
\r
68 /// Get the value for a global variable.
\r
70 /// <param name="index">The index of the global variable.</param>
\r
71 /// <returns>The value that is currently held by the global variable.</returns>
\r
72 float GetGlobalVariable(int index);
\r
75 /// Get the corresponding index for a global variable name string.
\r
77 /// <param name="friendlyName">A string that contains the friendly name of the global variable.</param>
\r
78 /// <returns>The index for the global variable if it exists, otherwise -1.</returns>
\r
79 int GetGlobalVariableIndex(System::String^ friendlyName);
\r
82 /// Gets details about a specific renderer.
\r
84 /// <param name="rendererIndex">Index of the renderer to retrieve information from.</param>
\r
85 /// <returns>A new <see cref="RendererDetails"/> object that contains details of the renderer.</returns>
\r
86 RendererDetails GetRendererDetails(int rendererIndex);
\r
89 /// Initialize the XACT engine using common default settings.
\r
91 Result Initialize( RuntimeParameters parameters );
\r
94 /// Pause a sound category.
\r
96 /// <param name="category">Index of the category to pause, as returned by <see cref="GetCategory"/>.</param>
\r
97 /// <param name="pause">The action to take. If true, playback is paused, if false, playback is resumed.</param>
\r
98 Result Pause(int category, bool pause);
\r
101 /// Set the value of a global variable.
\r
103 /// <param name="index">The index of the global variable.</param>
\r
104 /// <param name="value">The new value of the global variable.</param>
\r
105 Result SetGlobalVariable(int index, float value);
\r
108 /// Set the volume of a sound category.
\r
110 /// <param name="category">Index of the category for which to set the volume, as returned by <see cref="GetCategory"/>.</param>
\r
111 /// <param name="volume">The volume level to set. This is a floating point scale where 0.0 means -96db, 1.0 means 0db and 2.0 means +6db.</param>
\r
112 Result SetVolume(int category, float volume);
\r
115 /// Shut down the XACT engine and free any resources in use.
\r
120 /// Stop a sound category.
\r
122 /// <param name="category">Index of the category to stop, as returned by <see cref="GetCategory"/>.</param>
\r
123 /// <param name="flags"><see cref="StopFlags"/> that specify how the cetegory is stopped.</param>
\r
124 Result Stop(int category, StopFlags flags);
\r
127 /// Gets the total number of audio rendering devices that are available in the system.
\r
129 property int RendererCount
\r
135 /// Gets a <see cref="WaveFormatExtensible"/> object that represents the final mix format.
\r
137 property WaveFormatExtensible^ FinalMixFormat
\r
139 WaveFormatExtensible^ get();
\r