OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / xinput / Controller.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 "../Result.h"\r
25 \r
26 #include "CapabilitiesXI.h"\r
27 #include "BatteryInformation.h"\r
28 #include "Enums.h"\r
29 #include "Keystroke.h"\r
30 #include "State.h"\r
31 #include "Vibration.h"\r
32 \r
33 using System::Runtime::InteropServices::OutAttribute;\r
34 \r
35 namespace SlimDX\r
36 {\r
37         namespace XInput\r
38         {\r
39                 /// <summary>\r
40                 /// Represents an XInput controller.\r
41                 /// </summary>\r
42                 public ref class Controller\r
43                 {\r
44                 private:\r
45                         System::UInt32 m_UserIndex;\r
46                         \r
47                         static int ConvertError( int errorCode );\r
48                         \r
49                 public:\r
50                         /// <summary>\r
51                         /// Gets a value indicating whether or not the controller is connected.\r
52                         /// </summary>\r
53                         property bool IsConnected\r
54                         {\r
55                                 bool get();\r
56                         }\r
57                         \r
58                         /// <summary>\r
59                         /// Gets the identifier for the sound renderer in the controller.\r
60                         /// </summary>\r
61                         property System::Guid SoundRenderGuid\r
62                         {\r
63                                 System::Guid get();\r
64                         }\r
65 \r
66                         /// <summary>\r
67                         /// Gets the identifier for the sound capture device in the controller.\r
68                         /// </summary>\r
69                         property System::Guid SoundCaptureGuid\r
70                         {\r
71                                 System::Guid get();\r
72                         }\r
73                         \r
74                         /// <summary>\r
75                         /// Initializes a new instance of the <see cref="Controller"/> class.\r
76                         /// </summary>\r
77                         /// <param name="userIndex">The index of the player whose controller is being represented.</param>\r
78                         Controller( UserIndex userIndex );\r
79                         \r
80                         /// <summary>\r
81                         /// Retrieves battery information for the controller.\r
82                         /// </summary>\r
83                         /// <param name="battery">The type of battery whose information is being retrieved.</param>\r
84                         /// <returns>A <see cref="BatteryInformation"/> structure describing the battery in the controller.</returns>\r
85                         BatteryInformation GetBatteryInformation( BatteryDeviceType battery );\r
86 \r
87                         /// <summary>\r
88                         /// Retrieves the capabilities of the controller.\r
89                         /// </summary>\r
90                         /// <param name="device">The type of the device whose capabilities are being retrieved.</param>\r
91                         /// <returns>A <see cref="XInput::Capabilities"/> structure describing the capabilities of the controller.</returns>\r
92                         Capabilities GetCapabilities( DeviceQueryType device );\r
93 \r
94                         /// <summary>\r
95                         /// Gets the state of the controller.\r
96                         /// </summary>\r
97                         /// <returns>A <see cref="XInput::State"/> structure describing the state of the controller.</returns>\r
98                         State GetState();\r
99                         \r
100                         /// <summary>\r
101                         /// Gets keystroke information from the device.\r
102                         /// </summary>\r
103                         /// <param name="flag">The type of the device to query.</param>\r
104                         /// <param name="keystroke">Keystroke information from the device.</param>\r
105                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
106                         Result GetKeystroke( DeviceQueryType flag, [Out] Keystroke% keystroke );\r
107                                 \r
108                         /// <summary>\r
109                         /// Sets vibration information for the controller.\r
110                         /// </summary>\r
111                         /// <param name="vibration">Vibration settings for the controller.</param>\r
112                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
113                         Result SetVibration( Vibration vibration );\r
114 \r
115                         /// <summary>\r
116                         /// Enables or disables data reporting in XInput.\r
117                         /// </summary>\r
118                         /// <param name="value"><c>true</c> to enable XInput, <c>false</c> to disable it.</param>\r
119                         static void SetReporting( bool value );\r
120                 };\r
121         }\r
122 }