WebAudio / web-midi-api

The Web MIDI API, developed by the W3C Audio WG
http://webaudio.github.io/web-midi-api/
Other
323 stars 49 forks source link

Clarification about pending data on device disconnection #133

Open toyoshim opened 9 years ago

toyoshim commented 9 years ago

Should we keep all pending data that were sent with timestamps even after the device is disconnected, and send it if the device is available again when the specified time arrives? It would be better to explain it explicitly in section 8. MIDIConnectionEvent Interface.

cwilso commented 9 years ago

What do you think we should do?

toyoshim commented 9 years ago

I feel keeping pending data as possible by default would be consistent with other auto reconnection behaviors. If developers do not want to hold it, they can simply call clear() on disconnection event.

But data without timestamp, and data having overdue timestamp will be dropped on time.

agoode commented 9 years ago

The Core MIDI behavior is to send pending data if the device is connected at the scheduled time. If the device is not connected, the data is lost. Disconnection doesn't clear pending data.

This behavior seems fine for Web MIDI.

Step 9 of the open algorithm in the current spec suggests that data will queue in some way, which we may not want. Some decision and clarification would be good.