This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20506 - Do we need MIDIOutput and MIDIInput?
Summary: Do we need MIDIOutput and MIDIInput?
Status: CLOSED FIXED
Alias: None
Product: AudioWG
Classification: Unclassified
Component: MIDI API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Chris Wilson
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-24 08:17 UTC by Marcos Caceres
Modified: 2013-01-18 15:51 UTC (History)
2 users (show)

See Also:


Attachments

Description Marcos Caceres 2012-12-24 08:17:43 UTC
I'm wondering if we really need MIDIOutput and MIDinput to extend MIDIPort. It seems like a bit of overkill to have to add two more additional interfaces to the platform when all that is being added is "onmessage" and on "send()" by each interface respectively. Additionally, the "type" attribute of MIDIPort is already restricted to "input" or "output", hence it feels redundant to have a whole new interface to determine the type of an object (which is already part of the base class).

I recommend just folding MIDIPOutput and MIDIIntput back onto MIDIPort. An port of type input simply does noting when send() is invoked, and MIDIPort of type output does not receive message events.

Is there a particular use case I'm missing that is not already covered?
Comment 1 Marcos Caceres 2012-12-26 00:46:31 UTC
Just thought of something... maybe MIDIPort does not need to extend EventTarget, but rather MIDIInput needs to implement it instead. You will note that "window.EventTarget" is not actually an object in any browser (well, in Opera, Chrome, and Safari at least). That would solve the issue of having MIDIOutput expose .addEventListener() and friends.
Comment 2 Marcos Caceres 2012-12-26 00:49:03 UTC
To be clear, what I mean is:

interface MIDIInput : MIDIPort {
             attribute EventHandler onmessage;
};
MIDIInput implements EventTarget; 


And MIDIPort becomes just:

interface MIDIPort{
 ... 
}
Comment 3 Chris Wilson 2012-12-26 19:02:13 UTC
That's essentially how it used to be, so sure.  :)

https://github.com/WebAudio/web-midi-api/commit/6f0ca73534d69f9f902bcffeda908f4d26834635
Comment 4 Olivier Thereaux 2013-01-18 15:51:02 UTC
Batch-closing RESOLVED MIDI issues. Reminder: midi issues now tracked at https://github.com/WebAudio/web-midi-api/issues