Add MessageDecompose; Update the static library

This commit is contained in:
gingerBill
2021-11-20 20:20:12 +00:00
parent 446f1f6183
commit ca6951d05e
2 changed files with 152 additions and 144 deletions
+11 -3
View File
@@ -109,8 +109,8 @@ DeviceInfo :: struct {
structVersion: c.int, /**< this internal structure version */ structVersion: c.int, /**< this internal structure version */
interf: cstring, /**< underlying MIDI API, e.g. MMSystem or DirectX */ interf: cstring, /**< underlying MIDI API, e.g. MMSystem or DirectX */
name: cstring, /**< device name, e.g. USB MidiSport 1x1 */ name: cstring, /**< device name, e.g. USB MidiSport 1x1 */
input: c.int, /**< true iff input is available */ input: b32, /**< true iff input is available */
output: c.int, /**< true iff output is available */ output: b32, /**< true iff output is available */
opened: b32, /**< used by generic PortMidi code to do error checking on arguments */ opened: b32, /**< used by generic PortMidi code to do error checking on arguments */
} }
@@ -210,7 +210,6 @@ foreign lib {
Any stream that is successfully opened should eventually be closed Any stream that is successfully opened should eventually be closed
by calling Close(). by calling Close().
*/ */
OpenInput :: proc(stream: ^Stream, OpenInput :: proc(stream: ^Stream,
inputDevice: DeviceID, inputDevice: DeviceID,
@@ -379,6 +378,15 @@ MessageData2 :: #force_inline proc "c" (msg: Message) -> c.int {
return c.int((msg >> 16) & 0xFF) return c.int((msg >> 16) & 0xFF)
} }
MessageCompose :: MessageMake
MessageDecompose :: #force_inline proc "c" (msg: Message) -> (status, data1, data2: c.int) {
status = c.int(msg & 0xFF)
data1 = c.int((msg >> 8) & 0xFF)
data2 = c.int((msg >> 16) & 0xFF)
return
}
Message :: distinct i32 Message :: distinct i32
/** /**
All midi data comes in the form of Event structures. A sysex All midi data comes in the form of Event structures. A sysex
BIN
View File
Binary file not shown.