mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
callback is invoked with the timeline as the context
This commit is contained in:
parent
aea6c80f09
commit
a4a94b63ea
1 changed files with 3 additions and 2 deletions
|
@ -277,7 +277,7 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
|||
lowerBound = this.defaultArg(lowerBound, 0);
|
||||
upperBound = this.defaultArg(upperBound, this._timeline.length - 1);
|
||||
for (var i = lowerBound; i <= upperBound; i++){
|
||||
callback(this._timeline[i]);
|
||||
callback.call(this, this._timeline[i]);
|
||||
}
|
||||
this._iterating = false;
|
||||
if (this._toRemove.length > 0){
|
||||
|
@ -359,7 +359,7 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
|||
if (upperBound !== -1){
|
||||
this._iterate(function(event){
|
||||
if (event.time === time){
|
||||
callback(event);
|
||||
callback.call(this, event);
|
||||
}
|
||||
}, 0, upperBound);
|
||||
}
|
||||
|
@ -374,6 +374,7 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
|||
Tone.prototype.dispose.call(this);
|
||||
this._timeline = null;
|
||||
this._toRemove = null;
|
||||
return this;
|
||||
};
|
||||
|
||||
return Tone.Timeline;
|
||||
|
|
Loading…
Reference in a new issue