sbIPlayQueueService Interface Reference

Service for interacting with the Play Queue. More...

import"sbIPlayQueueService.idl";

Inheritance diagram for sbIPlayQueueService:
[legend]
Collaboration diagram for sbIPlayQueueService:
[legend]

Public Member Functions

void queueNext (in sbIMediaItem aMediaItem)
 Adds a media item to the next slot in the Play Queue. More...
 
void queueLast (in sbIMediaItem aMediaItem)
 Adds a media item to the end of the Play Queue. More...
 
void queueSomeBefore (in unsigned long aIndex, in nsISimpleEnumerator aMediaItems)
 Adds an enumerator of media items before the slot specified by aIndex in the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress. More...
 
void queueSomeNext (in nsISimpleEnumerator aMediaItems)
 Adds an enumerator of media items to the next slot in the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress. More...
 
void queueSomeLast (in nsISimpleEnumerator aMediaItems)
 Adds an enumerator of media items to the end of the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress. More...
 
void clearHistory ()
 Clear the Play Queue's history. More...
 
void clearAll ()
 Clear the Play Queue's contents. More...
 
void addListener (in sbIPlayQueueServiceListener aListener)
 Add a listener for the service. More...
 
void removeListener (in sbIPlayQueueServiceListener aListener)
 Remove a listener for the service. More...
 

Public Attributes

readonly attribute sbIMediaList mediaList
 The underlying MediaList for the Play Queue. More...
 
attribute unsigned long index
 Index of the current track in the Play Queue. More...
 
readonly attribute boolean operationInProgress
 Whether a queue operation is in progress. More...
 

Detailed Description

Service for interacting with the Play Queue.

Service to allow queueing items and visibility into the persistent current index.

Definition at line 76 of file sbIPlayQueueService.idl.

Member Function Documentation

void sbIPlayQueueService::addListener ( in sbIPlayQueueServiceListener  aListener)

Add a listener for the service.

Adds a listener to receive updates when the current index in the queue changes.

See Also
removeListener()
void sbIPlayQueueService::clearAll ( )

Clear the Play Queue's contents.

Note
Please be aware that mediaItems exist only in the context of a library (of which the play queue has its own, apart from the mainLibrary where most mediaitems reside). Thus, when mediaitems are removed with this function, they functionally cease to exist and it is unsafe to continue using them. The mediaitems in the play queue's library, however, likely have counterparts in the mainLibrary that can be retrieved and used after the clear.

Remove all media items from the queue.

See Also
clearHistory()
void sbIPlayQueueService::clearHistory ( )

Clear the Play Queue's history.

Note
Please be aware that mediaItems exist only in the context of a library (of which the play queue has its own, apart from the mainLibrary where most mediaitems reside). Thus, when mediaitems are removed with this function, they functionally cease to exist and it is unsafe to continue using them. The mediaitems in the play queue's library, however, likely have counterparts in the mainLibrary that can be retrieved and used after the clear.

Remove all media items before index.

See Also
clearAll()
void sbIPlayQueueService::queueLast ( in sbIMediaItem  aMediaItem)

Adds a media item to the end of the Play Queue.

Parameters
aMediaItemmedia item to add
See Also
queueNext()
void sbIPlayQueueService::queueNext ( in sbIMediaItem  aMediaItem)

Adds a media item to the next slot in the Play Queue.

Inserts a media item (could be a list) into the Play Queue so that it is played next.

If the current media item is playing or has been played, the new item will be inserted after the current item. Otherwise, the new item will be inserted before the current item. If the current item is not playing, the current index will be updated to correspond to the new item.

A track is considered "played" if it has been played for at least 240 seconds or 1/2 its duration (matching Audioscrobbler). See sbPlaybackHistoryService.cpp#1633.

Parameters
aMediaItemmedia item to add
See Also
queueLast()
void sbIPlayQueueService::queueSomeBefore ( in unsigned long  aIndex,
in nsISimpleEnumerator  aMediaItems 
)

Adds an enumerator of media items before the slot specified by aIndex in the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress.

Parameters
aIndexIndex of the item before which to add media items.
aMediaItemsenumerator of media items to add
See Also
queueSomeLast() queueSomeNext()
void sbIPlayQueueService::queueSomeLast ( in nsISimpleEnumerator  aMediaItems)

Adds an enumerator of media items to the end of the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress.

Parameters
aMediaItemsenumerator of media items to add
See Also
queueSomeBefore() queueSomeNext()
void sbIPlayQueueService::queueSomeNext ( in nsISimpleEnumerator  aMediaItems)

Adds an enumerator of media items to the next slot in the Play Queue asynchronously. Items are not actually in the queue until the onQueueOperationCompleted notification is sent, and callers should not attempt to add or remove items from the queue while the operation is in progress.

Inserts all media items in aMediaItems into the play queue so that the first enumerated item is played next and the remaining enumerated items are played before any remaining future tracks that were already in the queue.

Parameters
aMediaItemsenumerator of media items to add
See Also
queueSomeBefore() queueSomeLast()
void sbIPlayQueueService::removeListener ( in sbIPlayQueueServiceListener  aListener)

Remove a listener for the service.

See Also
addListener()

Member Data Documentation

attribute unsigned long sbIPlayQueueService::index

Index of the current track in the Play Queue.

Definition at line 89 of file sbIPlayQueueService.idl.

readonly attribute sbIMediaList sbIPlayQueueService::mediaList

The underlying MediaList for the Play Queue.

mediaList should not be used to add items to the play queue. Items should always be added using the queue methods provided by this interface.

Definition at line 84 of file sbIPlayQueueService.idl.

readonly attribute boolean sbIPlayQueueService::operationInProgress

Whether a queue operation is in progress.

Definition at line 94 of file sbIPlayQueueService.idl.


The documentation for this interface was generated from the following file: