|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.javasound.ClipPlayer
public class ClipPlayer
An actor that plays an audio clip given in a file. If the overlay parameter is false (the default), then it will terminate any previously playing clip before playing the new instance. Otherwise, it will mix in the new instance with the currently playing clip.
LiveSound
,
AudioCapture
,
AudioReader
,
AudioWriter
,
Serialized Form
Red (eal) |
Yellow (eal) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
protected java.util.List<javax.sound.sampled.Clip> |
_clips
The clip to playback. |
private java.util.List<BooleanToken> |
_outputEvents
The output values to be produced on the next firing. |
private java.util.List<BooleanToken> |
_outputEventsCopy
The output values to be produced on the next firing. |
FileParameter |
fileOrURL
The file or URL giving the audio clip. |
TypedIOPort |
output
Output port used to indicate starts and stops. |
Parameter |
overlay
If true, then if the actor fires before the previous clip has finished playing, then a new instance of the clip will be played on top of the tail of the previous instance, as long as the underlying mixer supports adding additional clips. |
TypedIOPort |
trigger
The trigger. |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
ClipPlayer(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace. |
void |
fire()
Produce outputs indicating that the clip has started or stopped. |
boolean |
postfire()
Read an input array and send to the audio hardware. |
void |
update(javax.sound.sampled.LineEvent event)
Called to notify this object of changes in the status of a clip. |
void |
wrapup()
Stop audio playback and free up any audio resources used for audio playback. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, initialize, preinitialize, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public FileParameter fileOrURL
public TypedIOPort output
public Parameter overlay
public TypedIOPort trigger
protected java.util.List<javax.sound.sampled.Clip> _clips
private java.util.List<BooleanToken> _outputEvents
private java.util.List<BooleanToken> _outputEventsCopy
Constructor Detail |
---|
public ClipPlayer(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class AtomicActor
workspace
- The workspace for the new object.
java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor
IllegalActionException
- Not thrown in this class.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor
IllegalActionException
- If there is a problem
playing audio.public void update(javax.sound.sampled.LineEvent event)
update
in interface javax.sound.sampled.LineListener
event
- The event, with one of type OPEN, CLOSE,
START, STOP of class LineEvent.Type.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor
IllegalActionException
- If there is a problem
stopping audio playback.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |