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

Class SoundTask


public class SoundTask
extends Task

Plays a sound file at the end of the build, according to whether the build failed or succeeded. There are three attributes to be set: source: the location of the audio file to be played duration: play the sound file continuously until "duration" milliseconds has expired loops: the number of times the sound file should be played until stopped I have only tested this with .WAV and .AIFF sound file formats. Both seem to work fine. plans for the future: - use the midi api to define sounds (or drum beat etc) in xml and have Ant play them back

Nested Class Summary

class
SoundTask.BuildAlert
A class to be extended by any BuildAlert's that require the output of sound.

Field Summary

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Constructor Summary

SoundTask()
Sole constructor.

Method Summary

SoundTask.BuildAlert
createFail()
add a sound when the build fails
SoundTask.BuildAlert
createSuccess()
add a sound when the build succeeds
void
execute()
Called by the project to let the task do its work.
void
init()
Called by the project to let the task initialize properly.

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Constructor Details

SoundTask

public SoundTask()
Sole constructor.

Method Details

createFail

public SoundTask.BuildAlert createFail()
add a sound when the build fails

createSuccess

public SoundTask.BuildAlert createSuccess()
add a sound when the build succeeds

execute

public void execute()
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
Overrides:
execute in interface Task

init

public void init()
Called by the project to let the task initialize properly. The default implementation is a no-op.
Overrides:
init in interface Task

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.