Skip to content

Commit

Permalink
Tings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephband committed Oct 30, 2023
1 parent 78cfaff commit 468c7d2
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions modules/automate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,22 @@ const DEBUG = false;
const frameDuration = 1000 / 60;


// Polyfill param.cancelAndHoldAtTime().
// Partial polyfill/delegation for param.cancelAndHoldAtTime().
//
// This is here because it delegates to
// automate(), and putting it in a separate file creates a circular dependency,
// because automate() can call param.cancelAndHoldAtTime().
// Firefox has not yet implemented the spec, still, in 2023. This is here
// because it delegates to automate(), and putting it in a separate file creates
// a circular dependency: automate() can call param.cancelAndHoldAtTime().

const AudioParam = window.AudioParam;
let isCancelAndHoldPolyfilled = false;

// Attempt to partially fill .cancelAndHoldAtTime()
if (AudioParam && !AudioParam.prototype.cancelAndHoldAtTime) {
// Old chrome had the same method under another name. Use that.
// Old Chrome had the same method under another name. Use that.
if (AudioParam.prototype.cancelValuesAndHoldAtTime) {
AudioParam.prototype.cancelAndHoldAtTime = AudioParam.prototype.cancelValuesAndHoldAtTime;
}

// Firefox has not yet implemented the spec, still, in 2023. Attempt to
// partially fill it.
// Firefox doesn't implement it at all.
else {
AudioParam.prototype.cancelAndHoldAtTime = function(time) {
if (hasAutomation(this)) {
Expand All @@ -52,7 +50,6 @@ if (AudioParam && !AudioParam.prototype.cancelAndHoldAtTime) {
}



// Automate audio param

export const validateParamEvent = overload(get(1), {
Expand Down

0 comments on commit 468c7d2

Please sign in to comment.