-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No way to get device callbacks #91
Comments
As you tried, it is implemented to invoke It simply dispatches what Android MIDI API emits. If your Android platform emits 3 changes then you will receive 3 events. But I don't think that's the case. It is more likely that you write app in Jetpack Compose and your app triggers multiple state changes for one event. If you still have doubts in ktmidi |
These events are fired for each port. If I connect my piano for example, 3 ports are opened, 1 input and 2 output ports, thus 3 state changes. |
Ah okay I understand what you meant. However it is not what ktmidi MidiAccess is like. It is basically following how Web MIDI API organize ports without the concept of "devices". It is by design. If you need platform specific features like this, you should directly use Android MIDI API. |
I am trying to detect when an input device is added on android to update UI. However deviceCallback is private in AndroidMidiAccess. How is one supposed to receive these events? I tried using stateChanges but it always issues 3 changes when I plug/unplug a cable
The text was updated successfully, but these errors were encountered: