mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1055211 - Add bypass method on AudioNodeActors. r=vp
This commit is contained in:
parent
afc4eee46a
commit
fc3aa417ca
@ -20,9 +20,10 @@ support-files =
|
||||
[browser_audionode-actor-get-set-param.js]
|
||||
[browser_audionode-actor-get-type.js]
|
||||
[browser_audionode-actor-is-source.js]
|
||||
[browser_webaudio-actor-connect-param.js]
|
||||
[browser_webaudio-actor-destroy-node.js]
|
||||
[browser_audionode-actor-bypass.js]
|
||||
[browser_webaudio-actor-simple.js]
|
||||
[browser_webaudio-actor-destroy-node.js]
|
||||
[browser_webaudio-actor-connect-param.js]
|
||||
|
||||
[browser_wa_destroy-node-01.js]
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Test AudioNode#bypass(), AudioNode#isBypassed()
|
||||
*/
|
||||
|
||||
function spawnTest () {
|
||||
let [target, debuggee, front] = yield initBackend(SIMPLE_CONTEXT_URL);
|
||||
let [_, [destNode, oscNode, gainNode]] = yield Promise.all([
|
||||
front.setup({ reload: true }),
|
||||
get3(front, "create-node")
|
||||
]);
|
||||
|
||||
is((yield gainNode.isBypassed()), false, "Nodes start off unbypassed.");
|
||||
|
||||
info("Calling node#bypass(true)");
|
||||
yield gainNode.bypass(true);
|
||||
|
||||
is((yield gainNode.isBypassed()), true, "Node is now bypassed.");
|
||||
|
||||
info("Calling node#bypass(false)");
|
||||
yield gainNode.bypass(false);
|
||||
|
||||
is((yield gainNode.isBypassed()), false, "Node back to being unbypassed.");
|
||||
|
||||
yield removeTab(target.tab);
|
||||
finish();
|
||||
}
|
@ -156,6 +156,44 @@ let AudioNodeActor = exports.AudioNodeActor = protocol.ActorClass({
|
||||
response: { source: RetVal("boolean") }
|
||||
}),
|
||||
|
||||
/**
|
||||
* Returns a boolean indicating if the AudioNode has been "bypassed",
|
||||
* via `AudioNodeActor#bypass` method.
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
isBypassed: method(function () {
|
||||
let node = this.node.get();
|
||||
if (node === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return node.passThrough;
|
||||
}, {
|
||||
response: { bypassed: RetVal("boolean") }
|
||||
}),
|
||||
|
||||
/**
|
||||
* Takes a boolean, either enabling or disabling the "passThrough" option
|
||||
* on an AudioNode. If a node is bypassed, an effects processing node (like gain, biquad),
|
||||
* will allow the audio stream to pass through the node, unaffected.
|
||||
*
|
||||
* @param Boolean enable
|
||||
* Whether the bypass value should be set on or off.
|
||||
*/
|
||||
bypass: method(function (enable) {
|
||||
let node = this.node.get();
|
||||
|
||||
if (node === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
node.passThrough = enable;
|
||||
}, {
|
||||
request: { enable: Arg(0, "boolean") },
|
||||
oneway: true
|
||||
}),
|
||||
|
||||
/**
|
||||
* Changes a param on the audio node. Responds with either `undefined`
|
||||
* on success, or a description of the error upon param set failure.
|
||||
|
Loading…
Reference in New Issue
Block a user