a question on style for arguments

In the recording document, we have a getRecordingOptions() function and  setRecordingOptions().  In the initial draft, the return value for getRecordingOptions and the argument for setRecordingOptions were of the same type, namely:


dictionary RecordingFormats {

    sequence<DOMString> containerEncodingFormats<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

    sequence<DOMString> audioEncodingFormats<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

    sequence<DOMString> videoEncodingFormats<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

};

However when setting the recording options it doesn't make sense to pass in a sequence for any of these items.  The app must chose a single value for the container, the audio encoding and the video encoding.  We could handle this by saying that the sequence must have length 1, but that seems sloppy to me.  I can split it up and define a new dictionary for setting:


dictionary RecordingFormat {

    <DOMString> containerEncodingFormat<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

    <DOMString> audioEncodingFormat<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

    <DOMString> videoEncodingFormat<file:///D:\W3C\WWW\webRTC\RecordingProposal.html>;

};

But this adds an extra type that's not very different from an existing one.

Is there some standard solution to this sort of problem?

Thanks,
Jim

Received on Tuesday, 27 November 2012 19:11:45 UTC