Class AntSoundPlayer
java.lang.Object
org.apache.tools.ant.taskdefs.optional.sound.AntSoundPlayer
- All Implemented Interfaces:
- EventListener,- 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 occurring.
 I have only tested this with .WAV and .AIFF sound file formats. Both seem to work fine.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBuildFailedSound(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.voidThis is implemented to listen for any line events and closes the clip if required.
- 
Constructor Details- 
AntSoundPlayerpublic AntSoundPlayer()
 
- 
- 
Method Details- 
addBuildSuccessfulSound- 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
 
- 
addBuildFailedSound- 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
 
- 
updateThis is implemented to listen for any line events and closes the clip if required.- Specified by:
- updatein interface- LineListener
- Parameters:
- event- the line event to follow
 
- 
buildStartedFired before any targets are started.- Specified by:
- buildStartedin interface- BuildListener
- Parameters:
- event- ignored
 
- 
buildFinishedFired after the last target has finished. This event will still be thrown if an error occurred during the build.- Specified by:
- buildFinishedin interface- BuildListener
- Parameters:
- event- the build finished event.
- See Also:
 
- 
targetStartedFired when a target is started.- Specified by:
- targetStartedin interface- BuildListener
- Parameters:
- event- ignored.
- See Also:
 
- 
targetFinishedFired when a target has finished. This event will still be thrown if an error occurred during the build.- Specified by:
- targetFinishedin interface- BuildListener
- Parameters:
- event- ignored.
- See Also:
 
- 
taskStartedFired when a task is started.- Specified by:
- taskStartedin interface- BuildListener
- Parameters:
- event- ignored.
- See Also:
 
- 
taskFinishedFired when a task has finished. This event will still be throw if an error occurred during the build.- Specified by:
- taskFinishedin interface- BuildListener
- Parameters:
- event- ignored.
- See Also:
 
- 
messageLoggedFired whenever a message is logged.- Specified by:
- messageLoggedin interface- BuildListener
- Parameters:
- event- the build event
- See Also:
 
 
-