Re: Comments on draft MIDI API

On Tue, Jun 26, 2012 at 11:34 AM, Jussi Kalliokoski <
jussi.kalliokoski@gmail.com> wrote:

> The semantics here may be too strong, maybe SHOULD should be used instead
> of MUST, as forcing the browser to poll on the devices when the OS doesn't
> provide an API for this is a bad idea. And disconnect and connect are not
> applicable to MIDI ports anyway (as in, not direct USB connection).
>
>
>> > And the API does allow for (un)plugging. [1]
>>
>> But only for devices that the app already knows about and keeps track of
>> — or am I missing something? To be more concrete, how would a Web app
>> know that the new MIDI keyboard I just bought just got plugged in?
>>
>
> According to the current API, the only way would be polling. I've been
> thinking of a way to fix this, perhaps an event to MIDIAccess when any
> device is plugged in or out would suffice, but I'm not sure yet.
>
>
>>
>>
Putting the event on MIDIAccess seems like the right thing. Many MIDI
devices are USB, so you'll get that notification. I like the way CoreMIDI
does it on iOS, you get all sorts of notifications for various events:
http://developer.apple.com/library/ios/#documentation/CoreMidi/Reference/MIDIServices_Reference/Reference/reference.html#//apple_ref/doc/c_ref/MIDINotificationMessageID


Adam

Received on Tuesday, 26 June 2012 15:45:02 UTC