Package org.openstreetmap.josm.io.audio
Class AudioPlayer.Execute
- java.lang.Object
-
- org.openstreetmap.josm.io.audio.AudioPlayer.Execute
-
- Enclosing class:
- AudioPlayer
public class AudioPlayer.Execute extends java.lang.Object
Passes information from the control thread to the playing thread
-
-
Field Summary
Fields Modifier and Type Field Description private AudioPlayer.Commandcommandprivate java.lang.Exceptionexceptionprivate doubleoffsetprivate AudioPlayer.Resultresultprivate doublespeedprivate java.net.URLurl
-
Constructor Summary
Constructors Constructor Description Execute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AudioPlayer.Commandcommand()Returns the command.protected voidfailed(java.lang.Exception e)doubleoffset()Returns the offset.protected voidok(AudioPlayer.State newState)protected voidpause()protected voidplay(java.net.URL url, double offset, double speed)protected voidpossiblyInterrupt()private voidsend()doublespeed()Returns the speed.java.net.URLurl()Returns the URL.
-
-
-
Field Detail
-
command
private AudioPlayer.Command command
-
result
private AudioPlayer.Result result
-
exception
private java.lang.Exception exception
-
url
private java.net.URL url
-
offset
private double offset
-
speed
private double speed
-
-
Constructor Detail
-
Execute
public Execute()
-
-
Method Detail
-
play
protected void play(java.net.URL url, double offset, double speed) throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
pause
protected void pause() throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
send
private void send() throws java.lang.InterruptedException, java.io.IOException
- Throws:
java.lang.InterruptedExceptionjava.io.IOException
-
possiblyInterrupt
protected void possiblyInterrupt() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
failed
protected void failed(java.lang.Exception e)
-
ok
protected void ok(AudioPlayer.State newState)
-
offset
public double offset()
Returns the offset.- Returns:
- the offset, in seconds
-
speed
public double speed()
Returns the speed.- Returns:
- the speed (ratio)
-
url
public java.net.URL url()
Returns the URL.- Returns:
- The resource to play, which must be a WAV file or stream
-
command
public AudioPlayer.Command command()
Returns the command.- Returns:
- the command
-
-