mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-16 08:38:00 +00:00
eventsToRemove is no longer necessary
This commit is contained in:
parent
2bf8039b4e
commit
12d7cd0e1f
1 changed files with 1 additions and 14 deletions
|
@ -117,14 +117,6 @@ function(Tone){
|
|||
*/
|
||||
this._scheduledEvents = {};
|
||||
|
||||
/**
|
||||
* The events to remove from the timelines.
|
||||
* Each event is an object with an 'item' and a 'timeline'.
|
||||
* @type {Array}
|
||||
* @private
|
||||
*/
|
||||
this._eventsToRemove = [];
|
||||
|
||||
/**
|
||||
* The event ID counter
|
||||
* @type {Number}
|
||||
|
@ -224,11 +216,6 @@ function(Tone){
|
|||
this.trigger("loop", tickTime);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < this._eventsToRemove.length; i++){
|
||||
var item = this._eventsToRemove[i];
|
||||
item.timeline.removeEvent(item.event);
|
||||
}
|
||||
this._eventsToRemove = [];
|
||||
var ticks = this._clock.ticks;
|
||||
//fire the next tick events if their time has come
|
||||
this._timeline.forEachAtTime(ticks, function(event){
|
||||
|
@ -342,7 +329,7 @@ function(Tone){
|
|||
Tone.Transport.prototype.clear = function(eventId){
|
||||
if (this._scheduledEvents.hasOwnProperty(eventId)){
|
||||
var item = this._scheduledEvents[eventId.toString()];
|
||||
this._eventsToRemove.push(item);
|
||||
item.timeline.removeEvent(item.event);
|
||||
delete this._scheduledEvents[eventId.toString()];
|
||||
}
|
||||
return this;
|
||||
|
|
Loading…
Reference in a new issue