OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / directsound / SoundBuffer.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 "Enums.h"\r
25 #include "DirectSound.h"\r
26 #include "SoundBufferDescription.h"\r
27 #include "BufferCapabilities.h"\r
28 #include "NotificationPosition.h"\r
29 \r
30 namespace SlimDX\r
31 {\r
32         ref class DataStream;\r
33 \r
34         namespace DirectSound\r
35         {\r
36                 /// <summary>\r
37                 /// The SoundBuffer object is used to manage sound buffers.\r
38                 /// </summary>\r
39                 /// <unmanaged>IDirectSoundBuffer</unmanaged>\r
40                 public ref class SoundBuffer abstract : public ComObject\r
41                 {\r
42                         COMOBJECT_BASE(IDirectSoundBuffer);\r
43 \r
44                 private:\r
45                         bool notVirtualized;\r
46 \r
47                 protected:\r
48                         SoundBuffer() { }\r
49 \r
50                         DataStream^ Lock( int offset, int sizeBytes, LockFlags flags, [Out] DataStream^% secondPart );\r
51                         Result Unlock( DataStream^ firstPart, DataStream^ secondPart );\r
52 \r
53                 public:\r
54                         /// <summary>\r
55                         /// Restores the memory allocation for a lost sound buffer.\r
56                         /// </summary>\r
57                         Result Restore();\r
58 \r
59                         /// <summary>\r
60                         /// Causes the sound buffer to play, starting at the play cursor.\r
61                         /// </summary>\r
62                         Result Play( int priority, PlayFlags flags );\r
63 \r
64                         /// <summary>\r
65                         /// Causes the sound buffer to stop playing.\r
66                         /// </summary>\r
67                         Result Stop();\r
68 \r
69                         /// <summary>\r
70                         /// Writes data to the buffer.\r
71                         /// </summary>\r
72                         /// <returns></returns>\r
73                         generic<typename T> where T : value class\r
74                         Result Write( array<T>^ data, int startIndex, int count, int bufferOffset, LockFlags flags );\r
75 \r
76                         /// <summary>\r
77                         /// Writes data to the buffer.\r
78                         /// </summary>\r
79                         /// <returns></returns>\r
80                         generic<typename T> where T : value class\r
81                         Result Write( array<T>^ data, int bufferOffset, LockFlags flags );\r
82 \r
83                         Result SetNotificationPositions( array<NotificationPosition>^ positions );\r
84 \r
85                         property SlimDX::Multimedia::WaveFormat^ Format\r
86                         {\r
87                                 SlimDX::Multimedia::WaveFormat^ get();\r
88                                 void set( SlimDX::Multimedia::WaveFormat^ value );\r
89                         }\r
90 \r
91                         /// <summary>\r
92                         /// Retrieves the position of the write cursor in the sound buffer.\r
93                         /// </summary>\r
94                         property int CurrentWritePosition\r
95                         {\r
96                                 int get();\r
97                         }\r
98 \r
99                         /// <summary>\r
100                         /// Retrieves or sets the position of the play cursor.\r
101                         /// </summary>\r
102                         property int CurrentPlayPosition\r
103                         {\r
104                                 int get();\r
105                                 void set( int value );\r
106                         }\r
107 \r
108                         /// <summary>\r
109                         /// Retrieves or sets the frequency, in samples per second, at which the buffer is playing.\r
110                         /// </summary>\r
111                         property int Frequency\r
112                         {\r
113                                 int get();\r
114                                 void set( int value );\r
115                         }\r
116 \r
117                         /// <summary>\r
118                         /// Retrieves or sets the attenuation of the sound.\r
119                         /// </summary>\r
120                         property int Volume\r
121                         {\r
122                                 int get();\r
123                                 void set( int value );\r
124                         }\r
125 \r
126                         /// <summary>\r
127                         /// Retrieves or sets the relative volume of the left and right audio channels.\r
128                         /// </summary>\r
129                         property int Pan\r
130                         {\r
131                                 int get();\r
132                                 void set( int value );\r
133                         }\r
134 \r
135                         /// <summary>\r
136                         /// Retrieves the status of the sound buffer.\r
137                         /// </summary>\r
138                         property BufferStatus Status\r
139                         {\r
140                                 BufferStatus get();\r
141                         }\r
142 \r
143                         /// <summary>\r
144                         /// True if a requested 3D algorithm was not available and stereo panning was substituted.\r
145                         /// </summary>\r
146                         property bool NoVirtualization\r
147                         {\r
148                                 bool get() { return notVirtualized; }\r
149                         protected:\r
150                                 void set( bool value ) { notVirtualized = value; }\r
151                         }\r
152 \r
153                         /// <summary>\r
154                         /// Retrieves the capabilities of the buffer object.\r
155                         /// </summary>\r
156                         property BufferCapabilities Capabilities\r
157                         {\r
158                                 BufferCapabilities get();\r
159                         }\r
160                 };\r
161         }\r
162 }