Making the MIDI API spec a bit clearer.
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>
Wed, 23 May 2012 13:40:24 +0300
changeset 54 58d790df4847
parent 53 6ae8ff480bca
child 55 5bcb7b2ada65
Making the MIDI API spec a bit clearer.

Made MIDIInputDevice and MIDIOutputDevice subsections of MIDIDevice.
midi/specification.html
--- a/midi/specification.html	Wed May 23 13:35:23 2012 +0300
+++ b/midi/specification.html	Wed May 23 13:40:24 2012 +0300
@@ -286,116 +286,116 @@
         <dd>
         </dd>
       </dl>
-    </section>
-
-    <section>
-      <h2><a>MIDIInputDevice</a> Interface</h2>
-
-      <p>
-        Whenever the MIDI device corresponding the
-        <code><a>MIDIInputDevice</a></code> sends a MIDI message, the UA MUST
-        run the following steps:
-      </p>
-
-      <ol>
-        <li>
-          <p>
-            Let <code>device</code> be the <code><a>MIDIInputDevice</a></code>.
-          </p>
-        </li>
-
-        <li>
-          <p>
-            Let <code>messages</code> be a newly constructed
-            <code>sequence&lt;<a>MIDIMessage</a>&gt;</code> corresponding the
-            MIDI messages the device sent.
-          </p>
-        </li>
-
-        <li>
-          <p>
-            Let <code>event</code> be a newly constructed
-            <code><a>MIDIEvent</a></code>, with the <code>MIDIMessages</code>
-            attribute set to <code>messages</code>.
-          </p>
-        </li>
 
-        <li>
-          <p>
-            Fire an event named <code><a
-            href="#event-midiinputdevice-midimessage">midimessage</a></code>
-            at the object, using the <code>event</code> as the event object.
-          </p>
-        </li>
-      </ol>
+      <section>
+        <h3><a>MIDIInputDevice</a> Interface</h3>
 
-      <dl title="[NoInterfaceObject]
-                 interface MIDIInputDevice implements EventTarget"
-          class="idl">
-        <dt>readonly attribute DOMString deviceType</dt>
-        <dd>
-          <p>
-            A descriptor property to distinguish whether the device is an
-            input or an output device. For <code><a>MIDIInputDevice</a></code>,
-            this MUST be <code>"INPUT"</code>.
-          </p>
-        </dd>
-        <dt>readonly attribute MediaStreamTrack stream</dt>
-        <dd>
-          <p>
-            A <code>MediaStreamTrack</code> representing the corresponding
-            <code><a>MIDIInputDevice</a></code>.
-          </p>
-        </dd>
-        <dt class="no-docs">[TreatNonCallableAsNull] attribute
-                            Function? onmidimessage</dt>
-        <dd>
-          <p>
-            This event handler, of type <code><a href=
-            "#event-midiinputdevice-midimessage"></a></code>, MUST be
-            supported by all objects implementing
-            <code><a>MIDIInputDevice</a></code> interface.
-          </p>
-        </dd>
-      </dl>
+        <p>
+          Whenever the MIDI device corresponding the
+          <code><a>MIDIInputDevice</a></code> sends a MIDI message, the UA MUST
+          run the following steps:
+        </p>
+
+        <ol>
+          <li>
+            <p>
+              Let <code>device</code> be the <code><a>MIDIInputDevice</a></code>.
+            </p>
+          </li>
+
+          <li>
+            <p>
+              Let <code>messages</code> be a newly constructed
+              <code>sequence&lt;<a>MIDIMessage</a>&gt;</code> corresponding the
+              MIDI messages the device sent.
+            </p>
+          </li>
+
+          <li>
+            <p>
+              Let <code>event</code> be a newly constructed
+              <code><a>MIDIEvent</a></code>, with the <code>MIDIMessages</code>
+              attribute set to <code>messages</code>.
+            </p>
+          </li>
+
+          <li>
+            <p>
+              Fire an event named <code><a
+              href="#event-midiinputdevice-midimessage">midimessage</a></code>
+              at the object, using the <code>event</code> as the event object.
+            </p>
+          </li>
+        </ol>
+
+        <dl title="[NoInterfaceObject]
+                   interface MIDIInputDevice implements EventTarget"
+            class="idl">
+          <dt>readonly attribute DOMString deviceType</dt>
+          <dd>
+            <p>
+              A descriptor property to distinguish whether the device is an
+              input or an output device. For <code><a>MIDIInputDevice</a></code>,
+              this MUST be <code>"INPUT"</code>.
+            </p>
+          </dd>
+          <dt>readonly attribute MediaStreamTrack stream</dt>
+          <dd>
+            <p>
+              A <code>MediaStreamTrack</code> representing the corresponding
+              <code><a>MIDIInputDevice</a></code>.
+            </p>
+          </dd>
+          <dt class="no-docs">[TreatNonCallableAsNull] attribute
+                              Function? onmidimessage</dt>
+          <dd>
+            <p>
+              This event handler, of type <code><a href=
+              "#event-midiinputdevice-midimessage"></a></code>, MUST be
+              supported by all objects implementing
+              <code><a>MIDIInputDevice</a></code> interface.
+            </p>
+          </dd>
+        </dl>
       </section>
 
-    <section>
-      <h2><a>MIDIOutputDevice</a> Interface</h2>
-      <dl title="[NoInterfaceObject]
-                 interface MIDIOutputDevice"
-          class="idl">
-        <dt>readonly attribute DOMString deviceType</dt>
-        <dd>
-          <p>
-            A descriptor property to distinguish whether the device is an
-            input or an output device. For <code><a>MIDIOutputDevice</a></code>,
-            this MUST be <code>"OUTPUT"</code>.
-          </p>
-        </dd>
-        <dt>boolean sendMIDIMessage(MIDIMessage message)</dt>
-        <dd>
-          <p>
-            Sends the MIDI message to the device and returns a boolean
-            signifying whether the operation was succesful.
-          </p>
-        </dd>
-        <dt>void addInput(MediaStreamTrack stream)</dt>
-        <dd>
-          <p>
-            Connects a <code>MediaMediaStreamTrack</code> to the
-            <code><a>MIDIOutputDevice</a></code>, piping all the MIDI messages
-            in the track to the output device.
-          </p>
-        </dd>
-        <dt>void removeInput(MediaStreamTrack stream)</dt>
-        <dd>
-          <p>
-            Removes a connection to a <code>MediaMediaStreamTrack</code> from
-            the <code><a>MIDIOutputDevice</a></code>.
-          </p>
-        </dd>
-      </dl>
+      <section>
+        <h3><a>MIDIOutputDevice</a> Interface</h3>
+        <dl title="[NoInterfaceObject]
+                   interface MIDIOutputDevice"
+            class="idl">
+          <dt>readonly attribute DOMString deviceType</dt>
+          <dd>
+            <p>
+              A descriptor property to distinguish whether the device is an
+              input or an output device. For <code><a>MIDIOutputDevice</a></code>,
+              this MUST be <code>"OUTPUT"</code>.
+            </p>
+          </dd>
+          <dt>boolean sendMIDIMessage(MIDIMessage message)</dt>
+          <dd>
+            <p>
+              Sends the MIDI message to the device and returns a boolean
+              signifying whether the operation was succesful.
+            </p>
+          </dd>
+          <dt>void addInput(MediaStreamTrack stream)</dt>
+          <dd>
+            <p>
+              Connects a <code>MediaMediaStreamTrack</code> to the
+              <code><a>MIDIOutputDevice</a></code>, piping all the MIDI messages
+              in the track to the output device.
+            </p>
+          </dd>
+          <dt>void removeInput(MediaStreamTrack stream)</dt>
+          <dd>
+            <p>
+              Removes a connection to a <code>MediaMediaStreamTrack</code> from
+              the <code><a>MIDIOutputDevice</a></code>.
+            </p>
+          </dd>
+        </dl>
+      </section>
     </section>
 
     <section>