OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / xaudio2 / XAudio2.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\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
10\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
13\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
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "../ComObject.h"\r
25 #include "../multimedia/WaveFormat.h"\r
26 #include "../multimedia/WaveFormatExtensible.h"\r
27 \r
28 #include "DeviceDetails.h"\r
29 #include "PerformanceData.h"\r
30 #include "DebugConfiguration.h"\r
31 #include "ErrorEventArgs.h"\r
32 #include "EngineCallback.h"\r
33 \r
34 namespace SlimDX\r
35 {\r
36         namespace XAudio2\r
37         {\r
38                 public ref class XAudio2 : public ComObject\r
39                 {\r
40                         COMOBJECT(IXAudio2, XAudio2);\r
41 \r
42                 private:\r
43                         EngineCallbackShim *callback;\r
44 \r
45                 internal:\r
46                         void InvokeCriticalError( ErrorEventArgs^ e ) { OnCriticalError( e ); }\r
47                         void InvokeProcessingPassEnd() { OnProcessingPassEnd( System::EventArgs::Empty ); }\r
48                         void InvokeProcessingPassStart() { OnProcessingPassStart( System::EventArgs::Empty); }\r
49 \r
50                 protected:\r
51                         void OnCriticalError( ErrorEventArgs^ e );\r
52                         void OnProcessingPassEnd( System::EventArgs^ e );\r
53                         void OnProcessingPassStart( System::EventArgs^ e );\r
54 \r
55                 public:\r
56                         XAudio2();\r
57                         XAudio2( XAudio2Flags flags, ProcessorSpecifier processor );\r
58                         virtual ~XAudio2() { if( callback != NULL ) delete callback; callback = NULL; }\r
59 \r
60                         static float AmplitudeRatioToDecibels( float volume );\r
61                         static float CutoffFrequencyToRadians( float cutoffFrequency, int sampleRate );\r
62                         static float DecibelsToAmplitudeRatio( float decibels );\r
63                         static float FrequencyRatioToSemitones( float frequencyRatio );\r
64                         static float RadiansToCutoffFrequency( float radians, float sampleRate );\r
65                         static float SemitonesToFrequencyRatio( float semitones );\r
66 \r
67                         Result StartEngine();\r
68                         void StopEngine();\r
69 \r
70                         Result CommitChanges();\r
71                         Result CommitChanges( int operationSet );\r
72 \r
73                         DeviceDetails^ GetDeviceDetails( int index );\r
74 \r
75                         void SetDebugConfiguration( DebugConfiguration configuration );\r
76 \r
77                         property int DeviceCount\r
78                         {\r
79                                 int get();\r
80                         }\r
81 \r
82                         property PerformanceData^ PerformanceData\r
83                         {\r
84                                 SlimDX::XAudio2::PerformanceData^ get();\r
85                         }\r
86 \r
87                         event System::EventHandler<ErrorEventArgs^>^ CriticalError;\r
88                         event System::EventHandler^ ProcessingPassEnd;\r
89                         event System::EventHandler^ ProcessingPassStart;\r
90 \r
91                         literal int MaximumBufferBytes = XAUDIO2_MAX_BUFFER_BYTES;\r
92                         literal int MaximumQueuedBuffers = XAUDIO2_MAX_QUEUED_BUFFERS;\r
93                         literal int MaximumAudioChannels = XAUDIO2_MAX_AUDIO_CHANNELS;\r
94                         literal int MinimumSampleRate = XAUDIO2_MIN_SAMPLE_RATE;\r
95                         literal int MaximumSampleRate = XAUDIO2_MAX_SAMPLE_RATE;\r
96                         literal float MaximumVolumeLevel = XAUDIO2_MAX_VOLUME_LEVEL;\r
97                         literal float MinimumFrequencyRatio = XAUDIO2_MIN_FREQ_RATIO;\r
98                         literal float MaximumFrequencyRatio = XAUDIO2_MAX_FREQ_RATIO;\r
99                         literal float DefaultFrequencyRatio = XAUDIO2_DEFAULT_FREQ_RATIO;\r
100                         literal float MaximumFilterOneOverQ = XAUDIO2_MAX_FILTER_ONEOVERQ;\r
101                         literal float MaximumFilterFrequency = XAUDIO2_MAX_FILTER_FREQUENCY;\r
102                         literal int MaximumLoopCount = XAUDIO2_MAX_LOOP_COUNT;\r
103 \r
104                         literal int CommitNow = XAUDIO2_COMMIT_NOW;\r
105                         literal int CommitAll = XAUDIO2_COMMIT_ALL;\r
106                         literal int NoLoopRegion = XAUDIO2_NO_LOOP_REGION;\r
107                         literal int LoopInfinite = XAUDIO2_LOOP_INFINITE;\r
108                         literal int DefaultChannels = XAUDIO2_DEFAULT_CHANNELS;\r
109                         literal int DefaultSampleRate = XAUDIO2_DEFAULT_SAMPLERATE;\r
110 \r
111                         static property System::Guid FormatSubtypePcm\r
112                         {\r
113                                 System::Guid get();\r
114                         }\r
115 \r
116                         static property System::Guid FormatSubtypeAdpcm\r
117                         {\r
118                                 System::Guid get();\r
119                         }\r
120 \r
121                         static property System::Guid FormatSubtypeIeee\r
122                         {\r
123                                 System::Guid get();\r
124                         }\r
125                 };\r
126         }\r
127 }