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:
  1. startDelay
  2. start()
  3. startPlayables.play() optional
  4. startPause
  5. repeat()
  6. repeatPlayables.play() optional
  7. repeatPause (loop back to repeat() for getRepeats() times)
  8. stopDelay
  9. stopPlayables.play() optional
  10. stop()