class scheduler { public: err_ind play_note( const MIDI_msg& 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); void synchronize(); void unsynchronize(); };
err_ind play_note( const MIDI_msg& 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 )
err_ind insert( const task_data& td, task** task_return
)
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)
t
. Returns err
if
t
is not a valid task or if it is a task which has
already happened.
void synchronize()
synchronize
and
unsynchronize
at once. Note that this lock is
automatically acquired when callbacks for MIDI input or the scheduler
are made, so calling synchronize
effectively locks out
callbacks. It is perfectly OK for a thread to call
synchronize
more than once, as long as it calls
unsynchronize
an equal number of times.
void unsynchronize()
synchronize()
.