Songbird / Development / Songbird Add-Ons API Documentation

sbIPlaybackHistoryService Interface Reference

import "sbIPlaybackHistoryService.idl";

List of all members.

Public Member Functions

sbIPlaybackHistoryEntry createEntry (in sbIMediaItem aItem, in long long aTimestamp, in long long aDuration, in sbIPropertyArray aAnnotations)
 Create a playback history entry from a media item and a timestamp.
void addEntry (in sbIPlaybackHistoryEntry aEntry)
 Add an entry to the playback history service.
void addEntries (in nsIArray aEntries)
 Add entries to the playback history service.
sbIPlaybackHistoryEntry getEntryByIndex (in long long aIndex)
 Get an entry by index. Negative indexes wrap from the last entry.
nsIArray getEntriesByIndex (in long long aStartIndex, in unsigned long long aCount)
 Get entries from the playback history service using a start index. Negative indexes wrap from the last entry.
nsIArray getEntriesByTimestamp (in long long aStartTimestamp, in long long aEndTimestamp)
 Get entries between start timestamp and end timestamp. The range is inclusive.
void removeEntry (in sbIPlaybackHistoryEntry aEntry)
 Remove an entry from the playback history service.
void removeEntryByIndex (in long long aIndex)
 Remove an entry from the playback history service using the entry's index. Negative indexes wrap from the last entry.
void removeEntriesByIndex (in long long aStartIndex, in unsigned long long aCount)
 Remove entries from the playback history service using a start index. Negative indexes wrap from the last entry.
void removeEntries (in nsIArray aEntries)
 Remove entries from the playback history service.
nsIArray getEntriesByAnnotation (in AString aAnnotationId, in AString aAnnotationValue,[optional] in unsigned long aCount)
 Get entries by their annotation value.
void clear ()
 Clear all entries from the playback history service.
void addListener (in sbIPlaybackHistoryListener aListener)
 Add a listener.
void removeListener (in sbIPlaybackHistoryListener aListener)
 Remove a listener.

Public Attributes

readonly attribute nsISimpleEnumerator entries
 Enumerator of all entries in the playback history service.
readonly attribute unsigned
long long 
entryCount
 Total number of entries in the playback history service.


Detailed Description

The playback history service stores all entries in _reverse chronological order_. This means that the _most recent_ entry is always the first when using sbIPlaybackHistoryService::entries.

Getter methods assume that index 0 is the most recent entry.

Definition at line 47 of file sbIPlaybackHistoryService.idl.


Member Function Documentation

sbIPlaybackHistoryEntry sbIPlaybackHistoryService::createEntry ( in sbIMediaItem  aItem,
in long long  aTimestamp,
in long long  aDuration,
in sbIPropertyArray  aAnnotations 
)

Create a playback history entry from a media item and a timestamp.

Parameters:
aItem The media item for which you wish to create an entry.
aTimestamp The time at which the item was played in UNIX timestamp format.
aDuration The duration of playback for the item for this entry.
aAnnotations Optional annotations for the entry.

void sbIPlaybackHistoryService::addEntry ( in sbIPlaybackHistoryEntry  aEntry  ) 

Add an entry to the playback history service.

Parameters:
aEntry The playback history entry you wish to add.

void sbIPlaybackHistoryService::addEntries ( in nsIArray  aEntries  ) 

Add entries to the playback history service.

Parameters:
aEntries An array of sbIPlaybackHistoryEntry objects.
Exceptions:
NS_ERROR_INVALID_ARG when the array does not contain sbIPlaybackHistoryEntry objects.

sbIPlaybackHistoryEntry sbIPlaybackHistoryService::getEntryByIndex ( in long long  aIndex  ) 

Get an entry by index. Negative indexes wrap from the last entry.

Parameters:
aIndex 

nsIArray sbIPlaybackHistoryService::getEntriesByIndex ( in long long  aStartIndex,
in unsigned long long  aCount 
)

Get entries from the playback history service using a start index. Negative indexes wrap from the last entry.

Parameters:
aStartIndex The start index.
aCount The number of entries you wish to get.
Note:
The array will contain sbIPlaybackHistoryEntry objects.

nsIArray sbIPlaybackHistoryService::getEntriesByTimestamp ( in long long  aStartTimestamp,
in long long  aEndTimestamp 
)

Get entries between start timestamp and end timestamp. The range is inclusive.

Parameters:
aStartTimestamp The beginning of the range.
aEndTimestamp The end of the range.
Note:
The timestamps are standard UNIX style timestamps.

If aStartTimestamp is greater than aEndTimestamp, the results are returned in descending order.

void sbIPlaybackHistoryService::removeEntry ( in sbIPlaybackHistoryEntry  aEntry  ) 

Remove an entry from the playback history service.

Parameters:
aEntry The entry to remove.

void sbIPlaybackHistoryService::removeEntryByIndex ( in long long  aIndex  ) 

Remove an entry from the playback history service using the entry's index. Negative indexes wrap from the last entry.

Parameters:
aIndex The index of the entry to remove.

void sbIPlaybackHistoryService::removeEntriesByIndex ( in long long  aStartIndex,
in unsigned long long  aCount 
)

Remove entries from the playback history service using a start index. Negative indexes wrap from the last entry.

Parameters:
aStartIndex The start index.
aCount The number of entries you wish to remove.

void sbIPlaybackHistoryService::removeEntries ( in nsIArray  aEntries  ) 

Remove entries from the playback history service.

Parameters:
aEntries An array of sbIPlaybackHistoryEntry objects to remove.

nsIArray sbIPlaybackHistoryService::getEntriesByAnnotation ( in AString  aAnnotationId,
in AString  aAnnotationValue,
[optional] in unsigned long  aCount 
)

Get entries by their annotation value.

Parameters:
aAnnotationId The annotation id.
aAnnotationValue The annotation value.
[optional] aCount The maximum number of entries to return.
Note:
Results are ordered from newest to oldest.


Member Data Documentation

readonly attribute nsISimpleEnumerator sbIPlaybackHistoryService::entries

Enumerator of all entries in the playback history service.

Note:
The enumerator will contain sbIPlaybackHistoryEntry objects.

Definition at line 53 of file sbIPlaybackHistoryService.idl.


The documentation for this interface was generated from the following file:
Generated on Tue Mar 10 14:29:01 2009 for Songbird by  doxygen 1.5.2