W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2012

Dictionary or interface?

From: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Date: Tue, 10 Jul 2012 00:42:34 +0300
Message-ID: <CAJhzemU92HTHV9Jgjt_FfhDSVJiKvW1rq2CVP7Q10kM1iKT3XA@mail.gmail.com>
To: public-script-coord@w3.org
Hey there!

I'm a co-editor of the Web MIDI API spec and I'm having a bit of a problem
with how to define something.

In the spec, we have a MIDIMessage interface [1], that can be either
machine-generated (coming in from a device) or created by the user using
MIDIAccess::createMIDIMessage [2]. What I'd like to do is get rid of the
whole createMIDIMessage and make the MIDIMessage a dictionary so that
developers could just pass an object that looks like a MIDIMessage to
methods that take one as an input. However, the MIDIEvent interface [3]
contains a collection of MIDIMessages, so I'm not sure how that would work
if MIDIMessage is a dictionary.

Any ideas? Thanks for the help.

Cheers,
Jussi Kalliokoski

[1]
https://dvcs.w3.org/hg/audio/raw-file/tip/midi/specification.html#idl-def-MIDIMessage
[2]
https://dvcs.w3.org/hg/audio/raw-file/tip/midi/specification.html#widl-MIDIAccess-createMIDIMessage-MIDIMessage-short-status-short-channel-DOMHighResTimeStamp-timestamp-Uint8Array-data
[3]
https://dvcs.w3.org/hg/audio/raw-file/tip/midi/specification.html#idl-def-MIDIEvent
Received on Monday, 9 July 2012 21:43:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC