To throw a NotSupportedError, you can use
https://dxr.mozilla.org/servo/source/components/script/dom/audionode.rs#280
as an example, and see that the WebIDL contains either [Throws] (for a
method) or [SetterThrows]/[GetterThrows] for an attribute
(https://dxr.mozilla.org/servo/rev/56c2e85cab5b01ad31be3c69f0fcc2c992960e5c/components/script/dom/webidls/AudioNode.webidl#58)
For SetOrientation/SetPosition, you will need to access each appropriate
AudioParam member of AudioListener and invoke the SetValue method
(https://github.com/servo/servo/blob/56c2e85cab5b01ad31be3c69f0fcc2c992960e5c/components/script/dom/audioparam.rs#L123).
On 4/26/19 6:50 AM, Akhilesh Venkatasubramanian wrote:
HI CYBAI,
1. We are trying to implement the SetOrientation and the SetPosition
methods as here
<https://webaudio.github.io/web-audio-api/#AudioListener-methods>. We tried
quite a few variations, but not able to store the passed function value
into forwardX
<https://webaudio.github.io/web-audio-api/#dom-audiolistener-forwardx>.value
<https://webaudio.github.io/web-audio-api/#dom-audioparam-value>, forwardY
<https://webaudio.github.io/web-audio-api/#dom-audiolistener-forwardy>.value
<https://webaudio.github.io/web-audio-api/#dom-audioparam-value> etc. Can
you probably give us some pointers as to how we can proceed? I'm guessing
we should call the from the function as shown here
<https://github.com/servo/servo/blob/master/components/script/dom/audiolistener.rs#L147-L152>
.
2. Also, is there any example that I can refer to for rising the
NotSupportedError <https://heycam.github.io/webidl/#notsupportederror>?
Because we didn't clearly understand how we can check whether there is an
automation curve set using SetValueCurve for forwardX
<https://webaudio.github.io/web-audio-api/#dom-audiolistener-forwardx>,
forwardY
<https://webaudio.github.io/web-audio-api/#dom-audiolistener-forwardy>,
forwardZ
<https://webaudio.github.io/web-audio-api/#dom-audiolistener-forwardz> etc.
Thanks.
On Fri, Apr 26, 2019 at 5:28 AM Cheng You Bai <cyb.ai....@gmail.com> wrote:
Hi Srivatsan,
This is CYBAI who is a Servo contributor.
I think you can try to read this blogpost
<http://jeenalee.com/2016/10/03/implementing-doge-for-servo.html>.
It explains how to add a new DOM API for Servo from scratch and also
includes the uncomment methods part.
Hope it help!
Cheers,
CYBAI
On Fri, Apr 26, 2019 at 2:38 PM Srivatsan Narasimhan <snara...@ncsu.edu>
wrote:
Hi Josh,
This is Srivatsan Narasimhan from NCSU currently working on this issue
https://github.com/servo/servo/issues/22898 along with my team mates
akhilesh, balaji and arjun as a part of the course OODD. I uncommented
the
methods in the AudioListener.webidl and currently i am having some
issues
on writing the methods. I am getting problems with making the two
functions a member of the trait AudioListener methods.Is there any
reference or a guide that could help me with this?
Thanks
Srivatsan Narasimhan
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo