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 Object
Passes information from the control thread to the playing thread
-
-
Field Summary
Fields Modifier and Type Field Description private AudioPlayer.Command
command
private Exception
exception
private double
offset
private AudioPlayer.Result
result
private double
speed
private URL
url
-
Constructor Summary
Constructors Constructor Description Execute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AudioPlayer.Command
command()
Returns the command.protected void
failed(Exception e)
double
offset()
Returns the offset.protected void
ok(AudioPlayer.State newState)
protected void
pause()
protected void
play(URL url, double offset, double speed)
protected void
possiblyInterrupt()
private void
send()
double
speed()
Returns the speed.URL
url()
Returns the URL.
-
-
-
Field Detail
-
command
private AudioPlayer.Command command
-
result
private AudioPlayer.Result result
-
offset
private double offset
-
speed
private double speed
-
-
Constructor Detail
-
Execute
public Execute()
-
-
Method Detail
-
play
protected void play(URL url, double offset, double speed) throws InterruptedException, IOException
- Throws:
InterruptedException
IOException
-
pause
protected void pause() throws InterruptedException, IOException
- Throws:
InterruptedException
IOException
-
send
private void send() throws InterruptedException, IOException
- Throws:
InterruptedException
IOException
-
possiblyInterrupt
protected void possiblyInterrupt() throws InterruptedException
- Throws:
InterruptedException
-
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 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
-
-