Package com.softsynth.jmsl
Class QueueCollection
java.lang.Object
com.softsynth.jmsl.MusicJob
com.softsynth.jmsl.ParallelCollection
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
Constructors Constructor Description 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
Modifier and Type Method Description 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, getRepeatPlayables, getRepeats, getStartDelay, getStartPause, getStartPlayables, getStartTime, getStopDelay, getStopPlayables, 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 Details
-
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
Conveniant constructor which automatically adds one Composable child to the queue hierarchy. -
QueueCollection
Conveniant constructor which automatically adds two Composable children to the queue hierarchy. -
QueueCollection
Conveniant constructor which automatically adds three Composable children to the queue hierarchy. -
QueueCollection
Conveniant constructor which automatically adds four Composable children to the queue hierarchy.
-
-
Method Details
-
internalRepeat
public double internalRepeat(double playTime) throws java.lang.InterruptedExceptionPlay next child in sequence.- Specified by:
internalRepeat
in interfaceComposable
- Overrides:
internalRepeat
in classParallelCollection
- 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)
-