Minor clean up of comments

This commit is contained in:
gingerBill
2024-08-14 14:15:20 +01:00
parent 03dd38f203
commit 18b6af1858
+34 -32
View File
@@ -80,9 +80,10 @@ foreign lib {
HasHostError :: proc(stream: Stream) -> b32 --- HasHostError :: proc(stream: Stream) -> b32 ---
} }
/** Translate portmidi error number into human readable message. /**
These strings are constants (set at compile time) so client has Translate portmidi error number into human readable message.
no need to allocate storage These strings are constants (set at compile time) so client has
no need to allocate storage
*/ */
GetErrorText :: proc (errnum: Error) -> string { GetErrorText :: proc (errnum: Error) -> string {
@(default_calling_convention="c") @(default_calling_convention="c")
@@ -92,9 +93,10 @@ GetErrorText :: proc (errnum: Error) -> string {
return string(Pm_GetErrorText(errnum)) return string(Pm_GetErrorText(errnum))
} }
/** Translate portmidi host error into human readable message. /**
These strings are computed at run time, so client has to allocate storage. Translate portmidi host error into human readable message.
After this routine executes, the host error is cleared. These strings are computed at run time, so client has to allocate storage.
After this routine executes, the host error is cleared.
*/ */
GetHostErrorText :: proc (buf: []byte) -> string { GetHostErrorText :: proc (buf: []byte) -> string {
@(default_calling_convention="c") @(default_calling_convention="c")
@@ -133,8 +135,8 @@ foreign lib {
/** /**
Timestamp is used to represent a millisecond clock with arbitrary Timestamp is used to represent a millisecond clock with arbitrary
start time. The type is used for all MIDI timestampes and clocks. start time. The type is used for all MIDI timestampes and clocks.
*/ */
Timestamp :: distinct i32 Timestamp :: distinct i32
TimeProc :: proc "c" (time_info: rawptr) -> Timestamp TimeProc :: proc "c" (time_info: rawptr) -> Timestamp
@@ -258,47 +260,47 @@ foreign lib {
/* Filter bit-mask definitions */ /* Filter bit-mask definitions */
/** filter active sensing messages (0xFE): */ /** filter active sensing messages (0xFE): */
FILT_ACTIVE :: 1 << 0x0E FILT_ACTIVE :: 1 << 0x0E
/** filter system exclusive messages (0xF0): */ /** filter system exclusive messages (0xF0): */
FILT_SYSEX :: 1 << 0x00 FILT_SYSEX :: 1 << 0x00
/** filter MIDI clock message (0xF8) */ /** filter MIDI clock message (0xF8) */
FILT_CLOCK :: 1 << 0x08 FILT_CLOCK :: 1 << 0x08
/** filter play messages (start 0xFA, stop 0xFC, continue 0xFB) */ /** filter play messages (start 0xFA, stop 0xFC, continue 0xFB) */
FILT_PLAY :: (1 << 0x0A) | (1 << 0x0C) | (1 << 0x0B) FILT_PLAY :: (1 << 0x0A) | (1 << 0x0C) | (1 << 0x0B)
/** filter tick messages (0xF9) */ /** filter tick messages (0xF9) */
FILT_TICK :: 1 << 0x09 FILT_TICK :: 1 << 0x09
/** filter undefined FD messages */ /** filter undefined FD messages */
FILT_FD :: 1 << 0x0D FILT_FD :: 1 << 0x0D
/** filter undefined real-time messages */ /** filter undefined real-time messages */
FILT_UNDEFINED :: FILT_FD FILT_UNDEFINED :: FILT_FD
/** filter reset messages (0xFF) */ /** filter reset messages (0xFF) */
FILT_RESET :: 1 << 0x0F FILT_RESET :: 1 << 0x0F
/** filter all real-time messages */ /** filter all real-time messages */
FILT_REALTIME :: FILT_ACTIVE | FILT_SYSEX | FILT_CLOCK | FILT_PLAY | FILT_UNDEFINED | FILT_RESET | FILT_TICK FILT_REALTIME :: FILT_ACTIVE | FILT_SYSEX | FILT_CLOCK | FILT_PLAY | FILT_UNDEFINED | FILT_RESET | FILT_TICK
/** filter note-on and note-off (0x90-0x9F and 0x80-0x8F */ /** filter note-on and note-off (0x90-0x9F and 0x80-0x8F */
FILT_NOTE :: (1 << 0x19) | (1 << 0x18) FILT_NOTE :: (1 << 0x19) | (1 << 0x18)
/** filter channel aftertouch (most midi controllers use this) (0xD0-0xDF)*/ /** filter channel aftertouch (most midi controllers use this) (0xD0-0xDF)*/
FILT_CHANNEL_AFTERTOUCH :: 1 << 0x1D FILT_CHANNEL_AFTERTOUCH :: 1 << 0x1D
/** per-note aftertouch (0xA0-0xAF) */ /** per-note aftertouch (0xA0-0xAF) */
FILT_POLY_AFTERTOUCH :: 1 << 0x1A FILT_POLY_AFTERTOUCH :: 1 << 0x1A
/** filter both channel and poly aftertouch */ /** filter both channel and poly aftertouch */
FILT_AFTERTOUCH :: FILT_CHANNEL_AFTERTOUCH | FILT_POLY_AFTERTOUCH FILT_AFTERTOUCH :: FILT_CHANNEL_AFTERTOUCH | FILT_POLY_AFTERTOUCH
/** Program changes (0xC0-0xCF) */ /** Program changes (0xC0-0xCF) */
FILT_PROGRAM :: 1 << 0x1C FILT_PROGRAM :: 1 << 0x1C
/** Control Changes (CC's) (0xB0-0xBF)*/ /** Control Changes (CC's) (0xB0-0xBF)*/
FILT_CONTROL :: 1 << 0x1B FILT_CONTROL :: 1 << 0x1B
/** Pitch Bender (0xE0-0xEF*/ /** Pitch Bender (0xE0-0xEF*/
FILT_PITCHBEND :: 1 << 0x1E FILT_PITCHBEND :: 1 << 0x1E
/** MIDI Time Code (0xF1)*/ /** MIDI Time Code (0xF1)*/
FILT_MTC :: 1 << 0x01 FILT_MTC :: 1 << 0x01
/** Song Position (0xF2) */ /** Song Position (0xF2) */
FILT_SONG_POSITION :: 1 << 0x02 FILT_SONG_POSITION :: 1 << 0x02
/** Song Select (0xF3)*/ /** Song Select (0xF3)*/
FILT_SONG_SELECT :: 1 << 0x03 FILT_SONG_SELECT :: 1 << 0x03
/** Tuning request (0xF6)*/ /** Tuning request (0xF6)*/
FILT_TUNE :: 1 << 0x06 FILT_TUNE :: 1 << 0x06
/** All System Common messages (mtc, song position, song select, tune request) */ /** All System Common messages (mtc, song position, song select, tune request) */
FILT_SYSTEMCOMMON :: FILT_MTC | FILT_SONG_POSITION | FILT_SONG_SELECT | FILT_TUNE FILT_SYSTEMCOMMON :: FILT_MTC | FILT_SONG_POSITION | FILT_SONG_SELECT | FILT_TUNE
Channel :: #force_inline proc "c" (channel: c.int) -> c.int { Channel :: #force_inline proc "c" (channel: c.int) -> c.int {
return 1<<c.uint(channel) return 1<<c.uint(channel)
@@ -367,11 +369,11 @@ foreign lib {
} }
/** /**
MessageMake() encodes a short Midi message into a 32-bit word. If data1 MessageMake() encodes a short Midi message into a 32-bit word. If data1
and/or data2 are not present, use zero. and/or data2 are not present, use zero.
MessageStatus(), MessageData1(), and MessageStatus(), MessageData1(), and
MessageData2() extract fields from a 32-bit midi message. MessageData2() extract fields from a 32-bit midi message.
*/ */
MessageMake :: #force_inline proc "c" (status: c.int, data1, data2: c.int) -> Message { MessageMake :: #force_inline proc "c" (status: c.int, data1, data2: c.int) -> Message {
return Message(((data2 << 16) & 0xFF0000) | ((data1 << 8) & 0xFF00) | (status & 0xFF)) return Message(((data2 << 16) & 0xFF0000) | ((data1 << 8) & 0xFF00) | (status & 0xFF))