From 0cc7e574d1d32539f3a4932aa9731f07b39af8b8 Mon Sep 17 00:00:00 2001 From: jlucfarias Date: Sun, 25 Aug 2024 21:08:52 -0300 Subject: [PATCH 1/3] Add commented MIDI definitions to use later and organize them in categories --- .../CoreMIDI/include/CoreMIDI/MIDIServices.h | 77 ++++++++++++++++++- src/frameworks/CoreMIDI/src/MIDIServices.m | 5 +- 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h b/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h index 933beff701..844b2cc463 100644 --- a/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h +++ b/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h @@ -3,9 +3,80 @@ #include -extern const CFStringRef kMIDIPropertyName; -extern const CFStringRef kMIDIPropertyConnectionUniqueID; -extern const CFStringRef kMIDIPropertyUniqueID; +/* Identification */ +extern const CFStringRef kMIDIPropertyName API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyModel API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyManufacturer API_AVAILABLE(macos(10.0)); +extern const CFStringRef kMIDIPropertyUniqueID API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyDeviceID API_AVAILABLE(macos(10.0)); +/* Capabilities */ +// extern const CFStringRef kMIDIPropertySupportsMMC API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertySupportsGeneralMIDI API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertySupportsShowControl API_AVAILABLE(macos(10.4)); + +/* Configuration */ +// extern const CFStringRef kMIDIPropertyNameConfigurationDictionary API_AVAILABLE(macos(10.15)); +// extern const CFStringRef kMIDIPropertyMaxSysExSpeed API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyDriverDeviceEditorApp API_AVAILABLE(macos(10.3)); +// extern const CFStringRef kMIDIPropertyNameConfiguration API_AVAILABLE(macos(10.2)); // @deprecated at macos >= 10.15 && ios >= 13.0 + +/* Presentation */ +// extern const CFStringRef kMIDIPropertyImage API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyDisplayName API_AVAILABLE(macos(10.4)); + +/* Audio */ +// extern const CFStringRef kMIDIPropertyPanDisruptsStereo API_AVAILABLE(macos(10.2)); + +/* Protocols */ +// extern const CFStringRef kMIDIPropertyProtocolID API_AVAILABLE(macos(11.0)); + +/* Timing */ +// extern const CFStringRef kMIDIPropertyTransmitsMTC API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyReceivesMTC API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyTransmitsClock API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyReceivesClock API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyAdvanceScheduleTimeMuSec API_AVAILABLE(macos(10.0)); + +/* Roles */ +// extern const CFStringRef kMIDIPropertyIsMixer API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyIsSampler API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyIsEffectUnit API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyIsDrumMachine API_AVAILABLE(macos(10.2)); + +/* Status */ +// extern const CFStringRef kMIDIPropertyOffline API_AVAILABLE(macos(10.1)); +// extern const CFStringRef kMIDIPropertyPrivate API_AVAILABLE(macos(10.2)); + +/* Drivers */ +// extern const CFStringRef kMIDIPropertyDriverOwner API_AVAILABLE(macos(10.1)); +// extern const CFStringRef kMIDIPropertyDriverVersion API_AVAILABLE(macos(10.2)); + +/* Connections */ +// extern const CFStringRef kMIDIPropertyCanRoute API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyIsBroadcast API_AVAILABLE(macos(10.2)); +extern const CFStringRef kMIDIPropertyConnectionUniqueID API_AVAILABLE(macos(10.1)); +// extern const CFStringRef kMIDIPropertyIsEmbeddedEntity API_AVAILABLE(macos(10.1)); +// extern const CFStringRef kMIDIPropertySingleRealtimeEntity API_AVAILABLE(macos(10.2)); + +/* Channels */ +// extern const CFStringRef kMIDIPropertyReceiveChannels API_AVAILABLE(macos(10.0)); +// extern const CFStringRef kMIDIPropertyTransmitChannels API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyMaxReceiveChannels API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyMaxTransmitChannels API_AVAILABLE(macos(10.2)); + +/* Banks */ +// extern const CFStringRef kMIDIPropertyReceivesBankSelectLSB API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyReceivesBankSelectMSB API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyTransmitsBankSelectLSB API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyTransmitsBankSelectMSB API_AVAILABLE(macos(10.2)); + +/* Notes */ +// extern const CFStringRef kMIDIPropertyReceivesNotes API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyTransmitsNotes API_AVAILABLE(macos(10.2)); + +/* Program Changes */ +// extern const CFStringRef kMIDIPropertyReceivesProgramChanges API_AVAILABLE(macos(10.2)); +// extern const CFStringRef kMIDIPropertyTransmitsProgramChanges API_AVAILABLE(macos(10.2)); #endif // __MIDIServices_h__ diff --git a/src/frameworks/CoreMIDI/src/MIDIServices.m b/src/frameworks/CoreMIDI/src/MIDIServices.m index 1a2d648b5f..ccb6e1faac 100644 --- a/src/frameworks/CoreMIDI/src/MIDIServices.m +++ b/src/frameworks/CoreMIDI/src/MIDIServices.m @@ -1,5 +1,8 @@ #import +/* Identification */ const CFStringRef kMIDIPropertyName = nil; -const CFStringRef kMIDIPropertyConnectionUniqueID = nil; const CFStringRef kMIDIPropertyUniqueID = nil; + +/* Connections */ +const CFStringRef kMIDIPropertyConnectionUniqueID = nil; From 0d161c83f9007ce7685ad7001c66df232af96512 Mon Sep 17 00:00:00 2001 From: jlucfarias Date: Sun, 25 Aug 2024 21:10:37 -0300 Subject: [PATCH 2/3] Uncomment `kMIDIPropertyAdvanceScheduleTimeMuSec` definition --- src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h | 2 +- src/frameworks/CoreMIDI/src/MIDIServices.m | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h b/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h index 844b2cc463..a55d82e1d0 100644 --- a/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h +++ b/src/frameworks/CoreMIDI/include/CoreMIDI/MIDIServices.h @@ -36,7 +36,7 @@ extern const CFStringRef kMIDIPropertyUniqueID API_AVAILABLE( // extern const CFStringRef kMIDIPropertyReceivesMTC API_AVAILABLE(macos(10.2)); // extern const CFStringRef kMIDIPropertyTransmitsClock API_AVAILABLE(macos(10.2)); // extern const CFStringRef kMIDIPropertyReceivesClock API_AVAILABLE(macos(10.2)); -// extern const CFStringRef kMIDIPropertyAdvanceScheduleTimeMuSec API_AVAILABLE(macos(10.0)); +extern const CFStringRef kMIDIPropertyAdvanceScheduleTimeMuSec API_AVAILABLE(macos(10.0)); /* Roles */ // extern const CFStringRef kMIDIPropertyIsMixer API_AVAILABLE(macos(10.2)); diff --git a/src/frameworks/CoreMIDI/src/MIDIServices.m b/src/frameworks/CoreMIDI/src/MIDIServices.m index ccb6e1faac..1b76b63cfa 100644 --- a/src/frameworks/CoreMIDI/src/MIDIServices.m +++ b/src/frameworks/CoreMIDI/src/MIDIServices.m @@ -4,5 +4,8 @@ const CFStringRef kMIDIPropertyName = nil; const CFStringRef kMIDIPropertyUniqueID = nil; +/* Timing */ +const CFStringRef kMIDIPropertyAdvanceScheduleTimeMuSec = nil; + /* Connections */ const CFStringRef kMIDIPropertyConnectionUniqueID = nil; From 6ab07320ef644433c7e11dada0cbe89f271f2c9e Mon Sep 17 00:00:00 2001 From: "Thomas A." Date: Sat, 31 Aug 2024 10:54:56 -0700 Subject: [PATCH 3/3] Add Note About Some Of These Values Intentionally Being "nil" Usually, we want to avoid lazily setting values as "nil". However, there are some instances where Apple would set these values as "nil". --- src/frameworks/CoreMIDI/src/MIDIServices.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frameworks/CoreMIDI/src/MIDIServices.m b/src/frameworks/CoreMIDI/src/MIDIServices.m index 1b76b63cfa..83be599fd9 100644 --- a/src/frameworks/CoreMIDI/src/MIDIServices.m +++ b/src/frameworks/CoreMIDI/src/MIDIServices.m @@ -1,5 +1,9 @@ #import +// Note: It is expected for some of these values to be assigned `nil`, +// Not sure why Apple doesn't actually assign a CFString value to these +// variables... + /* Identification */ const CFStringRef kMIDIPropertyName = nil; const CFStringRef kMIDIPropertyUniqueID = nil;