This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20415 - Add a serializer to MIDIPort
Summary: Add a serializer to MIDIPort
Status: CLOSED NEEDSINFO
Alias: None
Product: AudioWG
Classification: Unclassified
Component: MIDI API (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: TBD
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-17 17:21 UTC by Jussi Kalliokoski
Modified: 2013-01-18 15:50 UTC (History)
2 users (show)

See Also:


Attachments

Description Jussi Kalliokoski 2012-12-17 17:21:11 UTC
See this thread: http://lists.w3.org/Archives/Public/public-audio/2012OctDec/0697.html
Comment 1 Chris Wilson 2012-12-17 18:51:13 UTC
Can you describe exactly what feature you're trying to get from this (i.e. user scenario)?
Comment 2 Marcos Caceres 2012-12-17 20:57:09 UTC
(In reply to comment #1)
> Can you describe exactly what feature you're trying to get from this (i.e.
> user scenario)?

See "9.2 Enumerating Inputs and Outputs" example:
https://dvcs.w3.org/hg/audio/raw-file/tip/midi/specification.html#enumerating-inputs-and-outputs

That's pretty common... with toJSON, it becomes something like:

function showPorts( midiAccess ) {
  function show(port, i){
     console.log("Input port #" + i + " " + port.toJSON());
  }
  midiAccess.enumerateInputs().forEach(show);
  midiAccess.enumerateOutputs().forEach(show);
}
Comment 3 Chris Wilson 2012-12-17 21:01:25 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Can you describe exactly what feature you're trying to get from this (i.e.
> > user scenario)?
> 
> See "9.2 Enumerating Inputs and Outputs" example:
> https://dvcs.w3.org/hg/audio/raw-file/tip/midi/specification.
> html#enumerating-inputs-and-outputs
> 
> That's pretty common... with toJSON, it becomes something like:
> 
> function showPorts( midiAccess ) {
>   function show(port, i){
>      console.log("Input port #" + i + " " + port.toJSON());
>   }
>   midiAccess.enumerateInputs().forEach(show);
>   midiAccess.enumerateOutputs().forEach(show);
> }

That sample was just enumerating the parameters for debugging purposes, though - serialization implies deserialization.  I don't think the "serialize everything in the input/output object" is a particularly interesting scenario, unless you're trying to imply that fromJSON() could re-create the port - and this is a "magic host object".  :)
Comment 4 Marcos Caceres 2012-12-17 23:16:20 UTC
(In reply to comment #3)
> That sample was just enumerating the parameters for debugging purposes,
> though - serialization implies deserialization.  I don't think the
> "serialize everything in the input/output object" is a particularly
> interesting scenario, unless you're trying to imply that fromJSON() could
> re-create the port - and this is a "magic host object".  :)

Ok, fair call. I currently don't have a case for serialization (apart form using it as a stringifier in debugging). 

I think there might be a case for storing serialized versions of previously used ports, etc. But I need to encounter the actual use case through playing around a bit more with the API.... 

Can we mark this as RESOLVED/NEEDSINFO?
Comment 5 Olivier Thereaux 2013-01-18 15:50:57 UTC
Batch-closing RESOLVED MIDI issues. Reminder: midi issues now tracked at https://github.com/WebAudio/web-midi-api/issues