Closed wolfbiter closed 10 years ago
First off, thanks so much for providing this library! I'm using it as a scheduler in a music playlisting app...
Great!!! I'd love to see it in action :)
I think what you say makes sense. This is already what I am doing in the timeStretch
function, i.e. rescheduling an event at a different time. I am just wondering, would it make more sense to expose this in the Event API :
event.reschedule(absoluteTime)
Or do you have a good use-case for a version using the relative time (as you suggested) :
event.delay(relativeTime)
Well so I have a Player
class which have an event list, Player.events
. They share a communal position, and so I wanted something like
Player.on('seek', function (distSeeked) {
Player.events.forEach(function (event) {
event.delay(distSeeked);
}
}
However, I think your idea is better in that it is more general. Don't the events even store their time in them, such that one could simply invoke the below to serve as event.delay
?
event.reschedule(event.time + relativeTime);
What I did is that I just exposed the schedule
function of the event (which was "private" before), and documented that you can use the .time
attribute of the event to get its absolute time : 7e43f1732d2f6fc41aa086409bc8b2b27516e684
Is that good?
Works great for me! Thanks for providing this!
Hi,
First off, thanks so much for providing this library! I'm using it as a scheduler in a music playlisting app...
Something I find myself wanting is the ability to change an event's execution time after the event has already been created (rather than canceling the event, recalculating when that execution time would be, and recreating the event). I have in mind something like this:
What do you think?