Class SoundElement

java.lang.Object
  extended bySoundElement

public class SoundElement
extends Object

Sounds for a linked list


Field Summary
(package private)  Sound mySound
          The sound this element is associated with
 SoundElement next
          The next element to process
 
Constructor Summary
SoundElement(Sound aSound)
          Constructor sets next to null and references the input sound.
 
Method Summary
 void add(SoundElement node)
          Add the input node after the last node in this list.
 void blockingPlay()
           
 Sound collect()
          Collect all the sounds from me on, recursively.
 SoundElement copyNode()
          copyNode returns a copy of this element
 SoundElement getNext()
           
 Sound getSound()
          Return my sound
 void insertAfter(SoundElement node)
          Insert the input node after this node.
 SoundElement last()
          Return the last element in the list
 void playFromMeOn()
          Play the list of sound elements after me
 void playSound()
          Play JUST me, blocked.
 void remove(SoundElement node)
          Method to remove node from list, fixing links appropriately.
 void repeatNext(SoundElement nextOne, int count)
          Repeat the input phrase for the number of times specified.
 void replace(Sound oldSound, Sound newSound)
          Replace the one sound with the other sound in all the elements from me on.
 void setNext(SoundElement nextOne)
          Methods to set and get next elements
 String toString()
          Provide a printable representation of me
 void weave(SoundElement nextOne, int count, int skipAmount)
          Weave the input sound count times every skipAmount elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mySound

Sound mySound
The sound this element is associated with


next

public SoundElement next
The next element to process

Constructor Detail

SoundElement

public SoundElement(Sound aSound)
Constructor sets next to null and references the input sound.

Method Detail

getSound

public Sound getSound()
Return my sound


playSound

public void playSound()
Play JUST me, blocked.


blockingPlay

public void blockingPlay()

toString

public String toString()
Provide a printable representation of me


setNext

public void setNext(SoundElement nextOne)
Methods to set and get next elements

Parameters:
nextOne - next element in list

getNext

public SoundElement getNext()

playFromMeOn

public void playFromMeOn()
Play the list of sound elements after me


collect

public Sound collect()
Collect all the sounds from me on, recursively.


remove

public void remove(SoundElement node)
Method to remove node from list, fixing links appropriately.

Parameters:
node - element to remove from list.

insertAfter

public void insertAfter(SoundElement node)
Insert the input node after this node.

Parameters:
node - element to insert after this.

last

public SoundElement last()
Return the last element in the list


add

public void add(SoundElement node)
Add the input node after the last node in this list.

Parameters:
node - element to insert after this.

copyNode

public SoundElement copyNode()
copyNode returns a copy of this element

Returns:
another element with the same sound

repeatNext

public void repeatNext(SoundElement nextOne,
                       int count)
Repeat the input phrase for the number of times specified. It always appends to the current node, NOT insert.

Parameters:
nextOne - node to be copied in to list
count - number of times to copy it in.

weave

public void weave(SoundElement nextOne,
                  int count,
                  int skipAmount)
Weave the input sound count times every skipAmount elements

Parameters:
nextOne - SoundElement to be copied into the list
count - how many times to copy
skipAmount - how many nodes to skip per weave

replace

public void replace(Sound oldSound,
                    Sound newSound)
Replace the one sound with the other sound in all the elements from me on. Decide two sounds are equal if come from same filename

Parameters:
oldSound - sound to be replaced
newSound - sound to put in its place