Re: ondisconnect, was Re: Should MIDIInput use a callback instead of events?

On Tuesday, 19 February 2013 at 18:38, Chris Wilson wrote:

> On Tue, Feb 19, 2013 at 10:31 AM, Marcos Caceres <w3c@marcosc.com (mailto:w3c@marcosc.com)> wrote:
> > On Tuesday, 19 February 2013 at 18:26, Chris Wilson wrote:
> > > 
> > > interface MIDIPort : EventTarget {
> > > ...
> > > attribute EventHandler ondisconnect;
> > > ...
> > > }
> > 
> > 
> > oooohhh! I thought it was not possible to implement this? Will the MIDIController gain a onconenct listener?
> 
> It's not possible, without polling, to reliably implement it on the current Windows MIDI APIs. However, it is possible on Linux and OSX CoreMIDI, and I started hearing explicit requests for it from MIDI vendors. It will have to be "optional" on some underlying OSes, or have allowed long time latency (i.e. you'll have to poll the MIDI device list on Windows to tell when a new device comes online). 
> 
> And yes, MIDIAccess would gain an onconnect.
FWIW, the proposed changes sound good to me :) 
-- 
Marcos Caceres
http://datadriven.com.au

Received on Tuesday, 19 February 2013 22:14:51 UTC