org.apache.tools.ant.taskdefs.optional.sound

Class AntSoundPlayer

public class AntSoundPlayer extends Object implements LineListener, BuildListener

This class is designed to be used by any AntTask that requires audio output. It implements the BuildListener interface to listen for BuildEvents and could be easily extended to provide audio output upon any specific build events occuring. I have only tested this with .WAV and .AIFF sound file formats. Both seem to work fine.
Constructor Summary
AntSoundPlayer()
Method Summary
voidaddBuildFailedSound(File fileFail, int loopsFail, Long durationFail)
voidaddBuildSuccessfulSound(File file, int loops, Long duration)
voidbuildFinished(BuildEvent event)
Fired after the last target has finished.
voidbuildStarted(BuildEvent event)
Fired before any targets are started.
voidmessageLogged(BuildEvent event)
Fired whenever a message is logged.
voidtargetFinished(BuildEvent event)
Fired when a target has finished.
voidtargetStarted(BuildEvent event)
Fired when a target is started.
voidtaskFinished(BuildEvent event)
Fired when a task has finished.
voidtaskStarted(BuildEvent event)
Fired when a task is started.
voidupdate(LineEvent event)
This is implemented to listen for any line events and closes the clip if required.

Constructor Detail

AntSoundPlayer

public AntSoundPlayer()

Method Detail

addBuildFailedSound

public void addBuildFailedSound(File fileFail, int loopsFail, Long durationFail)

Parameters: fileFail the location of the audio file to be played when the build fails loopsFail the number of times the file should be played when the build is fails durationFail the number of milliseconds the file should be played when the build fails

addBuildSuccessfulSound

public void addBuildSuccessfulSound(File file, int loops, Long duration)

Parameters: file the location of the audio file to be played when the build is successful loops the number of times the file should be played when the build is successful duration the number of milliseconds the file should be played when the build is successful

buildFinished

public void buildFinished(BuildEvent event)
Fired after the last target has finished. This event will still be thrown if an error occurred during the build.

See Also: getException

buildStarted

public void buildStarted(BuildEvent event)
Fired before any targets are started.

messageLogged

public void messageLogged(BuildEvent event)
Fired whenever a message is logged.

See Also: getMessage getPriority

targetFinished

public void targetFinished(BuildEvent event)
Fired when a target has finished. This event will still be thrown if an error occurred during the build.

See Also: getException

targetStarted

public void targetStarted(BuildEvent event)
Fired when a target is started.

See Also: getTarget

taskFinished

public void taskFinished(BuildEvent event)
Fired when a task has finished. This event will still be throw if an error occurred during the build.

See Also: getException

taskStarted

public void taskStarted(BuildEvent event)
Fired when a task is started.

See Also: getTask

update

public void update(LineEvent event)
This is implemented to listen for any line events and closes the clip if required.
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.