Skip to content

Commit

Permalink
Remove destinationProtocolId, because CoreMIDI translates MIDI2.0 <=>…
Browse files Browse the repository at this point in the history
… MIDI 1.0, if necessary.
  • Loading branch information
SolfaMode committed Sep 29, 2024
1 parent 34a5517 commit f696086
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
17 changes: 0 additions & 17 deletions src/framework/midi/internal/platform/osx/coremidioutport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ struct muse::midi::CoreMidiOutPort::Core {
MIDIClientRef client = 0;
MIDIPortRef outputPort = 0;
MIDIEndpointRef destinationId = 0;
MIDIProtocolID destinationProtocolId = kMIDIProtocol_1_0;
int deviceID = -1;
};

Expand Down Expand Up @@ -81,15 +80,6 @@ void CoreMidiOutPort::deinit()
}
}

void CoreMidiOutPort::getDestinationProtocolId()
{
if (__builtin_available(macOS 11.0, *)) {
SInt32 protocol = 0;
OSStatus err = MIDIObjectGetIntegerProperty(m_core->destinationId, kMIDIPropertyProtocolID, &protocol);
m_core->destinationProtocolId = err == noErr ? (MIDIProtocolID)protocol : kMIDIProtocol_1_0;
}
}

void CoreMidiOutPort::initCore()
{
OSStatus result;
Expand Down Expand Up @@ -141,11 +131,6 @@ void CoreMidiOutPort::initCore()
if (CFStringCompare(propertyChangeNotification->propertyName, kMIDIPropertyDisplayName, 0) == kCFCompareEqualTo
|| CFStringCompare(propertyChangeNotification->propertyName, kMIDIPropertyName, 0) == kCFCompareEqualTo) {
self->availableDevicesChanged().notify();
} else if (__builtin_available(macOS 11.0, *)) {
if (CFStringCompare(propertyChangeNotification->propertyName, kMIDIPropertyProtocolID, 0) == kCFCompareEqualTo
&& self->isConnected() && propertyChangeNotification->object == self->m_core->destinationId) {
self->getDestinationProtocolId();
}
}
} break;

Expand Down Expand Up @@ -247,8 +232,6 @@ Ret CoreMidiOutPort::connect(const MidiDeviceID& deviceID)

m_core->deviceID = std::stoi(deviceID);
m_core->destinationId = (MIDIEndpointRef)obj;

getDestinationProtocolId();
}

m_deviceID = deviceID;
Expand Down
1 change: 0 additions & 1 deletion src/framework/midi/internal/platform/osx/coremidioutport.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class CoreMidiOutPort : public IMidiOutPort

private:
void initCore();
void getDestinationProtocolId();

struct Core;
std::unique_ptr<Core> m_core;
Expand Down

0 comments on commit f696086

Please sign in to comment.