QueueInsertRequestData

public class QueueInsertRequestData extends Object
implements Parcelable RequestData

Data structure for queue insert command requests.

Inherited Constant Summary

Public Method Summary

Integer
getCurrentItemId()
ID of the current media item after the insertion (if null, the currentItem value should be the same as before the insertion).
Integer
getCurrentItemIndex()
Index (relative to the items array, starting with 0) of the new current media Item.
Long
getCurrentTime()
Milliseconds since the beginning of content to start playback of the current item.
JSONObject
getCustomData()
Returns the custom data.
Integer
getInsertBefore()
ID of the item that will be located immediately after the inserted list.
List<MediaQueueItem>
getItems()
List of queue items.
void
writeToParcel(Parcel out, int flags)

Inherited Method Summary

Public Methods

public Integer getCurrentItemId ()

ID of the current media item after the insertion (if null, the currentItem value should be the same as before the insertion).

public Integer getCurrentItemIndex ()

Index (relative to the items array, starting with 0) of the new current media Item.

For inserted items, the index (similar to the start index in QUEUE_LOAD) should be used instead of getCurrentItemId(), because the itemId is unknown until the items are inserted.

If not provided, the current item ID value will be the same as before the insertion (unless getCurrentItemId() is not null). Both getCurrentItemIndex() and getCurrentItemId() can not be provided.

This allows the common use case of insert and play an item atomically.

public Long getCurrentTime ()

Milliseconds since the beginning of content to start playback of the current item.

If not null, this value should take precedence over the MediaQueueItem.getStartTime() value provided at the MediaQueueItem level but only the first time the item is played. This is to cover the common case where the user jumps to the middle of an item so the currentTime does not apply to the item permanently like the MediaQueueItem.getStartTime() does. It avoids having to reset the MediaQueueItem.getStartTime() dynamically (that may not be possible if the phone has gone to sleep).

public JSONObject getCustomData ()

Returns the custom data.

public Integer getInsertBefore ()

ID of the item that will be located immediately after the inserted list.

If the ID is not found or null, the list should be appended at the end of the existing list.

public List<MediaQueueItem> getItems ()

List of queue items. The MediaQueueItem.getItemId() field of the items should be empty. It is sorted (first element will be played first).

public void writeToParcel (Parcel out, int flags)