com.softsynth.jmsl
Class QueueCollection

java.lang.Object
  extended by com.softsynth.jmsl.MusicJob
      extended by com.softsynth.jmsl.ParallelCollection
          extended by com.softsynth.jmsl.QueueCollection
All Implemented Interfaces:
Composable, Playable, java.lang.Runnable

public class QueueCollection
extends ParallelCollection

A QueueCollection launches each of its Composable children in sequence. As each child is played, it is removed from the queue. The number of children removed from the queue is the value specified using setRepeats(). More children can be added to the queue while it is running. The last Composable in the queue will be played repeatedly when the queue becomes empty. To make the QueueCollection stop when the queue becomes empty, call add(null) after the last child is added.


Field Summary
 
Fields inherited from class com.softsynth.jmsl.MusicJob
repeatCount
 
Constructor Summary
QueueCollection()
          Simple constructor.
QueueCollection(Composable child1)
          Conveniant constructor which automatically adds one Composable child to the queue hierarchy.
QueueCollection(Composable child1, Composable child2)
          Conveniant constructor which automatically adds two Composable children to the queue hierarchy.
QueueCollection(Composable child1, Composable child2, Composable child3)
          Conveniant constructor which automatically adds three Composable children to the queue hierarchy.
QueueCollection(Composable child1, Composable child2, Composable child3, Composable child4)
          Conveniant constructor which automatically adds four Composable children to the queue hierarchy.
 
Method Summary
 double internalRepeat(double playTime)
          Play next child in sequence.
static void main(java.lang.String[] args)
           
 
Methods inherited from class com.softsynth.jmsl.ParallelCollection
get, halt, print, printHierarchy, set
 
Methods inherited from class com.softsynth.jmsl.MusicJob
add, addPlayLurker, addRepeatPlayable, addStartPlayable, addStopPlayable, advanceCurrentTime, contains, elements, finish, finishAll, getChild, getChildren, getCurrentTime, getDataTranslator, getDuration, getInstrument, getName, getParent, getPlayLurkers, getRepeatCount, getRepeatPause, getRepeats, getStartDelay, getStartPause, getStartTime, getStopDelay, getTimeStretch, getTransposition, indexOf, insert, isRunning, launch, launch, play, play, printHierarchy, remove, remove, removeAll, removeAllPlayLurkers, removeAllRepeatPlayables, removeAllStartPlayables, removeAllStopPlayables, removePlayLurker, removeRepeatPlayable, removeStartPlayable, removeStopPlayable, repeat, run, setCurrentTime, setDataTranslator, setDuration, setInstrument, setName, setParent, setRepeatPause, setRepeats, setStartDelay, setStartPause, setStartTime, setStopDelay, setTimeStretch, setTransposition, size, start, stop, timeStretch, transposition, waitForDone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueCollection

public QueueCollection()
Simple constructor. Builds a QueueCollection with no children, and initializes its Behavior to UniformRandomBehavior (although it defaults to queue behavior). Use add(Composable) to add children.


QueueCollection

public QueueCollection(Composable child1)
Conveniant constructor which automatically adds one Composable child to the queue hierarchy.


QueueCollection

public QueueCollection(Composable child1,
                       Composable child2)
Conveniant constructor which automatically adds two Composable children to the queue hierarchy.


QueueCollection

public QueueCollection(Composable child1,
                       Composable child2,
                       Composable child3)
Conveniant constructor which automatically adds three Composable children to the queue hierarchy.


QueueCollection

public QueueCollection(Composable child1,
                       Composable child2,
                       Composable child3,
                       Composable child4)
Conveniant constructor which automatically adds four Composable children to the queue hierarchy.

Method Detail

internalRepeat

public double internalRepeat(double playTime)
                      throws java.lang.InterruptedException
Play next child in sequence.

Specified by:
internalRepeat in interface Composable
Overrides:
internalRepeat in class ParallelCollection
Returns:
time of completion
Throws:
java.lang.InterruptedException - if the thread running this Composable is interrupted.

main

public static void main(java.lang.String[] args)