|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectamip.api.highlevel.Playlist
public class Playlist
This class provides an easy read-only access to the playlist. You can get the whole playlist as an ArrayList
.
There are 2 ways to get the playlist, the async way and sync. If you are connecting to remote AMIP over a slow
connection or playlist is very large or you want your GUI to stay responsive, consider using async way.
Client.getPlaylist()
. Client
and Server
must be already initialized before making any calls to the
Playlist
methods.
Method Summary | |
---|---|
void |
addSyncCompleteListener(SyncCompleteEventListener l)
Adds listener which is notified when playlist synchronization with player is complete. |
java.util.ArrayList |
getCopy()
Once playlist is synced with the sync() method you can get its copy using this method, it's recommended to
call this method in your SyncCompleteEventListener class to be sure that the list is in sync. |
int |
getSize()
Returns the number of entries in the playlist. |
java.lang.String |
getTitle(int index)
Gets the title from playlist with the specified index. |
boolean |
isAutoSynchronize()
|
boolean |
isInSync()
Checks if AMIP's playlist is in sync with the players playlist. |
void |
removeSyncCompleteListener(SyncCompleteEventListener l)
Removes previously added listener. |
void |
setAutoSynchronize(boolean autoSynchronize)
Enables the automatic sync mode. |
void |
sync()
Synchronizes playlist with player and AMIP, if AMIP's and player's lists are not in sync, it automatically invokes reindexing in AMIP. |
java.util.ArrayList |
syncAndGetCopy()
The easiest way to get the playlist, it automatically invokes sync with the player, waits until sync is complete and returns a copy like getCopy() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void addSyncCompleteListener(SyncCompleteEventListener l)
l
- listener.public void removeSyncCompleteListener(SyncCompleteEventListener l)
l
- listener.public boolean isAutoSynchronize()
public int getSize()
public java.lang.String getTitle(int index)
index
- the index of title.
null
if index is not within bounds or title is not available.public java.util.ArrayList getCopy()
sync()
method you can get its copy using this method, it's recommended to
call this method in your SyncCompleteEventListener
class to be sure that the list is in sync.
ArrayList
, returns empty array list if the list is not synced.public java.util.ArrayList syncAndGetCopy() throws GeneralClientException, java.lang.InterruptedException
getCopy()
method.
ArrayList
, returns empty array list if the list is not synced.
GeneralClientException
java.lang.InterruptedException
public boolean isInSync()
public void setAutoSynchronize(boolean autoSynchronize) throws GeneralClientException
PlaylistChangeEventListener
and calls sync()
method in it.
autoSynchronize
- true/false.
GeneralClientException
public void sync() throws GeneralClientException
SyncCompleteEventListener
listeners are notified about it.
GeneralClientException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |