org.xiph.speex.player
Class Player
JPanel
org.xiph.speex.player.Player
- ActionListener
public class Player
extends JPanel
implements ActionListener
JavaSound Player.
Here is the Finite State Machine describing it's state.
+----+
|Init|
+----+
V
----->+----+
/ >|Stop| \
/ / +----+<32\
/ / \ V
| +-----+ ---> +----+
| |Pause| |Play|
| +-----+ <--- +----+
\ A / A
\ \+----+<32/
------|Buff| /
+----+
- Marc Gimpel, Wimba S.A. (mgimpel@horizonwimba.com)
Player(String file) - Build a Player.
|
void | actionPerformed(ActionEvent e) - Process Actions when button are pressed.
|
protected static JButton | buildButton(String actionCommand, String toolTip, String pathIconDefault, String pathIconDisabled, String pathIconRollover, ActionListener listener) - Build a Button.
|
protected void | createButtonPanel() - Create the ButtonPanel for the player.
|
protected void | createGUI() - Create GUI for the player.
|
protected static ImageIcon | createImageIcon(String path) - Returns an ImageIcon, or null if the path was invalid.
|
protected void | createScrollPanel() - Create the ScrollPanel for the player.
|
protected InputStream | getAudioStream() - Returns an InputSteam containing the Audio to playback.
|
protected int | getProgress() - Return the progress of the playback.
|
void | init() - Initialize the Player Component.
|
static void | main(String[] args) - Command Line entrance.
|
void | pauseIt() - Pause
|
void | playIt()
|
void | start() - Start the Player Component.
|
void | stop() - Stop the Player Component.
|
void | stopIt()
|
BUILD
public static final String BUILD
Build Number
REVISION
public static final String REVISION
Revision Number
STATE_BUFFERING
protected static final int STATE_BUFFERING
Finite State Machine State: Buffering
STATE_ERROR
protected static final int STATE_ERROR
Finite State Machine State: Error
STATE_INIT
protected static final int STATE_INIT
Finite State Machine State: Initialised
STATE_PAUSED
protected static final int STATE_PAUSED
Finite State Machine State: Paused
STATE_PLAYING
protected static final int STATE_PLAYING
Finite State Machine State: Playing
STATE_STOPPED
protected static final int STATE_STOPPED
Finite State Machine State: Stopped
VERSION
public static final String VERSION
Version Number
audioFile
protected URL audioFile
audioFilename
protected String audioFilename
audioLength
protected int audioLength
oldstate
protected int oldstate
Previous State of the Finite State Machine
pauseButton
protected JButton pauseButton
Pause Button
playButton
protected JButton playButton
Play Button
playerButtonPane
protected JPanel playerButtonPane
The Players Button Panel
playerScrollPane
protected JPanel playerScrollPane
The Players Scroll Panel
progressBar
protected JSlider progressBar
Progress Bar
state
protected int state
Current State of the Finite State Machine
stopButton
protected JButton stopButton
Stop Button
timer
protected Timer timer
Player
public Player(String file)
Build a Player.
actionPerformed
public void actionPerformed(ActionEvent e)
Process Actions when button are pressed.
Implemented from ActionListener interface.
buildButton
protected static JButton buildButton(String actionCommand,
String toolTip,
String pathIconDefault,
String pathIconDisabled,
String pathIconRollover,
ActionListener listener)
Build a Button.
actionCommand
- toolTip
- pathIconDefault
- pathIconDisabled
- pathIconRollover
- listener
-
- the Button that was built.
createButtonPanel
protected void createButtonPanel()
Create the ButtonPanel for the player.
The player button panel that should look something like this:
+-----------------------+
| +----+ +-----+ +----+ |
| |play| |pause| |stop| | Button Panel
| +----+ +-----+ +----+ |
+-----------------------+
createGUI
protected void createGUI()
Create GUI for the player.
The player panel that should look something like this:
+-----------------------+
| ----|-------------- | Scroll Panel
+-----------------------+
| +----+ +-----+ +----+ |
| |play| |pause| |stop| | Button Panel
| +----+ +-----+ +----+ |
+-----------------------+
createImageIcon
protected static ImageIcon createImageIcon(String path)
Returns an ImageIcon, or null if the path was invalid.
- an ImageIcon, or null if the path was invalid.
createScrollPanel
protected void createScrollPanel()
Create the ScrollPanel for the player.
The player scroll panel that should look something like this:
+-----------------------+
| ----|-------------- | Scroll Panel
+-----------------------+
getAudioStream
protected InputStream getAudioStream()
throws IOException
Returns an InputSteam containing the Audio to playback.
- an InputSteam containing the Audio to playback.
getProgress
protected int getProgress()
Return the progress of the playback.
- the progress of the playback.
init
public void init()
Initialize the Player Component.
main
public static void main(String[] args)
Command Line entrance.
pauseIt
public void pauseIt()
Pause
playIt
public void playIt()
start
public void start()
Start the Player Component.
stop
public void stop()
Stop the Player Component.
stopIt
public void stopIt()
Copyright © 1999-2004 Wimba S.A. All Rights Reserved.