Major changes to Web MIDI API
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>
Wed, 05 Sep 2012 15:13:25 +0300
changeset 157 bf0e920450e6
parent 156 2a6431dcb680
child 158 c5ecdca5be3f
Major changes to Web MIDI API

* Deprecated the boolean return value from MIDIOutput#sendMIDIMessage and
MIDIOutput#sendMessage per https://www.w3.org/Bugs/Public/show_bug.cgi?id=18759
* Changed MIDIMessage into a dictionary, deprecating the need for
MIDIAccess#createMIDIMessage.
* MIDIMessage now only consists of data and a timestamp,
per https://www.w3.org/Bugs/Public/show_bug.cgi?id=18764
* Changed the signature of MIDIOutput#sendMessage to just take the data values
as its input, per https://www.w3.org/Bugs/Public/show_bug.cgi?id=18762
midi/specification.html
--- a/midi/specification.html	Mon Sep 03 14:15:43 2012 +0100
+++ b/midi/specification.html	Wed Sep 05 15:13:25 2012 +0300
@@ -431,63 +431,6 @@
             </li>
           </ol>
         </dd>
-        <dt><a>MIDIMessage</a> createMIDIMessage(short status, short? channel,
-                                    DOMHighResTimeStamp timestamp,
-                                    Uint8Array? data)</dt>
-        <dd>
-          <p>
-            Creates and returns a new <code><a>MIDIMessage</a></code> according
-            to the specified parameters.
-          </p>
-
-          <p>
-            When the
-            <dfn id="midiaccess-create-midi-message"><code>createMIDIMessage()</code></dfn>
-            is invoked, the user agent MUST run the following steps:
-          </p>
-
-          <ol>
-            <li>
-              <p>
-                Let <var>status</var> be the first <code>short</code> argument.
-              </p>
-            </li>
-
-            <li>
-              <p>
-                Let <var>channel</var> be the second <code>short</code> argument.
-              </p>
-            </li>
-
-            <li>
-              <p>
-                Let <var>timestamp</var> be the
-                <code>DOMHighResTimeStamp</code> argument, if not null. Else
-                let <var>timestamp</var> be the current time as a
-                <code>DOMTimeHighResTimeStamp</code>.
-              </p>
-            </li>
-
-            <li>
-              <p>
-                Let <var>data</var> be the <code>Uint8Array</code> argument.
-              </p>
-            </li>
-
-            <li>
-              <p>
-                Let <var>message</var> be a new <code><a>MIDIMessage</a></code>
-                with <var>status</var>, <var>data</var>, <var>timestamp</var>
-                and <var>channel</var> assigned to their corresponding
-                properties of the <var>message</var>.
-              </p>
-            </li>
-
-            <li>
-              <p>Return <var>message</var></p>
-            </li>
-          </ol>
-        </dd>
       </dl>
     </section>
 
@@ -670,21 +613,16 @@
         <dl title="[NoInterfaceObject]
                    interface MIDIOutput"
             class="idl">
-          <dt>boolean sendMIDIMessage(MIDIMessage message)</dt>
+          <dt>void sendMIDIMessage(MIDIMessage message)</dt>
           <dd>
             <p>
-              Sends the MIDI message to the port and returns a boolean
-              signifying whether the operation was succesful.
+              Sends the MIDI message to the port.
             </p>
           </dd>
-          <dt>boolean sendMessage(short status, short? channel,
-                                    DOMHighResTimeStamp timestamp,
-                                    short? data0, short? dataX)</dt>
+          <dt>void sendMessage(short data0, short? dataX)</dt>
           <dd>
             <p>
-              Creates a new MIDI message, sends it to the port
-              and returns a boolean signifying whether the
-              operation was succesful.
+              Creates a new MIDI message of the data and sends it to the port.
             </p>
           </dd>
         </dl>
@@ -694,33 +632,21 @@
     <section>
       <h2><a>MIDIMessage</a> Interface</h2>
       <dl title="[NoInterfaceObject]
-                 interface MIDIMessage"
+                 dictionary MIDIMessage"
           class="idl">
-        <dt>attribute DOMHighResTimeStamp timestamp</dt>
+        <dt>DOMHighResTimeStamp timestamp</dt>
         <dd>
           <p>
             A <code>DOMHighResTimeStamp</code> signifying when the event
             occured, will occur or should occur.
           </p>
         </dd>
-        <dt>attribute short status</dt>
-        <dd>
-          <p>
-            The status code of the MIDI message.
-          </p>
-        </dd>
-        <dt>attribute Uint8Array data</dt>
+        <dt>Uint8Array data</dt>
         <dd>
           <p>
             A Uint8Array signifying the data the message contains.
           </p>
         </dd>
-        <dt>attribute short channel</dt>
-        <dd>
-          <p>
-            The MIDI channel of the message.
-          </p>
-        </dd>
       </dl>
 
       <section>