public class Player
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
Player.Driver |
Modifier and Type | Field and Description |
---|---|
private IBXM |
ibxm |
private boolean |
loop |
private Module |
module |
private byte[] |
output_buffer |
private javax.sound.sampled.SourceDataLine |
output_line |
private int |
play_position |
private java.lang.Thread |
play_thread |
private boolean |
running |
private int |
song_duration |
Constructor and Description |
---|
Player()
Instantiate a new Player.
|
Modifier and Type | Method and Description |
---|---|
static Module |
load_module(java.io.InputStream input)
Decode the data in the specified InputStream into a Module instance.
|
static void |
main(java.lang.String[] args)
Simple command-line test player.
|
void |
play()
Open the audio device and begin playback.
|
void |
set_loop(boolean loop)
If loop is true, playback will continue indefinitely,
otherwise the module will play through once and stop.
|
void |
set_module(Module m)
Set the Module instance to be played.
|
void |
stop()
Stop playback and close the audio device.
|
private java.lang.Thread play_thread
private IBXM ibxm
private Module module
private int song_duration
private int play_position
private boolean running
private boolean loop
private byte[] output_buffer
private javax.sound.sampled.SourceDataLine output_line
public Player() throws javax.sound.sampled.LineUnavailableException
javax.sound.sampled.LineUnavailableException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static Module load_module(java.io.InputStream input) throws java.lang.IllegalArgumentException, java.io.IOException
input
- an InputStream containing the module file to be decoded.java.lang.IllegalArgumentException
- if the data is not recognised as a module file.java.io.IOException
public void set_module(Module m)
public void set_loop(boolean loop)
public void play()
public void stop()