|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel jaco.mp3.player.MP3Player
public class MP3Player
Java MP3 Player
new MP3Player(new File("test.mp3")).play();
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary | |
---|---|
static java.lang.String |
UI_CLASS_ID
|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MP3Player()
|
|
MP3Player(java.io.File... mp3s)
|
|
MP3Player(java.net.URL... mp3s)
|
Method Summary | |
---|---|
void |
addMP3PlayerListener(MP3PlayerListener listener)
Adds a MP3PlayerListener to the player. |
void |
addToPlayList(java.io.File mp3)
Appends the specified mp3 (as File object) to the end of the play
list. |
void |
addToPlayList(java.net.URL mp3)
Appends the specified mp3 (as URL object) to the end of the play
list. |
java.util.List<java.net.URL> |
getPlayList()
Returns the current play list. |
java.lang.String |
getUIClassID()
|
boolean |
isPaused()
Determines whether this player is paused. |
boolean |
isRepeat()
Returns the repeat state of the player. |
boolean |
isShuffle()
Returns the shuffle state of the player. |
boolean |
isStopped()
Determines whether this player is stopped. |
void |
pause()
Forces the player to pause playing. |
void |
play()
Causes this player to start playing (or resume if the player is paused). |
void |
removeAllMP3PlayerListeners()
Removes all of the MP3PlayerListener listeners from this player. |
void |
removeMP3PlayerListener(MP3PlayerListener listener)
Removes a MP3PlayerListener from the player. |
static void |
setDefaultUI(java.lang.Class<? extends jaco.mp3.player.plaf.MP3PlayerUI> uiClass)
|
void |
setRepeat(boolean repeat)
When you turn on repeat, the player will practically never stop. |
void |
setShuffle(boolean shuffle)
When you turn on shuffle, the next mp3 to play will be randomly chosen from the play list. |
void |
skipBackward()
Forces the player to play previous mp3 in the play list (or random if shuffle is turned on). |
void |
skipForward()
Forces the player to play next mp3 in the play list (or random if shuffle is turned on). |
void |
stop()
Forces the player to stop playing. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UI_CLASS_ID
Constructor Detail |
---|
public MP3Player()
public MP3Player(java.net.URL... mp3s)
public MP3Player(java.io.File... mp3s)
Method Detail |
---|
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JPanel
public static void setDefaultUI(java.lang.Class<? extends jaco.mp3.player.plaf.MP3PlayerUI> uiClass)
public void play()
play()
method) and another thread (which executes the actual play:
stream read/decode, audio data write).
pause()
,
stop()
public void pause()
play()
public void stop()
play()
public void skipForward()
play()
public void skipBackward()
play()
public boolean isPaused()
pause()
public boolean isStopped()
stop()
public void addMP3PlayerListener(MP3PlayerListener listener)
MP3PlayerListener
to the player.
listener
- the listener to be addedpublic void removeMP3PlayerListener(MP3PlayerListener listener)
MP3PlayerListener
from the player.
listener
- the listener to be removedpublic void removeAllMP3PlayerListeners()
MP3PlayerListener
listeners from this player.
public void addToPlayList(java.net.URL mp3)
URL
object) to the end of the play
list.
mp3
- the mp3 to be addedaddToPlayList(File)
,
getPlayList()
public void addToPlayList(java.io.File mp3)
File
object) to the end of the play
list.
mp3
- the mp3 to be addedaddToPlayList(URL)
,
getPlayList()
public java.util.List<java.net.URL> getPlayList()
URL
objectsaddToPlayList(URL)
,
addToPlayList(File)
public boolean isShuffle()
setShuffle(boolean)
public void setShuffle(boolean shuffle)
shuffle
- true if shuffle should be turned on, or false for turning offisShuffle()
public boolean isRepeat()
setRepeat(boolean)
public void setRepeat(boolean repeat)
repeat
- true if repeat should be turned on, or false for turning offisRepeat()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |