Re: Use of both numbered constants and strings

On Mon, Apr 15, 2013 at 10:36 AM, Simon Pieters <simonp@opera.com> wrote:

> Hi
>
> https://dvcs.w3.org/hg/audio/**raw-file/tip/webaudio/**specification.html<https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html>says
>
> [[
> Some attributes taking constant values have changed during API review. The
> old way uses integer values, while the new way uses Web IDL string values.
> An implementation must support both integer and string values for setting
> these attributes:
> // PannerNode constants for the .panningModel attribute
>
> // Old way
> const unsigned short EQUALPOWER = 0;
> const unsigned short HRTF = 1;
> const unsigned short SOUNDFIELD = 2;
>
> // New way
> enum PanningModelType {
>   "equalpower",
>   "HRTF",
>   "soundfield"
> };
> ]]
>
> I'm not quite happy about the spec supporting both the legacy way and the
> new way. AFAIK no other API supports both. In HTML, for APIs that are
> widely used and thus can't have the numbered constants removed, the API
> only supports the legacy constants (can't come up with an example right
> now). For APIs that are not widely used yet and thus can be changed in
> incompatible ways, the APIs were changed to only support the strings (e.g.
> TextTrack.mode).
>
> Is Web Audio API widely used? Please consider choosing between "old way"
> and "new way". I think supporting both will be confusing for authors.


Simon, yes we consider it widely used as there are both Chrome Apps (Angry
Birds, etc.), and iOS/Safari apps  which are shipping.

We had a very long discussion about this at the audio face-face meeting
this year, so this is what we have.

Chris




>
>
> --
> Simon Pieters
> Opera Software
>
>

Received on Tuesday, 16 April 2013 21:20:32 UTC