lichen-community-systems / flocking-midi

A collection of MIDI components for Infusion and Flocking
1 stars 2 forks source link

Add an event to flock.midi.access that notifies when the connected ports have changed #12

Open colinbdclark opened 5 years ago

colinbdclark commented 5 years ago

The Web MIDI API provides a onstatechange event that will fire whenever the connected set of ports change—for example, when a MIDI device is connected or disconnected from the computer.

Flocking does not provide an event that can notify clients when this occurs. As a result, the flock.ui.midiSelector, for example, is unable to refresh itself on the fly when ports come or go.

We should add a new onPortsChanged event to the System component, which will fire whenever its underlying access object notifies of changes.