microsoft / MIDI

Windows MIDI Services
MIT License
314 stars 27 forks source link

[Feature] Consider making it possible for a MidiEndpointConnection to be automatically reconnected after a device has disconnected/reconnected #320

Open Psychlist1972 opened 7 months ago

Psychlist1972 commented 7 months ago

If a device is disconnected and reconnected, currently, the API requires creating a new connection, or at least re-opening the existing connection. But in cases where this happens due to something transient like putting the PC into suspend mode, the device cannot be reconnected without creating a new connection instance through the MidiSession.

Consider providing a way to easily reconnect automatically when a device reappears (API would control) as long as the MidiEndpointConnection instance exists.

Psychlist1972 commented 6 months ago

This will be implemented in Developer Preview 6

Psychlist1972 commented 3 months ago

Keeping this open due to bug reports of it not working in DP6.

Psychlist1972 commented 3 months ago

Issue #360 is the related issue

Psychlist1972 commented 2 weeks ago

Still working on this, FYI.

MusicMaker commented 1 week ago

Should this callback be added using the watcher ? Currently DP6 code for the watcher does not have a property for this. Something alike auto revokeOnWatcherDeviceReconnected = watcher.Reconnected(OnWatcherDeviceReconnected);