|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplayer.AudioPlayer
public class AudioPlayer
A simple Playerthread to play audiofiles.
The player can play a single MapItem
or a list of items
(see MapItemList
). Depending on the configuration the player streams
audiofiles from a server or plays them from the device.
The player can also act as a remote control, meaning instead of playling a
piece of music, the player will trigger another device to play the song.
Constructor Summary | |
---|---|
AudioPlayer(PropertyManager pm)
Creates the AudioPlayer Thread |
Method Summary | |
---|---|
void |
backward()
Skips to the previous track |
void |
forward()
Skips to the next track |
int |
getCurrentItemIndex()
Gets the position of the current item in the playlist |
java.lang.String |
getCurrentSong()
Returns the name (song title) of the current song |
java.lang.String |
getCurrentTime()
Gets the current time in [mm:ss] |
int |
getPlayListLength()
Returns the number of items in a playlist |
java.lang.String |
getRemoteServer()
|
void |
initPlayList(MapItem mapItem)
Inits the playlist with a single item |
void |
initPlayList(MapItemList playList)
Inits the playlist with a list of items |
boolean |
isPlaying()
Returns the player status. |
void |
moveDown(int index)
Moves a song down in the playlist |
void |
moveUp(int index)
Moves a song up in the playlist |
void |
run()
The thread's "run"-method creates a player and plays the item with "currentItemIndex" from the playlist and continues as long as there are more items in the playlist left. |
void |
setBRemote(boolean bRemote)
Turns the remote mode on or off |
void |
start(boolean bRemote,
int startFrom)
Starts the Thread to play item(s) |
void |
stopPlayer()
Stops the player |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioPlayer(PropertyManager pm)
pm
- PropertiesMethod Detail |
---|
public java.lang.String getRemoteServer()
public void initPlayList(MapItemList playList)
playList
- a list of items to be playedpublic void initPlayList(MapItem mapItem)
mapItem
- the Item to be playedpublic void start(boolean bRemote, int startFrom)
bRemote
- indicates if songs are played from the mobile or on a different devicestartFrom
- the index where to start in the playlistpublic void stopPlayer()
public void forward()
public void backward()
public void moveDown(int index)
index
- the index of the item in the playlistpublic void moveUp(int index)
index
- the index of the item in the playlistpublic void run()
run
in interface java.lang.Runnable
public void setBRemote(boolean bRemote)
bRemote
- TRUE for remote mode, FALSE otherwisepublic boolean isPlaying()
public java.lang.String getCurrentSong()
public java.lang.String getCurrentTime()
public int getCurrentItemIndex()
public int getPlayListLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |