More specificity to the MIDI API.
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>
Wed, 23 May 2012 15:17:48 +0300
changeset 55 5bcb7b2ada65
parent 54 58d790df4847
child 56 d981f8e2a1e4
More specificity to the MIDI API.

Fixed a broken event definition (MIDIInputDevice#onmidimessage).

Added event definitions for MIDIDevice#ondevicedisconnect and
MIDIDevice#ondeviceconnect, and defined when they should be triggered.
midi/specification.html
--- a/midi/specification.html	Wed May 23 13:40:24 2012 +0300
+++ b/midi/specification.html	Wed May 23 15:17:48 2012 +0300
@@ -250,6 +250,39 @@
 
     <section>
       <h2><a>MIDIDevice</a> Interface</h2>
+
+      <p>
+        Whenever the MIDI device corresponding the
+        <code><a>MIDIDevice</a></code> is disconnected or becomes unavailable,
+        the UA MUST run the following steps:
+      </p>
+
+      <ol>
+        <li>
+          <p>
+            Fire a simple event named <code><a
+            href="#event-mididevice-devicedisconnect">devicedisconnect</a></code>
+            at the object.
+          </p>
+        </li>
+      </ol>
+
+      <p>
+        Whenever the MIDI device corresponding the
+        <code><a>MIDIDevice</a></code> is connected or reconnected,
+        the UA MUST run the following steps:
+      </p>
+
+      <ol>
+        <li>
+          <p>
+            Fire a simple event named <code><a
+            href="#event-mididevice-deviceconnect">deviceconnect</a></code>
+            at the object.
+          </p>
+        </li>
+      </ol>
+
       <div class="idl" title="MIDIInputDevice implements MIDIDevice"></div>
       <div class="idl" title="MIDIOutputDevice implements MIDIDevice"></div>
       <dl title="[NoInterfaceObject]
@@ -280,10 +313,22 @@
         <dt class="no-docs">[TreatNonCallableAsNull] attribute
                             Function? ondevicedisconnect</dt>
         <dd>
+            <p>
+              This event handler, of type <code><a href=
+              "#event-mididevice-devicedisconnect">devicedisconnect</a></code>,
+              MUST be supported by all objects implementing
+              <code><a>MIDIInputDevice</a></code> interface.
+            </p>
         </dd>
         <dt class="no-docs">[TreatNonCallableAsNull] attribute
                             Function? ondeviceconnect</dt>
         <dd>
+            <p>
+              This event handler, of type <code><a href=
+              "#event-mididevice-deviceconnect">deviceconnect</a></code>,
+              MUST be supported by all objects implementing
+              <code><a>MIDIInputDevice</a></code> interface.
+            </p>
         </dd>
       </dl>
 
@@ -351,8 +396,8 @@
           <dd>
             <p>
               This event handler, of type <code><a href=
-              "#event-midiinputdevice-midimessage"></a></code>, MUST be
-              supported by all objects implementing
+              "#event-midiinputdevice-midimessage">midimessage</a></code>,
+              MUST be supported by all objects implementing
               <code><a>MIDIInputDevice</a></code> interface.
             </p>
           </dd>