public class MPlayer extends Observable implements IPlayer, Observer
Modifier and Type | Field and Description |
---|---|
private boolean |
bLoading |
private boolean |
bMute |
private boolean |
bPaused |
private boolean |
bPlaying |
private CustomTrack |
current_track |
private org.apache.log4j.Logger |
log |
private boolean |
mute |
private PositionThread |
position |
private Process |
process |
private OutputReader |
reader |
private TrackInfo |
trackInfo |
private String |
uniqueId |
private long |
volume |
private InputWriter |
writer |
Constructor and Description |
---|
MPlayer() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
endPositionThread() |
void |
fireEvent(EventBase ev) |
InputWriter |
getCommandWriter() |
Process |
getProcess() |
TrackInfo |
getTrackInfo() |
String |
getUniqueId() |
private void |
initProcess(String url)
Build the string to start the process
|
boolean |
isbPaused() |
boolean |
isLoading() |
boolean |
isPlaying() |
private boolean |
isPlayList(String url)
Is this one of the playlists we have configured
|
void |
loaded() |
void |
openFile(CustomTrack t)
If the Player is Playing we can change tracks.
|
void |
pause(boolean bPause) |
void |
playingTrack() |
boolean |
playTrack(CustomTrack track,
long volume,
boolean mute)
Plays the Custom Track
|
void |
preLoadTrack(CustomTrack track)
PreLoad the Track ready for when the current Track ends
|
void |
resume() |
void |
seekAbsolute(long seconds) |
void |
sendCommand(String command)
Send Command to MPlayer
|
void |
setMute(boolean mute) |
void |
setPlaying(boolean bPlaying) |
void |
setStatus(String status)
Update OpenHome with the new Status
|
void |
setVolume(long volume) |
void |
startPlaying() |
void |
startTrack()
Used to start a pre loaded track
|
void |
stop() |
void |
stoppedPlaying()
Track has stopped Playing, get Next Track..
|
String |
toString() |
void |
update(Observable o,
Object evt) |
void |
updateInfo(String artist,
String title)
Used by the ICY info to update the track being played on the Radio
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addObserver
private org.apache.log4j.Logger log
private Process process
private OutputReader reader
private InputWriter writer
private PositionThread position
private boolean bPaused
private boolean bPlaying
private boolean bLoading
private TrackInfo trackInfo
private long volume
private String uniqueId
private CustomTrack current_track
private boolean bMute
private boolean mute
public boolean playTrack(CustomTrack track, long volume, boolean mute)
public void preLoadTrack(CustomTrack track)
preLoadTrack
in interface IPlayer
public void startTrack()
startTrack
in interface IPlayer
public void openFile(CustomTrack t)
public void startPlaying()
public void playingTrack()
private void initProcess(String url) throws IOException
url
- IOException
private boolean isPlayList(String url)
url
- public InputWriter getCommandWriter()
public boolean isbPaused()
public boolean isPlaying()
public void setPlaying(boolean bPlaying)
bPlaying
- the bPlaying to setpublic void stoppedPlaying()
public void setStatus(String status)
public Process getProcess()
public TrackInfo getTrackInfo()
public void seekAbsolute(long seconds)
seekAbsolute
in interface IPlayer
public void updateInfo(String artist, String title)
updateInfo
in interface IPlayer
artist
- title
- public void endPositionThread()
public void sendCommand(String command)
command
- public boolean isLoading()
public String getUniqueId()
getUniqueId
in interface IPlayer
public void update(Observable o, Object evt)
Copyright © 2013–2014. All rights reserved.