Modifier and Type | Field and Description |
---|---|
private boolean |
bExternalVolume |
private boolean |
bMute |
private boolean |
bPaused |
private CustomTrack |
current_track |
private static PlayManager |
instance |
private static org.apache.log4j.Logger |
log |
private IPlayerController |
mPlayer |
private long |
mplayer_volume |
private ObservableAVTransport |
obsvAVTransport |
private ObservableInfo |
obsvInfo |
private ObservablePlayList |
obsvPlayList |
private ObservableProduct |
obsvProduct |
private ObservableRadio |
obsvRadio |
private ObservableTime |
obsvTime |
private ObservableVolume |
obsvVolume |
private boolean |
repeatPlayList |
private boolean |
shuffle |
private CopyOnWriteArrayList<String> |
shuffled_tracks |
private boolean |
standby |
private String |
status |
private CopyOnWriteArrayList<CustomTrack> |
tracks |
private long |
volume |
Modifier | Constructor and Description |
---|---|
private |
PlayManager() |
Modifier and Type | Method and Description |
---|---|
private void |
addAsNextShuffleTrack(CustomTrack t)
Add the Next Shuffle Track Find the current track index in the shuffle
list and insert after
|
long |
decVolume()
Decrease the Volume
|
void |
deleteAllTracks()
Delete All Tracks
|
void |
deletedAllTracks() |
void |
deletedTrack(long iD) |
void |
DeleteTrack(long iD)
Delete a Track, if it is playing stop the player
|
void |
destroy()
Destroy
|
private int |
generateRandonNumber(int min,
int max)
Generate a Random number in the range
|
CustomTrack |
getCurrentTrack() |
static PlayManager |
getInstance()
SingleInstance of the PlayManager
|
boolean |
getMute() |
CustomTrack |
getNextTrack(int offset)
Get the Next Track when not in shuffle Mode
|
private CustomTrack |
getRandomTrack(int offset)
Get the Next Random Track
|
private CopyOnWriteArrayList<String> |
getShuffledTracks() |
private CustomTrack |
getTrack(int offset)
Get next or previous track
|
CustomTrack |
getTrackFromId(int id)
Return a Custom Track from the given Track Id.
|
CustomTrack |
getTrackFromIndex(int index)
Get the Custom Track from the List
|
private int |
getTrackIndex(long aAfterId)
Find the index of the Track Number in the main List
|
private int |
getTrackIndexShuffled(long aAfterId)
Find the index of the Track Number in the shuffled List
|
private CopyOnWriteArrayList<CustomTrack> |
getTracks() |
long |
getVolume()
Get the Volume
|
long |
incVolume()
Increase the Volume
|
private void |
insertAfterShuffleTrack(long aAfterId,
CustomTrack track)
Insert into the shuffle list
|
private void |
insertAfterTrack(long aAfterId,
CustomTrack track)
Insert into our main list of tracks
|
void |
insertTrack(long aAfterId,
CustomTrack track)
Insert a track
|
private boolean |
isPaused() |
boolean |
isRepeatPlayList() |
boolean |
isShuffle() |
boolean |
isStandby() |
boolean |
isUseExternalVolume() |
void |
nextTrack()
Play the Next Track
|
void |
observAVEvnts(Observer o) |
void |
observeProductEvents(Observer o)
Register for Product Events
|
void |
observInfoEvents(Observer o)
Register for Info Events
|
void |
observPlayListEvents(Observer o)
Register for PlayList Events
|
void |
observRadioEvents(Observer o)
Register for Radio Events
|
void |
observTimeEvents(Observer o)
Register for Time Events
|
void |
observVolumeEvents(Observer o)
Register for Volume Events
|
void |
pause() |
void |
pause(boolean bPause)
Pause track
|
void |
play()
Play Track If Paused the resume If not Paused then get Next Track and
play it
|
void |
playAV(CustomTrack c) |
void |
playFile(CustomChannel c)
Play a Radio Channel
|
void |
playIndex(long index)
Play track with Index Determine if shuffle is enabled, if we are not
playing anything shuffle the tracks and set this track as the top track,
else set this track as the top track and play
|
void |
playingTrack(int iD)
Update Control Point we are playing a track
|
void |
playRadio(String name)
Used by Alarm Plugin to Start Playing a radio channel by name
|
private void |
playThis(CustomTrack t)
Play This Track If MPlayer is already running destroy it
|
void |
playTrackId(long id) |
void |
previousTrack()
Play the Previous Track
|
void |
seekAbsolute(long seconds)
Seek time in track, does not work for certain format types and VBR MP3's
due to issue with MPLayer
|
void |
setCurrentTrack(CustomTrack track) |
void |
setMute(boolean mute)
Set Mute
|
private void |
setPaused(boolean paused) |
void |
setRepeatPlayList(boolean repeatPlayList) |
void |
setShuffle(boolean shuffle) |
void |
setStandby(boolean standby) |
void |
setStatus(String status)
Set the Status of the Track
|
void |
setTracks(CopyOnWriteArrayList<CustomTrack> tracks)
Set the tracks from ProviderPlaylist Used at the start after reading
playlist from the xml file.
|
void |
setUseExternalVolume(boolean bExternalVolume) |
void |
setVolume(long volume)
Set the Volume to this value
|
private void |
shuffleTracks()
Shuffle the tracks
|
void |
stop()
Stop playin Track
|
void |
toggleMute() |
void |
update(Observable paramObservable,
Object obj) |
void |
updateShuffle(boolean shuffle) |
private CustomTrack current_track
private CopyOnWriteArrayList<CustomTrack> tracks
private CopyOnWriteArrayList<String> shuffled_tracks
private static org.apache.log4j.Logger log
private IPlayerController mPlayer
private boolean repeatPlayList
private boolean shuffle
private boolean bPaused
private boolean standby
private long volume
private long mplayer_volume
private boolean bMute
private boolean bExternalVolume
private ObservableTime obsvTime
private ObservableInfo obsvInfo
private ObservableVolume obsvVolume
private ObservableRadio obsvRadio
private ObservablePlayList obsvPlayList
private ObservableProduct obsvProduct
private ObservableAVTransport obsvAVTransport
private String status
private static PlayManager instance
public static PlayManager getInstance()
private void playThis(CustomTrack t)
t
- public CustomTrack getNextTrack(int offset)
offset
- private CustomTrack getRandomTrack(int offset)
offset
- private CustomTrack getTrack(int offset)
offset
- public CustomTrack getTrackFromIndex(int index)
index
- public CustomTrack getTrackFromId(int id)
id
- public boolean isStandby()
public void setStandby(boolean standby)
public boolean isRepeatPlayList()
public void setRepeatPlayList(boolean repeatPlayList)
repeatPlayList
- public boolean isShuffle()
public void setShuffle(boolean shuffle)
shuffle
- the shuffle to setpublic void updateShuffle(boolean shuffle)
private void addAsNextShuffleTrack(CustomTrack t)
t
- private void shuffleTracks()
private int generateRandonNumber(int min, int max)
min
- max
- private CopyOnWriteArrayList<CustomTrack> getTracks()
private CopyOnWriteArrayList<String> getShuffledTracks()
public void setTracks(CopyOnWriteArrayList<CustomTrack> tracks)
tracks
- public void setCurrentTrack(CustomTrack track)
public CustomTrack getCurrentTrack()
public void deletedAllTracks()
public void deletedTrack(long iD)
public void pause(boolean bPause)
bPause
- private void setPaused(boolean paused)
paused
- private boolean isPaused()
public void stop()
public void playIndex(long index)
index
- public void playTrackId(long id)
public void play()
public void playFile(CustomChannel c)
c
- public void playAV(CustomTrack c)
public void playRadio(String name)
name
- public void nextTrack()
public void previousTrack()
public void seekAbsolute(long seconds)
seconds
- public void setVolume(long volume)
volume
- public void setMute(boolean mute)
mute
- public void insertTrack(long aAfterId, CustomTrack track)
aAfterId
- track
- private void insertAfterTrack(long aAfterId, CustomTrack track)
aAfterId
- track
- private void insertAfterShuffleTrack(long aAfterId, CustomTrack track)
aAfterId
- track
- private int getTrackIndex(long aAfterId)
aAfterId
- private int getTrackIndexShuffled(long aAfterId)
aAfterId
- public void deleteAllTracks()
public void DeleteTrack(long iD)
iD
- public void destroy()
public void setStatus(String status)
status
- public void playingTrack(int iD)
iD
- public long incVolume()
public long decVolume()
public long getVolume()
public void update(Observable paramObservable, Object obj)
public void observTimeEvents(Observer o)
o
- public void observInfoEvents(Observer o)
o
- public void observVolumeEvents(Observer o)
o
- public void observPlayListEvents(Observer o)
o
- public void observeProductEvents(Observer o)
o
- public void observRadioEvents(Observer o)
o
- public void observAVEvnts(Observer o)
public boolean isUseExternalVolume()
public void setUseExternalVolume(boolean bExternalVolume)
public void toggleMute()
public boolean getMute()
public void pause()
Copyright © 2013–2014. All rights reserved.