scheduler
The scheduler is a class which can be used to schedule tasks. (see task_data.) There is only one scheduler and it
is created by the Rogus_McBogus object. It can be acessed via the
member variable s of Rogus_McBogus.
class scheduler {
public:
err_ind play_note( const MidiMsg& on, ScheduleTime dur );
err_ind insert( const task_data& td );
err_ind insert( const task_data& td, task** task_return );
err_ind cancel(task* t);
};
err_ind play_note( const MidiMsg& on, ScheduleTime dur
)
play_note immediately sends out on which it
assumes to be a note-on. The scheduler will send out the same message,
with the velocity changed to zero, dur half-milliseconds
later.
err_ind insert( const task_data& td )
- This is used to schedule a task_data.
If you schedule a task this way, there is no way to cancel it.
err_ind insert( const task_data& td, task** task_return
)
- This is as above, except that you should use this version of
insert if you might want to cancel the task before it
happens. You should provide the address of a task*, which
the scheduler will then write the address of a task into.
You can pass this pointer to cancel to cancel the task.
err_ind cancel(task* t)
- Cancels the task
t. Returns err if
t is not a valid task or if it is a task which has
already happened.