W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2012

[Web MIDI API] send() method should also allow 3 shorts + timestamp

From: Marcos Caceres <marcosscaceres@gmail.com>
Date: Sun, 16 Dec 2012 07:30:01 +0000
To: "public-audio@w3.org" <public-audio@w3.org>
Message-ID: <F541426AB3A744A6858F8BDADBBF266D@gmail.com>
Currently, the send() method is defined as:   
void send (sequence<short> data, optional DOMHighResTimeStamp? timestamp);

However, it appears to me that it is extremely common to only want to send 3 bytes of data at a time (+ optional timestamp)… Having now been playing around with the API for about 10 hours, I actually keep forgetting to put things into an array (which leads to annoying errors). Can I recommend that the send interface be overloaded:

void send (sequence<short> data, optional DOMHighResTimeStamp? timestamp);
void send (short byte1, short byte2, short byte3, optional DOMHighResTimeStamp? timestamp);  

That would make the interface much more natural to work with and avoid having to remember to put things into an array all the time.  

--  
Marcos Caceres
http://datadriven.com.au
Received on Sunday, 16 December 2012 07:30:33 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:04 UTC