PIA - Play List

Play list administers the list of clips that were transmitted to the respective node/system using a persistent file. It can be queried for the next clip to play, return a HTML representaion of its list, search for the next free time to play a clip etc.

Serializable: Serialized Object contains entire Pllaylist > file

Methods

updatePL()

Used to update Playlist.

Parameters

Playlist: playlist - a serialized Playlist object

 

insert()

Used to insert a new clip into the play list. When the provided time is allready occupied, the clip is not inserted but the next available time is returned.

Parameters

Should no name be provided the filename is used, will be extraced from the pathinformation given.

Date: time - The time the clip should be played.

String: clip - The path and filename of the clip to be played.

String: name - The name of the clip (optional).

Return Values

The method returns an respond object with the following properties:

respond.error: True if the provided time was still available or false.

respond.time: The next available time should error be true or null (Date object).

 

insertOnNextAvailable()

Used to insert a new clip into the play list. When the provided time is allready occupied the clip is automatically inserted at the next available time.

Parameters

Date: time - The time the clip should be played.

String: clip - The path and filename of the clip to be played.

String: name - The name of the clip (optional)

Return Values

The method returns an respond object with the following properties:

respond.error: True if the provided time was still available or false.

respond.time: The next available time the clip was inserted should error be true or null (Date object).

 

delete()

Used to delete a clip in the play list.

Parameters

Date: time - The scheduled time of the clip that should be removed from playlist (Date object).

Return Values

The method returns an respond object with the following properties:

respond.error: True if the no clip was scheduled at the time provided.

respond.name: The name of the clip that was scheduled at the given time and thus deleted.

 

queryName()

Used to query the playlist for a specific clip using its name.

Parameters

String: name - The name of the clip to be queried

Return Values

Array of Strings: The method returns an array of times at which the clip is scheduled to be played. If the array's length is 0 the clip has not been found in the playlist.

 

queryTime()

Used to query the playlist for a specific clip using its scheduled time.

Parameters

Date: time - Time to be queried for a clip (Date object).

Return Values

String: Name of the clip that could be found on given time. Empty string if no clip was scheduled on given time.

 

queryNext()

Used to query the playlist for a specific clip using its scheduled time.

Parameters

Date: time - Time to be queried for a clip (Date object).

Return Values

String: Name of the clip that could be found on given time. Empty string if no clip was scheduled on given time.

 

hasNewEntry()

Used to query the playlist for a specific clip using its scheduled time.

Parameters

Date: time - Time to be queried for last clip (Date object).

Return Values

Bool: TRUE if PL contains clip after given time. FALSE if no clip was scheduled since given time.

 

register()

The interface provided contains a method notify that will be triggered whenever a play clip event occurs.

Parameters

Interface: listener- method notify must be available (Observer)

listener.notify(path) will be called for play event.

 

setSlotDuration()

A slot is a span of time reserved to play a clip. The slot duration determines how long a clip may take until it gets cut off. Also needed to search for free slots.

Parameters

int: duration - max. duration of a slot in ms

 

[system overview]