com.softsynth.jmsl
Class MusicList

java.lang.Object
  extended by com.softsynth.jmsl.MusicJob
      extended by com.softsynth.jmsl.MusicList
All Implemented Interfaces:
Composable, Playable, java.lang.Runnable
Direct Known Subclasses:
Track

public class MusicList
extends MusicJob

MusicList
A MusicList's children are InstrumentPlayable's. InstrumentPlayables implement public double play(double playTime, Composable parent,Instrument ins)
method which returns an updated playTime (such as playTime + parent.getTimeStretch * duration) A MusicList's Instrument gets handed to each of its children as it enumerates them over time.

Author:
Nick Didkovsky and Phil Burk (C) 1997 Phil Burk and Nick Didkovsky, All Rights Reserved JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.
See Also:
InstrumentPlayable

Field Summary
 
Fields inherited from class com.softsynth.jmsl.MusicJob
repeatCount
 
Constructor Summary
MusicList()
           
 
Method Summary
 void add(InstrumentPlayable p)
           
 void finishAll()
          Doesn't contain Composable, so cannot propagate finishAll() to children, just calls finish() on itself instead
 InstrumentPlayable get(int i)
          return the InstrumentPlayable at position i
 java.util.Vector getChildren()
           
 double internalRepeat(double playTime)
          Execute all elements in list with instrument.
static void main(java.lang.String[] args)
          Add some ad hoc InstrumentPlayable's to a MusicList and play it with the default (printing) Instrument.
 double start(double startTime)
          open() Instrument and return startTime
 double stop(double stopTime)
          close() Instrument and return stopTime
 
Methods inherited from class com.softsynth.jmsl.MusicJob
add, addPlayLurker, addRepeatPlayable, addStartPlayable, addStopPlayable, advanceCurrentTime, contains, elements, finish, getChild, getCurrentTime, getDataTranslator, getDuration, getInstrument, getName, getParent, getPlayLurkers, getRepeatCount, getRepeatPause, getRepeats, getStartDelay, getStartPause, getStartTime, getStopDelay, getTimeStretch, getTransposition, halt, indexOf, insert, isRunning, launch, launch, play, play, print, printHierarchy, 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, timeStretch, transposition, waitForDone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MusicList

public MusicList()
Method Detail

getChildren

public java.util.Vector getChildren()
Overrides:
getChildren in class MusicJob
Returns:
vector of Playable elements

add

public void add(InstrumentPlayable p)

get

public InstrumentPlayable get(int i)
return the InstrumentPlayable at position i


start

public double start(double startTime)
             throws java.lang.InterruptedException
open() Instrument and return startTime

Specified by:
start in interface Composable
Overrides:
start in class MusicJob
Returns:
endTime
Throws:
java.lang.InterruptedException - thrown if Thread.interrupt() called.

stop

public double stop(double stopTime)
            throws java.lang.InterruptedException
close() Instrument and return stopTime

Specified by:
stop in interface Composable
Overrides:
stop in class MusicJob
Returns:
endTime
Throws:
java.lang.InterruptedException - thrown if Thread.interrupt() called.

finishAll

public void finishAll()
Doesn't contain Composable, so cannot propagate finishAll() to children, just calls finish() on itself instead

Specified by:
finishAll in interface Composable
Overrides:
finishAll in class MusicJob

internalRepeat

public double internalRepeat(double playTime)
                      throws java.lang.InterruptedException
Execute all elements in list with instrument.

Specified by:
internalRepeat in interface Composable
Overrides:
internalRepeat in class MusicJob
Returns:
stopTime
Throws:
java.lang.InterruptedException - thrown if Thread.interrupt() called.

main

public static void main(java.lang.String[] args)
Add some ad hoc InstrumentPlayable's to a MusicList and play it with the default (printing) Instrument.