Skip to content

Commit

Permalink
Move MIDI's methods and constants into InputEventMIDI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickeon committed Jan 2, 2024
1 parent 13a0d6e commit 773c608
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 54 deletions.
64 changes: 57 additions & 7 deletions core/input/input_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "core/input/input_map.h"
#include "core/input/shortcut.h"
#include "core/os/keyboard.h"
#include "core/os/midi_driver.h"
#include "core/os/os.h"

const int InputEvent::DEVICE_ID_EMULATION = -1;
Expand Down Expand Up @@ -1661,11 +1662,11 @@ int InputEventMIDI::get_channel() const {
return channel;
}

void InputEventMIDI::set_message(const MIDIMessage p_message) {
void InputEventMIDI::set_message(const Message p_message) {
message = p_message;
}

MIDIMessage InputEventMIDI::get_message() const {
InputEventMIDI::Message InputEventMIDI::get_message() const {
return message;
}

Expand Down Expand Up @@ -1717,26 +1718,51 @@ int InputEventMIDI::get_controller_value() const {
return controller_value;
}

void InputEventMIDI::open_inputs() {
if (MIDIDriver::get_singleton()) {
MIDIDriver::get_singleton()->open();
} else {
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}
}

void InputEventMIDI::close_inputs() {
if (MIDIDriver::get_singleton()) {
MIDIDriver::get_singleton()->close();
} else {
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}
}

PackedStringArray InputEventMIDI::get_connected_inputs() {
if (MIDIDriver::get_singleton()) {
return MIDIDriver::get_singleton()->get_connected_inputs();
}

PackedStringArray list;
ERR_FAIL_V_MSG(list, vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}

String InputEventMIDI::as_text() const {
return vformat(RTR("MIDI Input on Channel=%s Message=%s"), itos(channel), itos((int64_t)message));
}

String InputEventMIDI::to_string() {
String ret;
switch (message) {
case MIDIMessage::NOTE_ON:
case Message::MESSAGE_NOTE_ON:
ret = vformat("Note On: channel=%d, pitch=%d, velocity=%d", channel, pitch, velocity);
break;
case MIDIMessage::NOTE_OFF:
case Message::MESSAGE_NOTE_OFF:
ret = vformat("Note Off: channel=%d, pitch=%d, velocity=%d", channel, pitch, velocity);
break;
case MIDIMessage::PITCH_BEND:
case Message::MESSAGE_PITCH_BEND:
ret = vformat("Pitch Bend: channel=%d, pitch=%d", channel, pitch);
break;
case MIDIMessage::CHANNEL_PRESSURE:
case Message::MESSAGE_CHANNEL_PRESSURE:
ret = vformat("Channel Pressure: channel=%d, pressure=%d", channel, pressure);
break;
case MIDIMessage::CONTROL_CHANGE:
case Message::MESSAGE_CONTROL_CHANGE:
ret = vformat("Control Change: channel=%d, controller_number=%d, controller_value=%d", channel, controller_number, controller_value);
break;
default:
Expand All @@ -1763,6 +1789,30 @@ void InputEventMIDI::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_controller_value", "controller_value"), &InputEventMIDI::set_controller_value);
ClassDB::bind_method(D_METHOD("get_controller_value"), &InputEventMIDI::get_controller_value);

ClassDB::bind_static_method("InputEventMIDI", D_METHOD("open_inputs"), &InputEventMIDI::open_inputs);
ClassDB::bind_static_method("InputEventMIDI", D_METHOD("close_inputs"), &InputEventMIDI::close_inputs);
ClassDB::bind_static_method("InputEventMIDI", D_METHOD("get_connected_inputs"), &InputEventMIDI::get_connected_inputs);

BIND_ENUM_CONSTANT(MESSAGE_NONE);
BIND_ENUM_CONSTANT(MESSAGE_NOTE_OFF);
BIND_ENUM_CONSTANT(MESSAGE_NOTE_ON);
BIND_ENUM_CONSTANT(MESSAGE_AFTERTOUCH);
BIND_ENUM_CONSTANT(MESSAGE_CONTROL_CHANGE);
BIND_ENUM_CONSTANT(MESSAGE_PROGRAM_CHANGE);
BIND_ENUM_CONSTANT(MESSAGE_CHANNEL_PRESSURE);
BIND_ENUM_CONSTANT(MESSAGE_PITCH_BEND);
BIND_ENUM_CONSTANT(MESSAGE_SYSTEM_EXCLUSIVE);
BIND_ENUM_CONSTANT(MESSAGE_QUARTER_FRAME);
BIND_ENUM_CONSTANT(MESSAGE_SONG_POSITION_POINTER);
BIND_ENUM_CONSTANT(MESSAGE_SONG_SELECT);
BIND_ENUM_CONSTANT(MESSAGE_TUNE_REQUEST);
BIND_ENUM_CONSTANT(MESSAGE_TIMING_CLOCK);
BIND_ENUM_CONSTANT(MESSAGE_START);
BIND_ENUM_CONSTANT(MESSAGE_CONTINUE);
BIND_ENUM_CONSTANT(MESSAGE_STOP);
BIND_ENUM_CONSTANT(MESSAGE_ACTIVE_SENSING);
BIND_ENUM_CONSTANT(MESSAGE_SYSTEM_RESET);

ADD_PROPERTY(PropertyInfo(Variant::INT, "channel"), "set_channel", "get_channel");
ADD_PROPERTY(PropertyInfo(Variant::INT, "message"), "set_message", "get_message");
ADD_PROPERTY(PropertyInfo(Variant::INT, "pitch"), "set_pitch", "get_pitch");
Expand Down
36 changes: 33 additions & 3 deletions core/input/input_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,35 @@ class InputEventPanGesture : public InputEventGesture {
};

class InputEventMIDI : public InputEvent {
private:
GDCLASS(InputEventMIDI, InputEvent);

public:
enum Message {
MESSAGE_NONE = MIDIMessage::NONE,

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type

Check failure on line 516 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NONE' must have integral or unscoped enumeration type
MESSAGE_NOTE_OFF = MIDIMessage::NOTE_OFF,

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type

Check failure on line 517 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NOTE_OFF' must have integral or unscoped enumeration type
MESSAGE_NOTE_ON = MIDIMessage::NOTE_ON,

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type

Check failure on line 518 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_NOTE_ON' must have integral or unscoped enumeration type
MESSAGE_AFTERTOUCH = MIDIMessage::AFTERTOUCH,

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type

Check failure on line 519 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_AFTERTOUCH' must have integral or unscoped enumeration type
MESSAGE_CONTROL_CHANGE = MIDIMessage::CONTROL_CHANGE,

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type

Check failure on line 520 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_CONTROL_CHANGE' must have integral or unscoped enumeration type
MESSAGE_PROGRAM_CHANGE = MIDIMessage::PROGRAM_CHANGE,

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type

Check failure on line 521 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_PROGRAM_CHANGE' must have integral or unscoped enumeration type
MESSAGE_CHANNEL_PRESSURE = MIDIMessage::CHANNEL_PRESSURE,

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type

Check failure on line 522 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_CHANNEL_PRESSURE' must have integral or unscoped enumeration type
MESSAGE_PITCH_BEND = MIDIMessage::PITCH_BEND,

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type

Check failure on line 523 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_PITCH_BEND' must have integral or unscoped enumeration type
MESSAGE_SYSTEM_EXCLUSIVE = MIDIMessage::SYSTEM_EXCLUSIVE,

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type

Check failure on line 524 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_SYSTEM_EXCLUSIVE' must have integral or unscoped enumeration type
MESSAGE_QUARTER_FRAME = MIDIMessage::QUARTER_FRAME,

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor w/ Mono (target=editor)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld)

integral constant expression must have integral or unscoped enumeration type, not 'MIDIMessage'

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Minimal template (target=template_release, everything disabled)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Template w/ Mono (target=template_release)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type

Check failure on line 525 in core/input/input_event.h

View workflow job for this annotation

GitHub Actions / 🐧 Linux / Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, scu_build=yes, precision=double, use_asan=yes, use_ubsan=yes, linker=gold)

enumerator value for 'MESSAGE_QUARTER_FRAME' must have integral or unscoped enumeration type
MESSAGE_SONG_POSITION_POINTER = MIDIMessage::SONG_POSITION_POINTER,
MESSAGE_SONG_SELECT = MIDIMessage::SONG_SELECT,
MESSAGE_TUNE_REQUEST = MIDIMessage::TUNE_REQUEST,
MESSAGE_TIMING_CLOCK = MIDIMessage::TIMING_CLOCK,
MESSAGE_START = MIDIMessage::START,
MESSAGE_CONTINUE = MIDIMessage::CONTINUE,
MESSAGE_STOP = MIDIMessage::STOP,
MESSAGE_ACTIVE_SENSING = MIDIMessage::ACTIVE_SENSING,
MESSAGE_SYSTEM_RESET = MIDIMessage::SYSTEM_RESET,
};

private:
int channel = 0;
MIDIMessage message = MIDIMessage::NONE;
Message message = Message::MESSAGE_NONE;
int pitch = 0;
int velocity = 0;
int instrument = 0;
Expand All @@ -526,8 +551,8 @@ class InputEventMIDI : public InputEvent {
void set_channel(const int p_channel);
int get_channel() const;

void set_message(const MIDIMessage p_message);
MIDIMessage get_message() const;
void set_message(const Message p_message);
Message get_message() const;

void set_pitch(const int p_pitch);
int get_pitch() const;
Expand All @@ -547,11 +572,16 @@ class InputEventMIDI : public InputEvent {
void set_controller_value(const int p_controller_value);
int get_controller_value() const;

static void open_inputs();
static void close_inputs();
static PackedStringArray get_connected_inputs();

virtual String as_text() const override;
virtual String to_string() override;

InputEventMIDI() {}
};
VARIANT_ENUM_CAST(InputEventMIDI::Message);

class InputEventShortcut : public InputEvent {
GDCLASS(InputEventShortcut, InputEvent);
Expand Down
20 changes: 10 additions & 10 deletions core/os/midi_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,57 +51,57 @@ void MIDIDriver::receive_input_packet(uint64_t timestamp, uint8_t *data, uint32_
if (data[0] >= 0xF0) {
// channel does not apply to system common messages
event->set_channel(0);
event->set_message(MIDIMessage(data[0]));
event->set_message(InputEventMIDI::Message(data[0]));
last_received_message = data[0];
} else if ((data[0] & 0x80) == 0x00) {
// running status
event->set_channel(last_received_message & 0xF);
event->set_message(MIDIMessage(last_received_message >> 4));
event->set_message(InputEventMIDI::Message(last_received_message >> 4));
param_position = 0;
} else {
event->set_channel(data[0] & 0xF);
event->set_message(MIDIMessage(data[0] >> 4));
event->set_message(InputEventMIDI::Message(data[0] >> 4));
param_position = 1;
last_received_message = data[0];
}
}

switch (event->get_message()) {
case MIDIMessage::AFTERTOUCH:
case InputEventMIDI::Message::MESSAGE_AFTERTOUCH:
if (length >= 2 + param_position) {
event->set_pitch(data[param_position]);
event->set_pressure(data[param_position + 1]);
}
break;

case MIDIMessage::CONTROL_CHANGE:
case InputEventMIDI::Message::MESSAGE_CONTROL_CHANGE:
if (length >= 2 + param_position) {
event->set_controller_number(data[param_position]);
event->set_controller_value(data[param_position + 1]);
}
break;

case MIDIMessage::NOTE_ON:
case MIDIMessage::NOTE_OFF:
case InputEventMIDI::Message::MESSAGE_NOTE_ON:
case InputEventMIDI::Message::MESSAGE_NOTE_OFF:
if (length >= 2 + param_position) {
event->set_pitch(data[param_position]);
event->set_velocity(data[param_position + 1]);
}
break;

case MIDIMessage::PITCH_BEND:
case InputEventMIDI::Message::MESSAGE_PITCH_BEND:
if (length >= 2 + param_position) {
event->set_pitch((data[param_position + 1] << 7) | data[param_position]);
}
break;

case MIDIMessage::PROGRAM_CHANGE:
case InputEventMIDI::Message::MESSAGE_PROGRAM_CHANGE:
if (length >= 1 + param_position) {
event->set_instrument(data[param_position]);
}
break;

case MIDIMessage::CHANNEL_PRESSURE:
case InputEventMIDI::Message::MESSAGE_CHANNEL_PRESSURE:
if (length >= 1 + param_position) {
event->set_pressure(data[param_position]);
}
Expand Down
57 changes: 38 additions & 19 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2529,62 +2529,81 @@
<constant name="JOY_AXIS_MAX" value="10" enum="JoyAxis">
The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes.
</constant>
<constant name="MIDI_MESSAGE_NONE" value="0" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_NONE" value="0" enum="MIDIMessage" is_deprecated="true">
Enum value which doesn't correspond to any MIDI message. This is used to initialize [enum MIDIMessage] properties with a generic state.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_NONE].
</constant>
<constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_NOTE_OFF" value="8" enum="MIDIMessage" is_deprecated="true">
MIDI note OFF message. Not all MIDI devices send this event; some send [constant MIDI_MESSAGE_NOTE_ON] with zero velocity instead. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_NOTE_OFF].
</constant>
<constant name="MIDI_MESSAGE_NOTE_ON" value="9" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_NOTE_ON" value="9" enum="MIDIMessage" is_deprecated="true">
MIDI note ON message. Some MIDI devices send this event with velocity zero instead of [constant MIDI_MESSAGE_NOTE_OFF], but implementations vary. See the documentation of [InputEventMIDI] for information of how to use MIDI inputs.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_NOTE_ON].
</constant>
<constant name="MIDI_MESSAGE_AFTERTOUCH" value="10" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_AFTERTOUCH" value="10" enum="MIDIMessage" is_deprecated="true">
MIDI aftertouch message. This message is most often sent by pressing down on the key after it "bottoms out".
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_AFTERTOUCH].
</constant>
<constant name="MIDI_MESSAGE_CONTROL_CHANGE" value="11" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_CONTROL_CHANGE" value="11" enum="MIDIMessage" is_deprecated="true">
MIDI control change message. This message is sent when a controller value changes. Controllers include devices such as pedals and levers.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_CONTROL_CHANGE].
</constant>
<constant name="MIDI_MESSAGE_PROGRAM_CHANGE" value="12" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_PROGRAM_CHANGE" value="12" enum="MIDIMessage" is_deprecated="true">
MIDI program change message. This message sent when the program patch number changes.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_PROGRAM_CHANGE].
</constant>
<constant name="MIDI_MESSAGE_CHANNEL_PRESSURE" value="13" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_CHANNEL_PRESSURE" value="13" enum="MIDIMessage" is_deprecated="true">
MIDI channel pressure message. This message is most often sent by pressing down on the key after it "bottoms out". This message is different from polyphonic after-touch as it indicates the highest pressure across all keys.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_CHANNEL_PRESSURE].
</constant>
<constant name="MIDI_MESSAGE_PITCH_BEND" value="14" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_PITCH_BEND" value="14" enum="MIDIMessage" is_deprecated="true">
MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel or lever, typically).
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_PITCH_BEND].
</constant>
<constant name="MIDI_MESSAGE_SYSTEM_EXCLUSIVE" value="240" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_SYSTEM_EXCLUSIVE" value="240" enum="MIDIMessage" is_deprecated="true">
MIDI system exclusive message. This has behavior exclusive to the device you're receiving input from. Getting this data is not implemented in Godot.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_SYSTEM_EXCLUSIVE].
</constant>
<constant name="MIDI_MESSAGE_QUARTER_FRAME" value="241" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_QUARTER_FRAME" value="241" enum="MIDIMessage" is_deprecated="true">
MIDI quarter frame message. Contains timing information that is used to synchronize MIDI devices. Getting this data is not implemented in Godot.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_QUARTER_FRAME].
</constant>
<constant name="MIDI_MESSAGE_SONG_POSITION_POINTER" value="242" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_SONG_POSITION_POINTER" value="242" enum="MIDIMessage" is_deprecated="true">
MIDI song position pointer message. Gives the number of 16th notes since the start of the song. Getting this data is not implemented in Godot.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_SONG_POSITION_POINTER].
</constant>
<constant name="MIDI_MESSAGE_SONG_SELECT" value="243" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_SONG_SELECT" value="243" enum="MIDIMessage" is_deprecated="true">
MIDI song select message. Specifies which sequence or song is to be played. Getting this data is not implemented in Godot.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_SONG_SELECT].
</constant>
<constant name="MIDI_MESSAGE_TUNE_REQUEST" value="246" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_TUNE_REQUEST" value="246" enum="MIDIMessage" is_deprecated="true">
MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune their oscillators.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_TUNE_REQUEST].
</constant>
<constant name="MIDI_MESSAGE_TIMING_CLOCK" value="248" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_TIMING_CLOCK" value="248" enum="MIDIMessage" is_deprecated="true">
MIDI timing clock message. Sent 24 times per quarter note when synchronization is required.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_TIMING_CLOCK].
</constant>
<constant name="MIDI_MESSAGE_START" value="250" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_START" value="250" enum="MIDIMessage" is_deprecated="true">
MIDI start message. Start the current sequence playing. This message will be followed with Timing Clocks.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_START].
</constant>
<constant name="MIDI_MESSAGE_CONTINUE" value="251" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_CONTINUE" value="251" enum="MIDIMessage" is_deprecated="true">
MIDI continue message. Continue at the point the sequence was stopped.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_CONTINUE].
</constant>
<constant name="MIDI_MESSAGE_STOP" value="252" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_STOP" value="252" enum="MIDIMessage" is_deprecated="true">
MIDI stop message. Stop the current sequence.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_STOP].
</constant>
<constant name="MIDI_MESSAGE_ACTIVE_SENSING" value="254" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_ACTIVE_SENSING" value="254" enum="MIDIMessage" is_deprecated="true">
MIDI active sensing message. This message is intended to be sent repeatedly to tell the receiver that a connection is alive.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_ACTIVE_SENSING].
</constant>
<constant name="MIDI_MESSAGE_SYSTEM_RESET" value="255" enum="MIDIMessage">
<constant name="MIDI_MESSAGE_SYSTEM_RESET" value="255" enum="MIDIMessage" is_deprecated="true">
MIDI system reset message. Reset all receivers in the system to power-up status. It should not be sent on power-up itself.
[i]Deprecated.[/i] Use [constant InputEventMIDI.MESSAGE_SYSTEM_RESET].
</constant>
<constant name="OK" value="0" enum="Error">
Methods that return [enum Error] return [constant OK] when no error occurred.
Expand Down
Loading

0 comments on commit 773c608

Please sign in to comment.