Browse Source

javadoc

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277955 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
e98761f7b0
2 changed files with 18 additions and 2 deletions
  1. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
  2. +12
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java

+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java View File

@@ -56,8 +56,8 @@ public class AntSoundPlayer implements LineListener, BuildListener {
private int loopsFail = 0; private int loopsFail = 0;
private Long durationFail = null; private Long durationFail = null;


/** Constructor for AntSoundPlayer. */
public AntSoundPlayer() { public AntSoundPlayer() {

} }


/** /**
@@ -139,6 +139,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {


clip.loop(loops); clip.loop(loops);
while (clip.isRunning()) { while (clip.isRunning()) {
// Empty block
} }
} }


@@ -147,12 +148,14 @@ public class AntSoundPlayer implements LineListener, BuildListener {
try { try {
Thread.sleep(duration); Thread.sleep(duration);
} catch (InterruptedException e) { } catch (InterruptedException e) {
// Ignore Exception
} }
} }


/** /**
* This is implemented to listen for any line events and closes the * This is implemented to listen for any line events and closes the
* clip if required. * clip if required.
* @param event the line event to follow
*/ */
public void update(LineEvent event) { public void update(LineEvent event) {
if (event.getType().equals(LineEvent.Type.STOP)) { if (event.getType().equals(LineEvent.Type.STOP)) {
@@ -171,6 +174,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {


/** /**
* Fired before any targets are started. * Fired before any targets are started.
* @param event ignored
*/ */
public void buildStarted(BuildEvent event) { public void buildStarted(BuildEvent event) {
} }
@@ -226,7 +230,7 @@ public class AntSoundPlayer implements LineListener, BuildListener {


/** /**
* Fired whenever a message is logged. * Fired whenever a message is logged.
*
* @param event the build event
* @see BuildEvent#getMessage() * @see BuildEvent#getMessage()
* @see BuildEvent#getPriority() * @see BuildEvent#getPriority()
*/ */


+ 12
- 0
src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java View File

@@ -49,6 +49,7 @@ public class SoundTask extends Task {


/** /**
* add a sound when the build succeeds * add a sound when the build succeeds
* @return a BuildAlert to be configured
*/ */
public BuildAlert createSuccess() { public BuildAlert createSuccess() {
success = new BuildAlert(); success = new BuildAlert();
@@ -57,18 +58,26 @@ public class SoundTask extends Task {


/** /**
* add a sound when the build fails * add a sound when the build fails
* @return a BuildAlert to be configured
*/ */
public BuildAlert createFail() { public BuildAlert createFail() {
fail = new BuildAlert(); fail = new BuildAlert();
return fail; return fail;
} }


/** Constructor for SoundTask. */
public SoundTask() { public SoundTask() {
} }


/**
* Initialize the task.
*/
public void init() { public void init() {
} }


/**
* Execute the task.
*/
public void execute() { public void execute() {


AntSoundPlayer soundPlayer = new AntSoundPlayer(); AntSoundPlayer soundPlayer = new AntSoundPlayer();
@@ -102,6 +111,7 @@ public class SoundTask extends Task {


/** /**
* Sets the duration in milliseconds the file should be played; optional. * Sets the duration in milliseconds the file should be played; optional.
* @param duration the duration in millisconds
*/ */
public void setDuration(Long duration) { public void setDuration(Long duration) {
this.duration = duration; this.duration = duration;
@@ -127,6 +137,7 @@ public class SoundTask extends Task {


/** /**
* Gets the location of the file to get the audio. * Gets the location of the file to get the audio.
* @return the file location
*/ */
public File getSource() { public File getSource() {
File nofile = null; File nofile = null;
@@ -170,6 +181,7 @@ public class SoundTask extends Task {


/** /**
* Gets the duration in milliseconds the file should be played. * Gets the duration in milliseconds the file should be played.
* @return the duration in milliseconds
*/ */
public Long getDuration() { public Long getDuration() {
return this.duration; return this.duration;


Loading…
Cancel
Save