Hierarchical Scheduling In JMSL
Any Java Object that implements the Composable interface can be placed in a hierarchy and scheduled.
Composable is a core interface defined in JMSL. It provides method definitions for scheduling objects.
If an object is the child of another, it receives the launch time from
its parent, and returns the completion time to its parent. This way, complex hierarchies can be scheduled.
The root JMSL class that implements Composable is MusicJob. Other
Composables include ParallelCollection, SequentialCollection, and MusicShape. These are all subclasses of MusicJob.
MusicJob has actions scheduled for when it starts, others for when
it repeats, and others when it stops. It puts delays before some of these actions, and pauses after others. You have control over these durations, and of course you have
control over the actions themselves.
A MusicJob schedules itself as follows:
- startPlayables.play() optional
- repeatPlayables.play() optional
- repeatPause (loop back to repeat() for getRepeats() times)
- stopPlayables.play() optional