net.beadsproject.beads.events
Class AudioContextStopTrigger

java.lang.Object
  extended by net.beadsproject.beads.core.Bead
      extended by net.beadsproject.beads.events.AudioContextStopTrigger

public class AudioContextStopTrigger
extends Bead

Use AudioContextStopTrigger to cause the AudioContext to stop in response to a given event.

For example, to cause the AudioContext to stop when a sample has finished playing:
AudioContext context = new AudioContext();
SamplePlayer samplePlayer = new SamplePlayer(SampleManager.sample(pathToAudioFile));
context.out.addInput(samplePlayer);
samplePlayer.setKillListener(new AudioContextStopTrigger(context));
context.start();


Constructor Summary
AudioContextStopTrigger(AudioContext ac)
          Creates a new audio context stop trigger.
 
Method Summary
 void kill()
          Stops this Bead, and flags it as deleted.
 void messageReceived(Bead message)
          Responds to an incoming message.
 
Methods inherited from class net.beadsproject.beads.core.Bead
getKillListener, getName, isDeleted, isPaused, message, pause, setKillListener, setName, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AudioContextStopTrigger

public AudioContextStopTrigger(AudioContext ac)
Creates a new audio context stop trigger.

Parameters:
ac - the AudioContext.
Method Detail

messageReceived

public void messageReceived(Bead message)
Description copied from class: Bead
Responds to an incoming message. Subclasses can override this in order to handle incoming messages. Typically a Bead would send a message to another Bead with itself as the arugment.

Overrides:
messageReceived in class Bead
Parameters:
message - the message

kill

public void kill()
Description copied from class: Bead
Stops this Bead, and flags it as deleted. This means that the Bead will automatically be removed from any BeadArrays.

Overrides:
kill in class Bead