Major changes to Web MIDI API
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>
Wed, 05 Sep 2012 15:13:25 +0300
changeset 157bf0e920450e6
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
     1.1 --- a/midi/specification.html	Mon Sep 03 14:15:43 2012 +0100
     1.2 +++ b/midi/specification.html	Wed Sep 05 15:13:25 2012 +0300
     1.3 @@ -431,63 +431,6 @@
     1.4              </li>
     1.5            </ol>
     1.6          </dd>
     1.7 -        <dt><a>MIDIMessage</a> createMIDIMessage(short status, short? channel,
     1.8 -                                    DOMHighResTimeStamp timestamp,
     1.9 -                                    Uint8Array? data)</dt>
    1.10 -        <dd>
    1.11 -          <p>
    1.12 -            Creates and returns a new <code><a>MIDIMessage</a></code> according
    1.13 -            to the specified parameters.
    1.14 -          </p>
    1.15 -
    1.16 -          <p>
    1.17 -            When the
    1.18 -            <dfn id="midiaccess-create-midi-message"><code>createMIDIMessage()</code></dfn>
    1.19 -            is invoked, the user agent MUST run the following steps:
    1.20 -          </p>
    1.21 -
    1.22 -          <ol>
    1.23 -            <li>
    1.24 -              <p>
    1.25 -                Let <var>status</var> be the first <code>short</code> argument.
    1.26 -              </p>
    1.27 -            </li>
    1.28 -
    1.29 -            <li>
    1.30 -              <p>
    1.31 -                Let <var>channel</var> be the second <code>short</code> argument.
    1.32 -              </p>
    1.33 -            </li>
    1.34 -
    1.35 -            <li>
    1.36 -              <p>
    1.37 -                Let <var>timestamp</var> be the
    1.38 -                <code>DOMHighResTimeStamp</code> argument, if not null. Else
    1.39 -                let <var>timestamp</var> be the current time as a
    1.40 -                <code>DOMTimeHighResTimeStamp</code>.
    1.41 -              </p>
    1.42 -            </li>
    1.43 -
    1.44 -            <li>
    1.45 -              <p>
    1.46 -                Let <var>data</var> be the <code>Uint8Array</code> argument.
    1.47 -              </p>
    1.48 -            </li>
    1.49 -
    1.50 -            <li>
    1.51 -              <p>
    1.52 -                Let <var>message</var> be a new <code><a>MIDIMessage</a></code>
    1.53 -                with <var>status</var>, <var>data</var>, <var>timestamp</var>
    1.54 -                and <var>channel</var> assigned to their corresponding
    1.55 -                properties of the <var>message</var>.
    1.56 -              </p>
    1.57 -            </li>
    1.58 -
    1.59 -            <li>
    1.60 -              <p>Return <var>message</var></p>
    1.61 -            </li>
    1.62 -          </ol>
    1.63 -        </dd>
    1.64        </dl>
    1.65      </section>
    1.66  
    1.67 @@ -670,21 +613,16 @@
    1.68          <dl title="[NoInterfaceObject]
    1.69                     interface MIDIOutput"
    1.70              class="idl">
    1.71 -          <dt>boolean sendMIDIMessage(MIDIMessage message)</dt>
    1.72 +          <dt>void sendMIDIMessage(MIDIMessage message)</dt>
    1.73            <dd>
    1.74              <p>
    1.75 -              Sends the MIDI message to the port and returns a boolean
    1.76 -              signifying whether the operation was succesful.
    1.77 +              Sends the MIDI message to the port.
    1.78              </p>
    1.79            </dd>
    1.80 -          <dt>boolean sendMessage(short status, short? channel,
    1.81 -                                    DOMHighResTimeStamp timestamp,
    1.82 -                                    short? data0, short? dataX)</dt>
    1.83 +          <dt>void sendMessage(short data0, short? dataX)</dt>
    1.84            <dd>
    1.85              <p>
    1.86 -              Creates a new MIDI message, sends it to the port
    1.87 -              and returns a boolean signifying whether the
    1.88 -              operation was succesful.
    1.89 +              Creates a new MIDI message of the data and sends it to the port.
    1.90              </p>
    1.91            </dd>
    1.92          </dl>
    1.93 @@ -694,33 +632,21 @@
    1.94      <section>
    1.95        <h2><a>MIDIMessage</a> Interface</h2>
    1.96        <dl title="[NoInterfaceObject]
    1.97 -                 interface MIDIMessage"
    1.98 +                 dictionary MIDIMessage"
    1.99            class="idl">
   1.100 -        <dt>attribute DOMHighResTimeStamp timestamp</dt>
   1.101 +        <dt>DOMHighResTimeStamp timestamp</dt>
   1.102          <dd>
   1.103            <p>
   1.104              A <code>DOMHighResTimeStamp</code> signifying when the event
   1.105              occured, will occur or should occur.
   1.106            </p>
   1.107          </dd>
   1.108 -        <dt>attribute short status</dt>
   1.109 -        <dd>
   1.110 -          <p>
   1.111 -            The status code of the MIDI message.
   1.112 -          </p>
   1.113 -        </dd>
   1.114 -        <dt>attribute Uint8Array data</dt>
   1.115 +        <dt>Uint8Array data</dt>
   1.116          <dd>
   1.117            <p>
   1.118              A Uint8Array signifying the data the message contains.
   1.119            </p>
   1.120          </dd>
   1.121 -        <dt>attribute short channel</dt>
   1.122 -        <dd>
   1.123 -          <p>
   1.124 -            The MIDI channel of the message.
   1.125 -          </p>
   1.126 -        </dd>
   1.127        </dl>
   1.128  
   1.129        <section>