1 /** 2 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.inputeventmidi; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.inputevent; 25 import godot.resource; 26 /** 27 28 */ 29 @GodotBaseClass struct InputEventMIDI 30 { 31 package(godot) enum string _GODOT_internal_name = "InputEventMIDI"; 32 public: 33 @nogc nothrow: 34 union { /** */ godot_object _godot_object; /** */ InputEvent _GODOT_base; } 35 alias _GODOT_base this; 36 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 37 package(godot) __gshared bool _classBindingInitialized = false; 38 package(godot) static struct GDNativeClassBinding 39 { 40 __gshared: 41 @GodotName("get_channel") GodotMethod!(long) getChannel; 42 @GodotName("get_controller_number") GodotMethod!(long) getControllerNumber; 43 @GodotName("get_controller_value") GodotMethod!(long) getControllerValue; 44 @GodotName("get_instrument") GodotMethod!(long) getInstrument; 45 @GodotName("get_message") GodotMethod!(long) getMessage; 46 @GodotName("get_pitch") GodotMethod!(long) getPitch; 47 @GodotName("get_pressure") GodotMethod!(long) getPressure; 48 @GodotName("get_velocity") GodotMethod!(long) getVelocity; 49 @GodotName("set_channel") GodotMethod!(void, long) setChannel; 50 @GodotName("set_controller_number") GodotMethod!(void, long) setControllerNumber; 51 @GodotName("set_controller_value") GodotMethod!(void, long) setControllerValue; 52 @GodotName("set_instrument") GodotMethod!(void, long) setInstrument; 53 @GodotName("set_message") GodotMethod!(void, long) setMessage; 54 @GodotName("set_pitch") GodotMethod!(void, long) setPitch; 55 @GodotName("set_pressure") GodotMethod!(void, long) setPressure; 56 @GodotName("set_velocity") GodotMethod!(void, long) setVelocity; 57 } 58 /// 59 pragma(inline, true) bool opEquals(in InputEventMIDI other) const 60 { return _godot_object.ptr is other._godot_object.ptr; } 61 /// 62 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 63 { _godot_object.ptr = n; return null; } 64 /// 65 pragma(inline, true) bool opEquals(typeof(null) n) const 66 { return _godot_object.ptr is n; } 67 /// 68 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 69 mixin baseCasts; 70 /// Construct a new instance of InputEventMIDI. 71 /// Note: use `memnew!InputEventMIDI` instead. 72 static InputEventMIDI _new() 73 { 74 static godot_class_constructor constructor; 75 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("InputEventMIDI"); 76 if(constructor is null) return typeof(this).init; 77 return cast(InputEventMIDI)(constructor()); 78 } 79 @disable new(size_t s); 80 /** 81 82 */ 83 long getChannel() const 84 { 85 checkClassBinding!(typeof(this))(); 86 return ptrcall!(long)(GDNativeClassBinding.getChannel, _godot_object); 87 } 88 /** 89 90 */ 91 long getControllerNumber() const 92 { 93 checkClassBinding!(typeof(this))(); 94 return ptrcall!(long)(GDNativeClassBinding.getControllerNumber, _godot_object); 95 } 96 /** 97 98 */ 99 long getControllerValue() const 100 { 101 checkClassBinding!(typeof(this))(); 102 return ptrcall!(long)(GDNativeClassBinding.getControllerValue, _godot_object); 103 } 104 /** 105 106 */ 107 long getInstrument() const 108 { 109 checkClassBinding!(typeof(this))(); 110 return ptrcall!(long)(GDNativeClassBinding.getInstrument, _godot_object); 111 } 112 /** 113 114 */ 115 long getMessage() const 116 { 117 checkClassBinding!(typeof(this))(); 118 return ptrcall!(long)(GDNativeClassBinding.getMessage, _godot_object); 119 } 120 /** 121 122 */ 123 long getPitch() const 124 { 125 checkClassBinding!(typeof(this))(); 126 return ptrcall!(long)(GDNativeClassBinding.getPitch, _godot_object); 127 } 128 /** 129 130 */ 131 long getPressure() const 132 { 133 checkClassBinding!(typeof(this))(); 134 return ptrcall!(long)(GDNativeClassBinding.getPressure, _godot_object); 135 } 136 /** 137 138 */ 139 long getVelocity() const 140 { 141 checkClassBinding!(typeof(this))(); 142 return ptrcall!(long)(GDNativeClassBinding.getVelocity, _godot_object); 143 } 144 /** 145 146 */ 147 void setChannel(in long channel) 148 { 149 checkClassBinding!(typeof(this))(); 150 ptrcall!(void)(GDNativeClassBinding.setChannel, _godot_object, channel); 151 } 152 /** 153 154 */ 155 void setControllerNumber(in long controller_number) 156 { 157 checkClassBinding!(typeof(this))(); 158 ptrcall!(void)(GDNativeClassBinding.setControllerNumber, _godot_object, controller_number); 159 } 160 /** 161 162 */ 163 void setControllerValue(in long controller_value) 164 { 165 checkClassBinding!(typeof(this))(); 166 ptrcall!(void)(GDNativeClassBinding.setControllerValue, _godot_object, controller_value); 167 } 168 /** 169 170 */ 171 void setInstrument(in long instrument) 172 { 173 checkClassBinding!(typeof(this))(); 174 ptrcall!(void)(GDNativeClassBinding.setInstrument, _godot_object, instrument); 175 } 176 /** 177 178 */ 179 void setMessage(in long message) 180 { 181 checkClassBinding!(typeof(this))(); 182 ptrcall!(void)(GDNativeClassBinding.setMessage, _godot_object, message); 183 } 184 /** 185 186 */ 187 void setPitch(in long pitch) 188 { 189 checkClassBinding!(typeof(this))(); 190 ptrcall!(void)(GDNativeClassBinding.setPitch, _godot_object, pitch); 191 } 192 /** 193 194 */ 195 void setPressure(in long pressure) 196 { 197 checkClassBinding!(typeof(this))(); 198 ptrcall!(void)(GDNativeClassBinding.setPressure, _godot_object, pressure); 199 } 200 /** 201 202 */ 203 void setVelocity(in long velocity) 204 { 205 checkClassBinding!(typeof(this))(); 206 ptrcall!(void)(GDNativeClassBinding.setVelocity, _godot_object, velocity); 207 } 208 /** 209 210 */ 211 @property long channel() 212 { 213 return getChannel(); 214 } 215 /// ditto 216 @property void channel(long v) 217 { 218 setChannel(v); 219 } 220 /** 221 222 */ 223 @property long controllerNumber() 224 { 225 return getControllerNumber(); 226 } 227 /// ditto 228 @property void controllerNumber(long v) 229 { 230 setControllerNumber(v); 231 } 232 /** 233 234 */ 235 @property long controllerValue() 236 { 237 return getControllerValue(); 238 } 239 /// ditto 240 @property void controllerValue(long v) 241 { 242 setControllerValue(v); 243 } 244 /** 245 246 */ 247 @property long instrument() 248 { 249 return getInstrument(); 250 } 251 /// ditto 252 @property void instrument(long v) 253 { 254 setInstrument(v); 255 } 256 /** 257 258 */ 259 @property long message() 260 { 261 return getMessage(); 262 } 263 /// ditto 264 @property void message(long v) 265 { 266 setMessage(v); 267 } 268 /** 269 270 */ 271 @property long pitch() 272 { 273 return getPitch(); 274 } 275 /// ditto 276 @property void pitch(long v) 277 { 278 setPitch(v); 279 } 280 /** 281 282 */ 283 @property long pressure() 284 { 285 return getPressure(); 286 } 287 /// ditto 288 @property void pressure(long v) 289 { 290 setPressure(v); 291 } 292 /** 293 294 */ 295 @property long velocity() 296 { 297 return getVelocity(); 298 } 299 /// ditto 300 @property void velocity(long v) 301 { 302 setVelocity(v); 303 } 304 }