mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2024-12-23 05:10:27 +01:00
Notification should show up for every function.
This commit is contained in:
parent
dd1173841b
commit
a41eba1dff
@ -86,11 +86,11 @@
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
let notified = false;
|
let notified = new Map();
|
||||||
function notifyOnce(notify){
|
function notifyOnce(name, notify){
|
||||||
if (!notified){
|
if (!notified.get(name)){
|
||||||
notify("fakedAudioReadout");
|
notify("fakedAudioReadout");
|
||||||
notified = true;
|
notified.set(name, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// changed functions and their fakes
|
// changed functions and their fakes
|
||||||
@ -99,7 +99,7 @@
|
|||||||
object: ["AnalyserNode"],
|
object: ["AnalyserNode"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getFloatFrequencyData(array){
|
return function getFloatFrequencyData(array){
|
||||||
notifyOnce(notify);
|
notifyOnce("getFloatFrequencyData", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeFloat32Array(array, window, prefs);
|
fakeFloat32Array(array, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -110,7 +110,7 @@
|
|||||||
object: ["AnalyserNode"],
|
object: ["AnalyserNode"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getByteFrequencyData(array){
|
return function getByteFrequencyData(array){
|
||||||
notifyOnce(notify);
|
notifyOnce("getByteFrequencyData", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeUint8Array(array, window, prefs);
|
fakeUint8Array(array, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -118,12 +118,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getFloatTimeDomainData: {
|
getFloatTimeDomainData: {
|
||||||
type: "readout",
|
|
||||||
getStatus: getStatus,
|
|
||||||
object: ["AnalyserNode"],
|
object: ["AnalyserNode"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getFloatTimeDomainData(array){
|
return function getFloatTimeDomainData(array){
|
||||||
notifyOnce(notify);
|
notifyOnce("getFloatTimeDomainData", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeFloat32Array(array, window, prefs);
|
fakeFloat32Array(array, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -134,7 +132,7 @@
|
|||||||
object: ["AnalyserNode"],
|
object: ["AnalyserNode"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getByteTimeDomainData(array){
|
return function getByteTimeDomainData(array){
|
||||||
notifyOnce(notify);
|
notifyOnce("getByteTimeDomainData", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeUint8Array(array, window, prefs);
|
fakeUint8Array(array, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -145,7 +143,7 @@
|
|||||||
object: ["AudioBuffer"],
|
object: ["AudioBuffer"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getChannelData(channel){
|
return function getChannelData(channel){
|
||||||
notifyOnce(notify);
|
notifyOnce("getChannelData", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeFloat32Array(ret, window, prefs);
|
fakeFloat32Array(ret, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -156,7 +154,7 @@
|
|||||||
object: ["AudioBuffer"],
|
object: ["AudioBuffer"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function copyFromChannel(destination, channelNumber, startInChannel){
|
return function copyFromChannel(destination, channelNumber, startInChannel){
|
||||||
notifyOnce(notify);
|
notifyOnce("copyFromChannel", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeFloat32Array(destination, window, prefs);
|
fakeFloat32Array(destination, window, prefs);
|
||||||
return ret;
|
return ret;
|
||||||
@ -167,7 +165,7 @@
|
|||||||
object: ["BiquadFilterNode", "IIRFilterNode"],
|
object: ["BiquadFilterNode", "IIRFilterNode"],
|
||||||
fakeGenerator: function(prefs, notify, window, original){
|
fakeGenerator: function(prefs, notify, window, original){
|
||||||
return function getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput){
|
return function getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput){
|
||||||
notifyOnce(notify);
|
notifyOnce("getFrequencyResponse", notify);
|
||||||
var ret = original.apply(this, window.Array.from(arguments));
|
var ret = original.apply(this, window.Array.from(arguments));
|
||||||
fakeFloat32Array(magResponseOutput, window, prefs);
|
fakeFloat32Array(magResponseOutput, window, prefs);
|
||||||
fakeFloat32Array(phaseResponseOutput, window, prefs);
|
fakeFloat32Array(phaseResponseOutput, window, prefs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user