Implement MIDI-CI message processing functions in Messenger class #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement MIDI-CI Message Processing Functions
This PR implements all the empty
processXxx()functions in the C++ Messenger class by following the Kotlin implementation patterns fromktmidi/ktmidi-ci/src/commonMain/kotlin/dev/atsushieno/ktmidi/ci/Messenger.kt.Changes Made
Core Implementation
processXxx()functions that were previously just stubs in PR Implement MIDI-CI message processing #19handleNewEndpoint()helper method for connection management and auto-inquiry triggersonClient()template helper for client connection lookup by source MUIDprocessXxx()function now invokes message callbacks to maintain event-driven architectureKey Functions Implemented
processDiscoveryReply(): CallshandleNewEndpoint()and triggers auto-inquiries for endpoint, profile, property, and process capabilitiesprocessProfileReply(),processProfileAddedReport(), etc.: UseonClient()pattern to delegate to client facadesprocessPropertyCapabilitiesReply(),processGetDataReply(), etc.: Handle property exchange messages with client connection lookupprocessDiscovery(): Sends discovery reply to incoming discovery inquiriesprocessEndpointMessage(),processProfileInquiry(), etc.: Handle incoming inquiries with appropriate callback invocationArchitecture Preserved
Testing
./tests/midi-ci-tests- All tests passed!)Implementation Details
The implementation closely follows the Kotlin patterns while adapting to C++ idioms:
handleNewEndpoint()This addresses the feedback from PR #19 where all
processXxx()functions were empty and needed proper implementation for MIDI-CI communication to work.Link to Devin run
https://app.devin.ai/sessions/1455703679904961b1cd5e8140a0e963
Requested by
Atsushi Eno (atsushieno@gmail.com)