#include <sbBaseDevice.h>
Classes | |
class | AutoListenerIgnore |
struct | EnumerateFinalizeMediaListListenersInfo |
struct | OrganizeData |
struct | TransferRequest |
Public Types | |
typedef sbRequestThreadQueue::Batch | Batch |
Public Member Functions | |
NS_IMETHOD | Connect () |
NS_IMETHOD | Disconnect () |
NS_IMETHOD | GetPreference (const nsAString &aPrefName, nsIVariant **_retval) |
NS_IMETHOD | SetPreference (const nsAString &aPrefName, nsIVariant *aPrefValue) |
NS_IMETHOD | GetIsDirectTranscoding (PRBool *aIsDirect) |
NS_IMETHOD | GetIsBusy (PRBool *aIsBusy) |
NS_IMETHOD | GetCanDisconnect (PRBool *aCanDisconnect) |
NS_IMETHOD | GetState (PRUint32 *aState) |
NS_IMETHOD | SetState (PRUint32 aState) |
NS_IMETHOD | GetPreviousState (PRUint32 *aState) |
NS_IMETHOD | SyncLibraries (void) |
NS_IMETHOD | Eject (void) |
NS_IMETHOD | Format (void) |
NS_IMETHOD | GetSupportsReformat (PRBool *_retval) |
NS_IMETHOD | SupportsMediaItem (sbIMediaItem *aMediaItem, sbIDeviceSupportsItemCallback *aCallback) |
NS_IMETHOD | GetDefaultLibrary (sbIDeviceLibrary **aDefaultLibrary) |
NS_IMETHOD | SetDefaultLibrary (sbIDeviceLibrary *aDefaultLibrary) |
NS_IMETHOD | GetPrimaryLibrary (sbIDeviceLibrary **aPrimaryLibrary) |
NS_IMETHOD | SubmitRequest (PRUint32 aRequest, nsIPropertyBag2 *aRequestParameters) |
NS_IMETHOD | CancelRequests () |
NS_IMETHOD | ImportFromDevice (sbILibrary *aImportToLibrary, sbILibraryChangeset *aImportChangeset) |
NS_IMETHOD | ExportToDevice (sbIDeviceLibrary *aDevLibrary, sbILibraryChangeset *aChangeset) |
sbBaseDevice () | |
virtual | ~sbBaseDevice () |
nsresult | PushRequest (const PRUint32 aType, sbIMediaItem *aItem=nsnull, sbIMediaList *aList=nsnull, PRUint32 aIndex=PR_UINT32_MAX, PRUint32 aOtherIndex=PR_UINT32_MAX, nsISupports *aData=nsnull) |
nsresult | BatchBegin () |
nsresult | BatchEnd () |
nsresult | ClearRequests () |
nsresult | GetRequestTemporaryFileFactory (TransferRequest *aRequest, sbITemporaryFileFactory **aTemporaryFileFactory) |
nsresult | DownloadRequestItem (TransferRequest *aRequest, PRUint32 aBatchCount, sbDeviceStatusHelper *aDeviceStatusHelper) |
nsresult | SetPreferenceInternal (nsIPrefBranch *aPrefBranch, const nsAString &aPrefName, nsIVariant *aPrefValue, PRBool *aHasChanged) |
nsresult | HasPreference (nsAString &aPrefName, PRBool *aHasPreference) |
virtual nsresult | ProcessBatch (Batch &aBatch)=0 |
nsresult | SetPreviousState (PRUint32 aState) |
nsresult | CreateDeviceLibrary (const nsAString &aId, nsIURI *aLibraryLocation, sbIDeviceLibrary **_retval) |
nsresult | InitializeDeviceLibrary (sbDeviceLibrary *aDevLib, const nsAString &aId, nsIURI *aLibraryLocation) |
nsresult | InitializeDeviceLibraryPreferences (sbDeviceLibrary *aDevLib) |
void | FinalizeDeviceLibrary (sbIDeviceLibrary *aDevLib) |
nsresult | AddLibrary (sbIDeviceLibrary *aDevLib) |
virtual nsresult | CheckAccess (sbIDeviceLibrary *aDevLib) |
nsresult | RemoveLibrary (sbIDeviceLibrary *aDevLib) |
nsresult | UpdateLibraryProperty (sbILibrary *aLibrary, const nsAString &aPropertyID, const nsAString &aPropertyValue) |
nsresult | UpdateDefaultLibrary (sbIDeviceLibrary *aDevLib) |
virtual nsresult | OnDefaultLibraryChanged () |
nsresult | ListenToList (sbIMediaList *aList) |
nsresult | SetIgnoreMediaListListeners (PRBool aIgnoreListener) |
nsresult | SetIgnoreLibraryListener (PRBool aIgnoreListener) |
nsresult | SetMediaListsHidden (sbIMediaList *aLibrary, PRBool aHidden) |
nsresult | IgnoreMediaItem (sbIMediaItem *aItem) |
nsresult | UnignoreMediaItem (sbIMediaItem *aItem) |
nsresult | DeleteItem (sbIMediaList *aLibrary, sbIMediaItem *aItem) |
virtual nsresult | GetItemContentType (sbIMediaItem *aMediaItem, PRUint32 *aContentType) |
nsresult | UpdateOriginAndContentSrc (TransferRequest *aRequest, nsIURI *aURI) |
nsresult | CreateTransferRequest (PRUint32 aRequestType, nsIPropertyBag2 *aRequestParameters, TransferRequest **aTransferRequest) |
nsresult | CreateAndDispatchEvent (PRUint32 aType, nsIVariant *aData, PRBool aAsync=PR_TRUE, sbIDeviceEventTarget *aTarget=nsnull) |
nsresult | CreateAndDispatchDeviceManagerEvent (PRUint32 aType, nsIVariant *aData, PRBool aAsync=PR_TRUE) |
nsresult | RegenerateMediaURL (sbIMediaItem *aItem, nsIURI **_retval) |
virtual nsresult | GenerateFilename (sbIMediaItem *aItem, nsACString &aFilename) |
nsresult | CreateUniqueMediaFile (nsIURI *aFileURI, nsIFile **aUniqueFile, nsIURI **aUniqueFileURI) |
nsresult | ReqProcessingStart () |
nsresult | ReqProcessingStop (nsIRunnable *aShutdownAction) |
bool | CheckAndResetRequestAbort () |
bool | GetEnsureSpaceChecked () const |
void | SetEnsureSpaceChecked (bool aChecked) |
NS_SCRIPTABLE NS_IMETHOD | SetWarningDialogEnabled (const nsAString &aWarning, PRBool aEnabled) |
NS_SCRIPTABLE NS_IMETHOD | GetWarningDialogEnabled (const nsAString &aWarning, PRBool *_retval) |
NS_SCRIPTABLE NS_IMETHOD | ResetWarningDialogs (void) |
NS_SCRIPTABLE NS_IMETHOD | OpenInputStream (nsIURI *aURI, nsIInputStream **retval) |
virtual PRBool | IsRequestAborted () |
sbDeviceTranscoding * | GetDeviceTranscoding () const |
PRLock * | StateLock () |
PRUint32 | GetDeviceState () |
sbDeviceImages * | GetDeviceImages () const |
Public Member Functions inherited from sbIDevice | |
void | connect () |
void | disconnect () |
nsIVariant | getPreference (in AString aPrefName) |
void | setPreference (in AString aPrefName, in nsIVariant aPrefValue) |
void | submitRequest (in unsigned long aRequest, in nsIPropertyBag2 aRequestParameters) |
void | cancelRequests () |
void | syncLibraries () |
void | supportsMediaItem (in sbIMediaItem aMediaItem, in sbIDeviceSupportsItemCallback aCallback) |
void | eject () |
void | format () |
void | setWarningDialogEnabled (in AString aWarning, in boolean aEnabled) |
boolean | getWarningDialogEnabled (in AString aWarning) |
void | resetWarningDialogs () |
nsIInputStream | openInputStream (in nsIURI aURI) |
Open an input stream for the URI specified by aURI. The URI may be a generic device URI of the form "x-device:///<device-guid>/<device-library-guid>/path/to/file". Such URI's specify the target device with <device-guid> and the storage volume using the volume's device library with the guid <device-library-guid>. Different device types may also accept device type specific URI's. More... | |
void | importFromDevice (in sbILibrary aImportToLibrary, in sbILibraryChangeset aImportChangeset) |
void | exportToDevice (in sbIDeviceLibrary aDevLibrary, in sbILibraryChangeset aExportChangeset) |
Public Member Functions inherited from sbBaseDeviceEventTarget | |
sbBaseDeviceEventTarget () | |
Public Member Functions inherited from sbIDeviceEventTarget | |
boolean | dispatchEvent (in sbIDeviceEvent aEvent, [optional] in PRBool aAsync) |
void | addEventListener (in sbIDeviceEventListener aListener) |
void | removeEventListener (in sbIDeviceEventListener aListener) |
Static Public Member Functions | |
static | NS_HIDDEN_ (PLDHashOperator) EnumerateFinalizeMediaListListeners(nsISupports *aKey |
static | NS_HIDDEN_ (PLDHashOperator) EnumerateIgnoreMediaListListeners(nsISupports *aKey |
Public Attributes | |
static nsRefPtr < sbBaseDeviceMediaListListener > & | aData |
static nsRefPtr < sbBaseDeviceMediaListListener > void * | aClosure |
static nsRefPtr < sbBaseDeviceMediaListListener > | aData |
Public Attributes inherited from sbIDevice | |
readonly attribute AString | name |
readonly attribute AString | productName |
readonly attribute nsIDPtr | controllerId |
readonly attribute nsIDPtr | id |
readonly attribute boolean | connected |
readonly attribute boolean | threaded |
readonly attribute sbIDeviceCapabilities | capabilities |
readonly attribute sbIDeviceContent | content |
attribute sbIDeviceLibrary | defaultLibrary |
readonly attribute sbIDeviceLibrary | primaryLibrary |
readonly attribute nsIPropertyBag2 | parameters |
readonly attribute sbIDeviceProperties | properties |
readonly attribute boolean | isDirectTranscoding |
readonly attribute boolean | isBusy |
readonly attribute boolean | canDisconnect |
readonly attribute sbIDeviceStatus | currentStatus |
readonly attribute boolean | supportsReformat |
attribute unsigned long | state |
readonly attribute unsigned long | previousState |
const unsigned long | STATE_IDLE = 0 |
const unsigned long | STATE_SYNCING = 1 |
const unsigned long | STATE_COPYING = 2 |
const unsigned long | STATE_DELETING = 3 |
const unsigned long | STATE_UPDATING = 4 |
const unsigned long | STATE_MOUNTING = 5 |
const unsigned long | STATE_DOWNLOADING = 6 |
const unsigned long | STATE_UPLOADING = 7 |
const unsigned long | STATE_DOWNLOAD_PAUSED = 8 |
const unsigned long | STATE_UPLOAD_PAUSED = 9 |
const unsigned long | STATE_DISCONNECTED = 10 |
const unsigned long | STATE_BUSY = 11 |
const unsigned long | STATE_CANCEL = 12 |
const unsigned long | STATE_TRANSCODE = 13 |
const unsigned long | STATE_FORMATTING = 14 |
const unsigned long | STATE_SYNC_PREPARING = 15 |
const unsigned long | STATE_SYNC_PLAYLIST = 16 |
const unsigned long | STATE_COPY_PREPARING = 17 |
const unsigned long | STATE_SYNCING_TYPE = 18 |
const unsigned long | STATE_COPYING_MUSIC = 19 |
const unsigned long | STATE_COPYING_VIDEO = 20 |
const unsigned long | STATE_IMAGESYNC_PREPARING = 21 |
const unsigned long | STATE_COPYING_IMAGE = 22 |
const unsigned long | STATE_USER = 0x20000000 |
const unsigned long | REQUEST_FLAG_USER = 0x80000000 |
const unsigned long | REQUEST_FLAG_WRITE = 0x40000000 |
const unsigned long | REQUEST_FLAG_READ = 0x20000000 |
const unsigned long | REQUEST_MOUNT = REQUEST_FLAG_READ + 1 |
const unsigned long | REQUEST_READ = REQUEST_FLAG_READ + 2 |
const unsigned long | REQUEST_EJECT = REQUEST_FLAG_READ + 3 |
const unsigned long | REQUEST_SUSPEND = REQUEST_FLAG_READ + 4 |
const unsigned long | REQUEST_WRITE = REQUEST_FLAG_WRITE + 1 |
const unsigned long | REQUEST_DELETE = REQUEST_FLAG_WRITE + 2 |
const unsigned long | REQUEST_SYNC = REQUEST_FLAG_WRITE + 3 |
const unsigned long | REQUEST_WIPE = REQUEST_FLAG_WRITE + 4 |
const unsigned long | REQUEST_MOVE = REQUEST_FLAG_WRITE + 5 |
const unsigned long | REQUEST_UPDATE = REQUEST_FLAG_WRITE + 6 |
const unsigned long | REQUEST_NEW_PLAYLIST = REQUEST_FLAG_WRITE + 7 |
const unsigned long | REQUEST_FACTORY_RESET = REQUEST_FLAG_WRITE + 8 |
const unsigned long | REQUEST_FORMAT = REQUEST_FLAG_WRITE + 9 |
const unsigned long | REQUEST_IMAGESYNC = REQUEST_FLAG_WRITE + 10 |
const unsigned long | REQUEST_WRITE_FILE = REQUEST_FLAG_WRITE + 11 |
const unsigned long | REQUEST_DELETE_FILE = REQUEST_FLAG_WRITE + 12 |
const unsigned long | REQUEST_SYNC_COMPLETE = REQUEST_FLAG_WRITE + 13 |
Public Attributes inherited from sbBaseDeviceEventTarget | |
NS_DECL_SBIDEVICEEVENTTARGET | |
Protected Types | |
enum | { CAN_TRANSCODE_UNKNOWN = 0, CAN_TRANSCODE_YES = 1, CAN_TRANSCODE_NO = 2 } |
Protected Member Functions | |
nsresult | Init () |
virtual nsresult | InitDevice () |
virtual nsresult | ChangeState (PRUint32 aState) |
nsresult | EnsureSpaceForWrite (sbILibraryChangeset *aChangeset, sbIDeviceLibrary *aDevLibrary) |
nsresult | WaitForBatchEnd () |
void | WaitForBatchEndCallback () |
nsresult | GetMusicFreeSpace (sbILibrary *aLibrary, PRInt64 *aFreeMusicSpace) |
nsresult | GetMusicAvailableSpace (sbILibrary *aLibrary, PRInt64 *aMusicAvailableSpace) |
nsresult | SupportsMediaItem (sbIMediaItem *aMediaItem, sbDeviceSupportsItemHelper *aCallback, PRBool aReportErrors, PRBool *_retval) |
nsresult | UpdateStreamingItemSupported (Batch &aBatch) |
virtual nsresult | SupportsMediaItemDRM (sbIMediaItem *aMediaItem, PRBool aReportErrors, PRBool *_retval) |
nsresult | AddVolume (sbBaseDeviceVolume *aVolume) |
nsresult | RemoveVolume (sbBaseDeviceVolume *aVolume) |
nsresult | GetVolumeForItem (sbIMediaItem *aItem, sbBaseDeviceVolume **aVolume) |
virtual nsresult | GetDeviceSettingsDocument (class nsIDOMDocument **aDeviceSettingsDocument) |
nsresult | GetDeviceSettingsDocument (nsIFile *aDeviceSettingsFile, class nsIDOMDocument **aDeviceSettingsDocument) |
nsresult | GetDeviceSettingsDocument (nsTArray< PRUint8 > &aDeviceSettingsContent, class nsIDOMDocument **aDeviceSettingsDocument) |
virtual nsresult | ApplyDeviceSettingsDocument () |
virtual nsresult | ApplyDeviceSettings (class nsIDOMDocument *aDeviceSettingsDocument) |
nsresult | ApplyDeviceSettingsToProperty (class nsIDOMDocument *aDeviceSettingsDocument, const nsAString &aPropertyName) |
virtual nsresult | ApplyDeviceSettingsToProperty (const nsAString &aPropertyName, nsIVariant *aPropertyValue) |
nsresult | ApplyDeviceSettingsDeviceInfo (class nsIDOMDocument *aDeviceSettingsDocument) |
nsresult | ApplyDeviceSettingsToCapabilities (class nsIDOMDocument *aDeviceSettingsDocument) |
virtual nsresult | InitializeProperties () |
virtual nsresult | UpdateProperties () |
virtual nsresult | UpdateProperty (const nsAString &aName) |
virtual nsresult | UpdateStatisticsProperties () |
nsresult | UpdateVolumeNames () |
virtual nsresult | UpdateVolumeName (sbBaseDeviceVolume *aVolume) |
nsresult | GetPrefBranchRoot (nsACString &aRoot) |
nsresult | GetPrefBranch (nsIPrefBranch **aPrefBranch) |
nsresult | GetPrefBranch (sbIDeviceLibrary *aLibrary, nsIPrefBranch **aPrefBranch) |
nsresult | GetPrefBranch (const char *aPrefBranchName, nsIPrefBranch **aPrefBranch) |
nsresult | GetPreferenceInternal (nsIPrefBranch *aPrefBranch, const nsAString &aPrefName, nsIVariant **_retval) |
nsresult | SetPreferenceInternal (nsIPrefBranch *aPrefBranch, const nsAString &aPrefName, nsIVariant *aPrefValue) |
nsresult | SetPreferenceInternalNoNotify (const nsAString &aPrefName, nsIVariant *aPrefValue, PRBool *aPrefChanged) |
virtual nsresult | ApplyPreference (const nsAString &aPrefName, nsIVariant *aPrefValue) |
PRBool | GetIsLibraryPreference (const nsAString &aPrefName) |
nsresult | GetPreferenceLibrary (const nsAString &aPrefName, sbIDeviceLibrary **aLibrary, nsAString &aLibraryPrefBase) |
nsresult | GetLibraryPreference (sbIDeviceLibrary *aLibrary, const nsAString &aLibraryPrefName, nsIVariant **aPrefValue) |
nsresult | GetLibraryPreference (const nsAString &aLibraryPrefBase, const nsAString &aLibraryPrefName, nsIVariant **aPrefValue) |
virtual nsresult | ApplyLibraryPreference (sbIDeviceLibrary *aLibrary, const nsAString &aLibraryPrefName, nsIVariant *aPrefValue) |
virtual nsresult | ApplyLibraryOrganizePreference (sbIDeviceLibrary *aLibrary, const nsAString &aLibraryPrefName, const nsAString &aLibraryPrefBase, nsIVariant *aPrefValue) |
nsresult | GetLibraryPreferenceName (const nsAString &aPrefName, nsAString &aLibraryPrefName) |
nsresult | GetLibraryPreferenceName (const nsAString &aPrefName, const nsAString &aLibraryPrefBase, nsAString &aLibraryPrefName) |
nsresult | GetLibraryPreferenceBase (sbIDeviceLibrary *aLibrary, nsAString &aPrefBase) |
nsresult | GetCapabilitiesPreference (nsIVariant **aCapabilities) |
nsresult | GetLocalDeviceDir (nsIFile **aLocalDeviceDir) |
nsresult | SendSyncCompleteRequest () |
nsresult | HandleSyncRequest (TransferRequest *aRequest) |
nsresult | HandleSyncCompletedRequest (TransferRequest *aRequest) |
nsresult | EnsureSpaceForSync (sbILibraryChangeset *aChangeset, PRBool *aCapacityExceeded, PRBool *aAbort) |
nsresult | SyncCreateAndSyncToList (sbILibrary *aSrcLib, sbIDeviceLibrary *aDstLib, PRInt64 aAvailableSpace) |
nsresult | SyncCreateSyncMediaList (sbILibrary *aSrcLib, sbIDeviceLibrary *aDstLib, PRInt64 aAvailableSpace, sbIMediaList **aSyncMediaList) |
nsresult | SyncToMediaList (sbIDeviceLibrary *aDstLib, sbIMediaList *aMediaList) |
PRInt64 | GetChangeSize (sbIDeviceLibrary *aDestLibrary, sbILibraryChange *aChange) |
nsresult | SyncGetSyncItemSizes (sbIDeviceLibrary *aDestLibrary, sbILibraryChangeset *aChangeset, PRInt64 aAvailableSpace, PRUint32 &aLastChangeThatFit, PRInt64 &aTotalSyncSize) |
nsresult | SyncGetSyncAvailableSpace (sbILibrary *aLibrary, PRInt64 *aAvailableSpace) |
nsresult | SyncProduceChangeset (TransferRequest *aRequest, sbILibraryChangeset **aExportChangeset, sbILibraryChangeset **aImportChangeset) |
nsresult | SyncMainLibraryFlag (sbIMediaItem *aMediaItem) |
nsresult | PromptForEjectDuringPlayback (PRBool *aEject) |
virtual nsresult | UpdateMediaFolders () |
nsresult | GetDeviceWriteDestURI (sbIMediaItem *aWriteDstItem, nsIURI *aContentSrcBaseURI, nsIURI *aWriteSrcURI, nsIURI **aDestinationURI) |
nsresult | ListenToMediaLists (sbILibrary *aLibrary) |
nsresult | SetupDevice () |
nsresult | DeferredSetupDevice () |
nsresult | RegisterDeviceInfo () |
nsresult | RegisterDeviceCapabilities (sbIDeviceCapabilities *aCapabilities) |
nsresult | ProcessInfoRegistrars () |
virtual nsresult | GetSupportedTranscodeProfiles (PRUint32 aType, nsIArray **aSupportedProfiles) |
nsresult | GetDeviceTranscodingProperty (PRUint32 aTranscodeType, const nsAString &aPropertyName, nsIVariant **aPropertyValue) |
nsresult | DispatchTranscodeErrorEvent (sbIMediaItem *aMediaItem, const nsAString &aErrorMessage) |
nsresult | GetSupportedAlbumArtFormats (nsIArray **aFormats) |
nsresult | GetShouldLimitMusicSpace (const nsAString &aPrefBase, PRBool *aOutShouldLimitSpace) |
nsresult | GetMusicLimitSpacePercent (const nsAString &aPrefBase, PRUint32 *aOutLimitPercentage) |
template<class T > | |
nsresult | RemoveLibraryItems (T iter, T end) |
nsresult | GetNameBase (nsAString &aName) |
nsresult | GetProductNameBase (char const *aDefaultModelNumberString, nsAString &aProductName) |
nsresult | IgnoreWatchFolderPath (nsIURI *aURI, sbAutoIgnoreWatchFolderPath **aIgnorePath) |
void | LogDeviceFolders () |
nsresult | GetExcludedFolders (nsTArray< nsString > &aExcludedFolders) |
nsresult | UpdateMediaLists (nsIArray *aMediaLists) |
nsresult | AddMediaLists (sbILibrary *aLibrary, nsIArray *aMediaLists) |
nsresult | CopyChangedMediaItemsToMediaList (sbILibraryChange *aChange, sbIMediaList *aMediaList) |
Protected Member Functions inherited from sbBaseDeviceEventTarget | |
virtual | ~sbBaseDeviceEventTarget () |
nsresult | DispatchEventInternal (nsCOMPtr< sbIDeviceEvent > aEvent) |
Static Protected Member Functions | |
static void | WaitForBatchEndCallback (nsITimer *aTimer, void *aClosure) |
static void | DeferredSetupDevice (nsITimer *aTimer, void *aClosure) |
static PLDHashOperator | RemoveLibraryEnumerator (nsISupports *aList, nsCOMPtr< nsIMutableArray > &aItems, void *aUserArg) |
static PLDHashOperator | LogDeviceFoldersEnum (const unsigned int &aKey, nsString *aData, void *aUserArg) |
static nsresult | GetImportSettings (sbIDeviceLibrary *aDevLibrary, PRBool *aImportAudio, PRBool *aImportVideo) |
Static Protected Attributes | |
static const PRUint32 | DEFAULT_PER_TRACK_OVERHEAD = 10000 |
static const PRUint32 | SYNC_PLAYLIST_AVAILABLE_PCT = 95 |
static const PRUint32 | DEFER_DEVICE_SETUP_DELAY = 2000 |
Friends | |
class | sbDeviceTranscoding |
class | sbDeviceImages |
class | sbBaseDeviceVolume |
class | sbDeviceRequestThreadQueue |
class | sbDevieEnsureSpaceForWrite |
class | sbBaseDeviceInitHelper |
class | sbDeviceEnsureSpaceForWrite |
class | sbDeviceStatistics |
class | sbDeviceReqAddedEvent |
class | sbDeviceSupportsItemHelper |
Base class for implementing a device
Derived classes should
Definition at line 99 of file sbBaseDevice.h.
Definition at line 110 of file sbBaseDevice.h.
|
protected |
Enumerator | |
---|---|
CAN_TRANSCODE_UNKNOWN | |
CAN_TRANSCODE_YES | |
CAN_TRANSCODE_NO |
Definition at line 704 of file sbBaseDevice.h.
sbBaseDevice::sbBaseDevice | ( | ) |
Definition at line 400 of file sbBaseDevice.cpp.
|
virtual |
Definition at line 469 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::AddLibrary | ( | sbIDeviceLibrary * | aDevLib | ) |
Add the library specified by aDevLib to the device content.
aDevLib | the device library to add. |
Definition at line 1464 of file sbBaseDevice.cpp.
|
protected |
This adds teh media lists to the given library
aLibrary | The library the media lists are to be added |
aMediaLists | The list of media lists to be added |
Definition at line 4781 of file sbBaseDevice.cpp.
|
protected |
Add the media volume specified by aVolume to the set of device media volumes.
aVolume | Volume to add. |
Definition at line 2566 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the contents of the device settings document specified by aDeviceSettingsDocument to the device settings.
aDeviceSettingsDocument | Device settings document. |
Definition at line 2804 of file sbBaseDevice.cpp.
|
protected |
Apply the device info content of the device settings document specified by aDeviceSettingsDocument.
aDeviceSettingsDocument | Device settings document. |
Definition at line 2897 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the contents of the device settings document to the device settings.
Definition at line 2781 of file sbBaseDevice.cpp.
|
protected |
Apply the contents of the device settings document specified by aDeviceSettingsDocument to the device capabilities.
aDeviceSettingsDocument | Device settings document. |
Definition at line 3000 of file sbBaseDevice.cpp.
|
protected |
Apply the contents of the device settings document specified by aDeviceSettingsDocument to the device property specified by aPropertyName. The property will be set to the same value as the device setting element with the same tag name as the device property suffix. The suffix is the unique suffix of the device property.
aDeviceSettingsDocument | Device settings document. |
aPropertyName | Name of device property to which to apply. |
Definition at line 2831 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the device settings property value specified by aPropertyValue to the device property specified by aPropertyName.
aPropertyName | Name of device property to which to apply. |
aPropertyValue | Device settings property value. |
Definition at line 2888 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the preference for library organization specified by the library preference name aLibraryPrefName with the value specified by aPrefValue for the library specified by aLibrary. If aPrefValue is null, read the current preference value and apply it. If aLibraryPrefName is empty, read and apply all library organization preferences.
aLibrary | Library for which to apply preference. |
aLibraryPrefName | Library preference name. |
aLibraryPrefBase | [optional] Library preference base. |
aPrefValue | Library preference value. |
Definition at line 3678 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the preference specified by the library preference name aLibraryPrefName with the value specified by aPrefValue for the library specified by aLibrary. If aPrefValue is null, read the current preference value and apply it. If aLibraryPrefName is empty, read and apply all library preferences.
aLibrary | Library for which to apply preference. |
aLibraryPrefName | Library preference name. |
aPrefValue | Library preference value. |
Definition at line 3630 of file sbBaseDevice.cpp.
|
protectedvirtual |
Apply the preference specified by aPrefName with the value specified by aPrefValue. Update device state and take any actions appropriate for the preference value.
aPrefName | Name of preference to apply. |
aPrefValue | Value of preference. |
Definition at line 3516 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::BatchBegin | ( | ) |
Starts a batch of requests
Definition at line 602 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::BatchEnd | ( | ) |
Marks the end of a batch of requests
Definition at line 607 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::CancelRequests | ( | ) |
|
protectedvirtual |
Changes the state of the underlying deviceStatusHelper. This means that the devices status and substate are set as well as a call to SetState for setting to certain states.
The relation and individual uses of ChangeState and SetState are not very well defined. Please take great care before using this method. If you can use SetState you probably should, but there may be some instances when you have to use ChangeState.
Definition at line 1344 of file sbBaseDevice.cpp.
|
virtual |
Check the library access (read-only vs. read-write) of the device library specified by aDevLib and prompt the user if needed.
aDevLib | the device library to check. |
Definition at line 1532 of file sbBaseDevice.cpp.
bool sbBaseDevice::CheckAndResetRequestAbort | ( | ) |
Returns true if the current request should be aborted. It also resets the abort flag.
Definition at line 2297 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::ClearRequests | ( | ) |
Clears requests from the request queue
Definition at line 2303 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::Connect | ( | ) |
Definition at line 506 of file sbBaseDevice.cpp.
|
protected |
Copies media items to a media list for a media list change.
aChange | the change to get the items from |
aMediaList | the list to copy to |
Definition at line 6571 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::CreateAndDispatchDeviceManagerEvent | ( | PRUint32 | aType, |
nsIVariant * | aData, | ||
PRBool | aAsync = PR_TRUE |
||
) |
Create and dispatch an event through the device manager of the type specified by aType with the data specified by aData, originating from the device. If aAsync is true, dispatch and return immediately; otherwise, wait for the event handling to complete.
aType | Type of event. |
aData | Event data. |
aAsync | If true, dispatch asynchronously. |
Definition at line 2080 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::CreateAndDispatchEvent | ( | PRUint32 | aType, |
nsIVariant * | aData, | ||
PRBool | aAsync = PR_TRUE , |
||
sbIDeviceEventTarget * | aTarget = nsnull |
||
) |
Create an event for the device and dispatch it
aType | type of event |
aData | event data |
aAsync | if true, dispatch asynchronously |
aTarget | event target |
Definition at line 2043 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::CreateDeviceLibrary | ( | const nsAString & | aId, |
nsIURI * | aLibraryLocation, | ||
sbIDeviceLibrary ** | _retval | ||
) |
Create a local database library for the device. The library must be finalized by calling FinalizeDeviceLibrary.
aId | the ID for the library |
aLibraryLocation | the file to name the library, or null to use some default |
Definition at line 1349 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::CreateTransferRequest | ( | PRUint32 | aRequestType, |
nsIPropertyBag2 * | aRequestParameters, | ||
TransferRequest ** | aTransferRequest | ||
) |
Definition at line 1981 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::CreateUniqueMediaFile | ( | nsIURI * | aFileURI, |
nsIFile ** | aUniqueFile, | ||
nsIURI ** | aUniqueFileURI | ||
) |
Create a unique media file, starting with the file specified by aFileURI. aFileURI must QI to nsIFileURL. If the specified file already exists, modify the file name and try again. If aUniqueFile is not null, return the file object in aUniqueFile. If aUniqueFileURI is not null, return the file URI in aUniqueFileURI.
aFileURI | First file URI to try creating. |
aUniqueFile | Returned unique file object. |
aUniqueFileURI | Returned URI of unique file. |
Definition at line 2139 of file sbBaseDevice.cpp.
|
staticprotected |
Callback functions for deferring the presentation of the initial device setup dialog.
Definition at line 5478 of file sbBaseDevice.cpp.
|
protected |
nsresult sbBaseDevice::DeleteItem | ( | sbIMediaList * | aLibrary, |
sbIMediaItem * | aItem | ||
) |
Delete an item from the library and suppress notifications during delete. This is to avoid having the listeners watching the library attempt to double delete an item.
Definition at line 1891 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::Disconnect | ( | ) |
|
protected |
Dispatch a transcode error event for the media item specified by aMediaItem with the error message specified by aErrorMessage.
aMediaItem | The media item for which to dispatch an error event. |
aErrorMessage | Error event message. |
Definition at line 6084 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::DownloadRequestItem | ( | TransferRequest * | aRequest, |
PRUint32 | aBatchCount, | ||
sbDeviceStatusHelper * | aDeviceStatusHelper | ||
) |
Download the item for the request specified by aRequest and update the request downloadedFile field. Use the device status helper speicifed by aDeviceStatusHelper to update the device status.
aRequest | Request for which to download item. |
aDeviceStatusHelper | Helper to use to update device status. |
Definition at line 758 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::Eject | ( | void | ) |
return NS_ERROR_ABORT if user aborts the ejection while playback is on device item.
Definition at line 6228 of file sbBaseDevice.cpp.
|
protected |
Ensure enough space is available for the sync request specified by aRequest. If not, ask the user if the sync should be changed to a random subset of the items to sync that fits in the available space. If the user chooses to do so, create the list and configure to sync to it. If the user chooses to abort, return true in aAbort.
aChangeset | The change set to check for space |
aCapacityExceeded | Returns whether the capacity was exceeded |
aAbort | Abort sync if true. |
|
protected |
Make sure that there is enough free space for the changeset. If there is not enough space for all the changes and the user does not abort the operation, items in the changeset will be removed.
We preference different types of change operations differently. Most commonly the changeset will be composed of ADD and MODIFIED changes, and we preference non-ADD changes over ADDs so that we will perform all modifications before considering ADDs.
aChangeset | The changest to ensure space for. The changes within the changeset may be modified on return. |
aDevLibrary | The device library representing the device for whom the changeset was generated. |
Definition at line 2362 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::ExportToDevice | ( | sbIDeviceLibrary * | aDevLibrary, |
sbILibraryChangeset * | aChangeset | ||
) |
Definition at line 4894 of file sbBaseDevice.cpp.
void sbBaseDevice::FinalizeDeviceLibrary | ( | sbIDeviceLibrary * | aDevLib | ) |
Finalize a library for the device
aDevLib | the device library to finalize. |
Definition at line 1445 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::Format | ( | void | ) |
Definition at line 6302 of file sbBaseDevice.cpp.
|
virtual |
Used to generate a filename for an item. This is virtual so different devices can choose to name the file differently. Eventually this logic should be moved to a more centralized place.
aItem | The item we're generating a filename for |
aFilename | The filename that was generated. This is can be an escaped filename so you may need to unescape or use SetFilename on a URL object. |
Definition at line 2095 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetCanDisconnect | ( | PRBool * | aCanDisconnect | ) |
Definition at line 1247 of file sbBaseDevice.cpp.
|
protected |
Return in aCapabilities the device capabilities preference. Return a void variant if no device capabilities preference has been set.
aCapabilities | Returned device capabilities preference. |
Definition at line 3838 of file sbBaseDevice.cpp.
|
protected |
Returns the size for a given change. If it's a modification it will return the difference between the original and the new version
aDestLibrary | The destination library for the change |
aChange | The change item to use |
Definition at line 4499 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetDefaultLibrary | ( | sbIDeviceLibrary ** | aDefaultLibrary | ) |
|
inline |
Definition at line 638 of file sbBaseDevice.h.
|
protectedvirtual |
Return in aDeviceSettingsDocument a DOM document object representing the Songbird settings stored on the device. Return null in aDeviceSettingsDocument if no Songbird settings are stored on the device.
aDeviceSettingsDocument | Returned device settings document object. |
Definition at line 2691 of file sbBaseDevice.cpp.
|
protected |
Return in aDeviceSettingsDocument the device settings stored in the file specified by aDeviceSettingsFile. Return null in aDeviceSettingsDocument if the device settings file does not exist.
aDeviceSettingsFile | File containing device settings. |
aDeviceSettingsDocument | Returned device settings document object. |
Definition at line 2701 of file sbBaseDevice.cpp.
|
protected |
Return in aDeviceSettingsDocument the device settings contained in aDeviceSettingsContent.
aDeviceSettingsContent | Device settings content. |
aDeviceSettingsDocument | Returned device settings document object. |
Definition at line 2758 of file sbBaseDevice.cpp.
|
inline |
Return the state without locking. This is for use in conjunction with StateLock
Definition at line 634 of file sbBaseDevice.h.
|
inline |
|
protected |
Get the value of the transcoding property with the name specified by aPropertyName and transcoding type specified by aTranscodeType. Return the value in aPropertyValue.
aTranscodeType | Type of transcode. E.g., sbITranscodeProfile::TRANSCODE_TYPE_AUDIO. |
aPropertyName | Name of property. |
aPropertyValue | Returned property value. |
Definition at line 6023 of file sbBaseDevice.cpp.
|
protected |
Determine the URI for the device write destination media item specified by aWriteDstItem. The base URI is specified by aContentSrcBaseURI. The URI of the source of the write operation may be specified by aWriteSrcURI; if none is specified, the source information is obtained from the write destination item.
Currently, only base URI schemes of "file:" are supported.
Definition at line 5235 of file sbBaseDevice.cpp.
|
inline |
Returns true if the space has been checked.
Definition at line 594 of file sbBaseDevice.h.
|
protected |
|
staticprotected |
Returns boolean flags for whether we should import audio and/or video
aSettings | A sync settings object |
aImportAudio | Returns whether audio should be imported |
aImportVideo | Returns whether video should be imported |
NS_IMETHODIMP sbBaseDevice::GetIsBusy | ( | PRBool * | aIsBusy | ) |
Definition at line 1226 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetIsDirectTranscoding | ( | PRBool * | aIsDirect | ) |
Definition at line 1219 of file sbBaseDevice.cpp.
|
protected |
Return true if the preference specified by aPrefName is a library preference.
aPrefName | Name of preference. |
Definition at line 3549 of file sbBaseDevice.cpp.
|
virtual |
Return in aContentType the type of content contained in the media item specified by aMediaItem. The content type values are as defined in sbIDeviceCapabilities.
Sub-classes may override this method to provide custom content type determination.
aMediaItem | Media item for which to get content type. |
aContentType | Returned content type. |
Definition at line 1910 of file sbBaseDevice.cpp.
|
protected |
Return in aPrefValue the value of the library preference specified by the library preference name aLibraryPrefName for the library specified by aLibrary. The library preference name is relative ot the library preference base.
aLibrary | Library for which to get preference. |
aLibraryPrefName | Library preference name to get. |
aPrefValue | Returned preference value. |
Definition at line 3600 of file sbBaseDevice.cpp.
|
protected |
Return in aPrefValue the value of the library preference specified by the library preference base aLibraryPrefBase and library preference name aLibraryPrefName.
aLibraryPrefBase | Library preference base. |
aLibraryPrefName | Library preference name. |
aPrefValue | Returned preference value. |
Definition at line 3618 of file sbBaseDevice.cpp.
|
protected |
Return in aPrefBase the library preference base for the library specified by aLibrary.
aLibrary | Library for which to get preference base. |
aPrefBase | Returned library preference base. |
Definition at line 3815 of file sbBaseDevice.cpp.
|
protected |
Return in aLibraryPrefName the library preference name for the preference with the device preference name aPrefName.
aPrefName | Device preference name. |
aLibraryPrefName | Returned library preference name. |
Definition at line 3787 of file sbBaseDevice.cpp.
|
protected |
Return in aLibraryPrefName the library preference name for the preference with the device preference name aPrefName. The library preference base is specified by aLibraryPrefBase.
aPrefName | Device preference name. |
aLibraryPrefBase | Library preference base. |
aLibraryPrefName | Returned library preference name. |
Definition at line 3801 of file sbBaseDevice.cpp.
|
protected |
Return in aLocalDeviceDir the local directory in which to store device related files (e.g., device settings file backups).
aLocalDeviceDir | Retured local device file directory. |
Definition at line 3875 of file sbBaseDevice.cpp.
|
protected |
Return in aMusicAvailableSpace the amount of all available music space in the library specified by aLibrary. This value may be limited to a value less than the total capacity of the library.
Definition at line 2500 of file sbBaseDevice.cpp.
|
protected |
Return in aFreeMusicSpace the amount of available music space that is free for use in the library specified by aLibrary. This value may be limited to a value less than the total free space.
aLibrary | Library for which to get space. |
aFreeMusicSpace | Returned free music space. |
Definition at line 2461 of file sbBaseDevice.cpp.
|
protected |
Return the current limited music space as a percentage that the device's pref is currently set to.
aPrefBase | The device preference root. |
aOutLimitPercentage | The outparam for setting the music limit percentage value. WARNING: This method expects to be under the |mPreferenceLock| when called. |
Definition at line 6210 of file sbBaseDevice.cpp.
|
protected |
Base implementation for the device name.
aName | the returned name |
Definition at line 6329 of file sbBaseDevice.cpp.
|
protected |
Definition at line 3480 of file sbBaseDevice.cpp.
|
protected |
|
protected |
|
protected |
NS_IMETHODIMP sbBaseDevice::GetPreference | ( | const nsAString & | aPrefName, |
nsIVariant ** | _retval | ||
) |
Definition at line 983 of file sbBaseDevice.cpp.
|
protected |
|
protected |
Return in aLibrary, if not null, the library corresponding to the library preference specified by aPrefName. Return the library pref base in aLibraryPrefBase.
aPrefName | Name of library preference. |
aLibrary | Optionally returned preference library. |
aLibraryPrefBase | Library preference base. |
Definition at line 3555 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetPreviousState | ( | PRUint32 * | aState | ) |
Definition at line 1270 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetPrimaryLibrary | ( | sbIDeviceLibrary ** | aPrimaryLibrary | ) |
Definition at line 6003 of file sbBaseDevice.cpp.
|
protected |
Base implementation for the product name
aDefaultModelNumberString | The localized string name for the default model number |
aProductString | the localized sttring name for the product name |
aProductName | The returned product name |
Definition at line 6366 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::GetRequestTemporaryFileFactory | ( | TransferRequest * | aRequest, |
sbITemporaryFileFactory ** | aTemporaryFileFactory | ||
) |
Return in aTemporaryFileFactory a temporary file factory for the request specified by aRequest, creating one if necessary. When the request completes and is destroyed, and any external references to the temporary file factory are released, the temporary file factory will be destroyed, and all of its temporary files will be deleted.
aRequest | Request for which to get temporary file factory. |
aTemporaryFileFactory | Returned temporary file factory for request. |
Definition at line 614 of file sbBaseDevice.cpp.
|
protected |
Returns if the device pref to enable music space limiting is turned on.
aPrefBase | The device preference root. |
aOutShouldLimitSpace | The outparam for setting if the device is currently set for music space limiting. WARNING: This method expects to be under the |mPreferenceLock| when called. |
Definition at line 6192 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetState | ( | PRUint32 * | aState | ) |
|
protected |
Definition at line 6159 of file sbBaseDevice.cpp.
|
protectedvirtual |
Returns a list of transcode profiles that the device supports
aType | the type of transcode profiles to retrieve. |
aSupportedProfiles | the list of profiles that were found |
Definition at line 6014 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetSupportsReformat | ( | PRBool * | _retval | ) |
|
protected |
Return in aVolume the media volume containing the media item specified by aItem. If the media item does not belong to a media volume, return NS_ERROR_NOT_AVAILABLE.
aItem | Media item for which to get volume. |
aVolume | Returned media volume. |
Definition at line 2650 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::GetWarningDialogEnabled | ( | const nsAString & | aWarning, |
PRBool * | _retval | ||
) |
|
protected |
Handle the sync-completed request, updating the last-sync timestamp.
aRequest | Request data record. |
Definition at line 4100 of file sbBaseDevice.cpp.
|
protected |
Handle the sync request specified by aRequest.
aRequest | Request data record. |
Definition at line 3989 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::HasPreference | ( | nsAString & | aPrefName, |
PRBool * | aHasPreference | ||
) |
Return true in aHasPreference if the device has the preference specified by aHasPreference.
aPrefName | The preference to check. Returned true if device has preference. |
Definition at line 1184 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::IgnoreMediaItem | ( | sbIMediaItem * | aItem | ) |
Ignores events for the given media item
Definition at line 1880 of file sbBaseDevice.cpp.
|
protected |
Creates an ignore auto object that will cause the watch folder to ignore the path while it's being created. If this is not a file URI this will return nothing and not fail.
Definition at line 6428 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::ImportFromDevice | ( | sbILibrary * | aImportToLibrary, |
sbILibraryChangeset * | aImportChangeset | ||
) |
Definition at line 48 of file sbDeviceImport.cpp.
|
protected |
Base class initialization this will call the InitDevice first then do the initialization needed by the sbDeviceBase
Definition at line 2401 of file sbBaseDevice.cpp.
|
inlineprotectedvirtual |
This allows the derived classes to be initialized if needed
Reimplemented in sbCDDevice.
Definition at line 655 of file sbBaseDevice.h.
nsresult sbBaseDevice::InitializeDeviceLibrary | ( | sbDeviceLibrary * | aDevLib, |
const nsAString & | aId, | ||
nsIURI * | aLibraryLocation | ||
) |
Initialize a library for the device. The library must be finalized by calling FinalizeDeviceLibrary.
aDevLib | the device library to initialize. |
aId | the ID for the library |
aLibraryLocation | the file to name the library, or null to use some default |
Definition at line 1368 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::InitializeDeviceLibraryPreferences | ( | sbDeviceLibrary * | aDevLib | ) |
Initialize the preferences for the device library specified by aDevLib.
aDevLib | the device library for which to initialize preferences. |
In deprecating custom directory structures for devices, set default library organize preferences.
Definition at line 1409 of file sbBaseDevice.cpp.
|
protectedvirtual |
Initialize the device properties.
Reimplemented in sbIPDDevice.
Definition at line 3030 of file sbBaseDevice.cpp.
|
virtual |
Returns true if the request has been aborted or the device is disconnected. This calls CheckAndResetAbort and so once this is called the caller should not call this again for the current request if it returns true
Reimplemented in sbCDDevice.
Definition at line 2341 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::ListenToList | ( | sbIMediaList * | aList | ) |
Called when a media list has been added to the device library
aList | the media list to listen for modifications |
Definition at line 1749 of file sbBaseDevice.cpp.
|
protected |
This hooks up media list listeners for playlists in the given library this is generally called after a mount is finished.
aLibrary | the library containing the playlists to listen to |
Definition at line 5429 of file sbBaseDevice.cpp.
|
protected |
Log the list of device folders.
Definition at line 6485 of file sbBaseDevice.cpp.
|
staticprotected |
Enumerator function for logging the list of device folders.
Definition at line 6494 of file sbBaseDevice.cpp.
|
static |
|
static |
|
virtual |
Handle a change to the default library.
Definition at line 1740 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::OpenInputStream | ( | nsIURI * | aURI, |
nsIInputStream ** | retval | ||
) |
Definition at line 3404 of file sbBaseDevice.cpp.
|
pure virtual |
Process this batch of requests
Implemented in sbMockDevice.
|
protected |
Process the info registrars to find out which ones are interested in us.
Definition at line 5514 of file sbBaseDevice.cpp.
|
protected |
Show a dialog box to ask the user if they would like the device ejected even though Songbird is currently playing from the device.
aEject | [out, retval] Should the device be ejected? |
Definition at line 5159 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::PushRequest | ( | const PRUint32 | aType, |
sbIMediaItem * | aItem = nsnull , |
||
sbIMediaList * | aList = nsnull , |
||
PRUint32 | aIndex = PR_UINT32_MAX , |
||
PRUint32 | aOtherIndex = PR_UINT32_MAX , |
||
nsISupports * | aData = nsnull |
||
) |
add a transfer/action request to the request queue
Definition at line 577 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::RegenerateMediaURL | ( | sbIMediaItem * | aItem, |
nsIURI ** | _retval | ||
) |
Regenerate the Media URL when the media management service is enabled.
Definition at line 2225 of file sbBaseDevice.cpp.
|
protected |
Calls any registered device capabilities augmenter.
aCapabilities | Capabilities object to augment. |
The capabilities cannot be cached because the capabilities are not preserved on all devices.
Definition at line 5681 of file sbBaseDevice.cpp.
|
protected |
Calls the device info registrars to register the device info.
Definition at line 5579 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::RemoveLibrary | ( | sbIDeviceLibrary * | aDevLib | ) |
Remove the library specified by aDevLib from the device content.
aDevLib | the device library to remove. |
Definition at line 1638 of file sbBaseDevice.cpp.
|
staticprotected |
Hashtable enumerator function that removes the items from the list
Definition at line 6530 of file sbBaseDevice.cpp.
|
inlineprotected |
This iterates over the transfer requests and removes the Songbird library items that were created for the requests. REQUEST_WRITE entries come from items being added to the device the library. Those items are hidden when created, so they need to be removed if they weren't copied successfully. REQUEST_READ items are create when items are copy from the device to another library. Those items are created hidden and need to be deleted if they aren't successfully copied.
iter | Starting point of the requests |
end | Typical iteration end point (1 past the last item) |
Definition at line 1539 of file sbBaseDevice.h.
|
protected |
Remove the media volume specified by aVolume from the set of device media volumes.
aVolume | Volume to remove. |
Definition at line 2603 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::ReqProcessingStart | ( | ) |
Start processing device requests.
Definition at line 2278 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::ReqProcessingStop | ( | nsIRunnable * | aShutdownAction | ) |
Stop processing device requests.
Definition at line 2288 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::ResetWarningDialogs | ( | void | ) |
|
protected |
Send a sync-completed request to be handled by the device.
Definition at line 3957 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SetDefaultLibrary | ( | sbIDeviceLibrary * | aDefaultLibrary | ) |
|
inline |
Set the checked flag.
Definition at line 601 of file sbBaseDevice.h.
nsresult sbBaseDevice::SetIgnoreLibraryListener | ( | PRBool | aIgnoreListener | ) |
Set the ignore flag on all library listeners registered for the library for this device
aIgnoreListener | Ignore flag value. |
Definition at line 1859 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::SetIgnoreMediaListListeners | ( | PRBool | aIgnoreListener | ) |
Set the ignore flag on all media list listeners registered for the library for this device.
aIgnoreListener | Ignore flag value. |
Definition at line 1844 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::SetMediaListsHidden | ( | sbIMediaList * | aLibrary, |
PRBool | aHidden | ||
) |
Set all media lists in the library hidden. This is useful for hiding the lists during mounting operations.
aLibrary | The library containing the media lists you wish to hide. |
aHidden | True to hide, false to show. |
Definition at line 1866 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SetPreference | ( | const nsAString & | aPrefName, |
nsIVariant * | aPrefValue | ||
) |
Definition at line 1003 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::SetPreferenceInternal | ( | nsIPrefBranch * | aPrefBranch, |
const nsAString & | aPrefName, | ||
nsIVariant * | aPrefValue, | ||
PRBool * | aHasChanged | ||
) |
Internally set preference specified by aPrefName to the value specified by aPrefValue. If the new preference value is different than that old, return true in aHasChanged unless aHasChanged is null. This method may be used for loading preferences from device storage. It will not send preference changed events.
aPrefBranch | The branch to set preferences on. |
aPrefName | Name of the preference to set. |
aPrefValue | Value to set preference. |
aHasChanged | True if preference value changed. |
Definition at line 1060 of file sbBaseDevice.cpp.
|
protected |
|
protected |
nsresult sbBaseDevice::SetPreviousState | ( | PRUint32 | aState | ) |
Set the device's previous state
aState | new device state |
Definition at line 1279 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SetState | ( | PRUint32 | aState | ) |
Definition at line 1301 of file sbBaseDevice.cpp.
|
protected |
Present the user with a dialog for the initial device setup.
Definition at line 5447 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SetWarningDialogEnabled | ( | const nsAString & | aWarning, |
PRBool | aEnabled | ||
) |
|
inline |
This should be used with extreme caution. It is exposed because the MTP property implementation needs to lock the state for formatting so that properties do not block the main thread when formatting
Definition at line 627 of file sbBaseDevice.h.
NS_IMETHODIMP sbBaseDevice::SubmitRequest | ( | PRUint32 | aRequest, |
nsIPropertyBag2 * | aRequestParameters | ||
) |
Definition at line 533 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SupportsMediaItem | ( | sbIMediaItem * | aMediaItem, |
sbIDeviceSupportsItemCallback * | aCallback | ||
) |
|
protected |
Internal version of SupportsMediaItem.
aCallback | [optional] A callback to use to report the result. If the callback is used, this method will raise NS_ERROR_IN_PROGRESS. Note that it may not be used even if available; in that case, _retval will be used as in the synchronous case. |
This is expected to be called from the main thread when asynchronous behaviour is desired.
NS_ERROR_IN_PROGRESS | if the result will be asynchronously supplied via the callback. |
Definition at line 5731 of file sbBaseDevice.cpp.
|
protectedvirtual |
Return true in _retval if DRM is supported for the media item specified by aMediaItem; return false otherwise. If aReportErrors is true and DRM is not supported, report a device error.
aMediaItem | Media item to check. |
aReportErrors | If true, report device errors. |
_retval | Returned true if DRM is supported. |
Definition at line 2539 of file sbBaseDevice.cpp.
|
protected |
Create a random subset of sync items from the list specified by aSyncItemList with sizes specified by aSyncItemSizeMap that fits in the available space specified by aAvailableSpace. Create a sync media list from this subset within the source library specified by aSrcLib and configure the destination library specified by aDstLib to sync to it.
aSrcLib | Source library from which to sync. |
aDstLib | Destination library to which to sync. |
aAvailableSpace | Space available for sync. |
Definition at line 4163 of file sbBaseDevice.cpp.
|
protected |
Create a source sync media list in the library specified by aSrcLib from the list of sync items specified by aSyncItemList and return the sync media list in aSyncMediaList.
aSrcLib | Source library of sync. |
aDstLib | Destination library to which to sync. |
aAvailableSpace | Space available for sync. |
aSyncMediaList | Created sync media list. |
Definition at line 4223 of file sbBaseDevice.cpp.
|
protected |
Return in aAvailableSpace the space available for syncing to the library specified by aLibrary. The space available includes all free space available plus the space currently taken for items being synced.
aLibrary | Sync destination library. |
aAvailableSpace | Space available for sync. |
Definition at line 4610 of file sbBaseDevice.cpp.
|
protected |
Return in aSyncItemList and aSyncItemSizeMap the set of items to sync and their sizes, as configured for the destination sync library specified by aDstLib. The sync source library is specified by aSrcLib. The total size of all sync items is specified by aTotalSyncSize.
aDstLib | Sync destination library. |
aChangeset | List of items from which to sync. |
aAvailableSpace | The available space on the device in bytes |
aLastChangeThatFit | Index of the last item that fits in available space |
aTotalSyncSize | Total size of all sync items. |
Definition at line 4554 of file sbBaseDevice.cpp.
NS_IMETHODIMP sbBaseDevice::SyncLibraries | ( | void | ) |
Definition at line 549 of file sbBaseDevice.cpp.
|
protected |
Check whether a media item points to a currently existing main library item as its origin, and update SB_PROPERTY_ORIGIN_IS_IN_MAIN_LIBRARY accordingly. This function is intended for items in the device's library.
aMediaItem | Media item to check. |
Definition at line 5105 of file sbBaseDevice.cpp.
|
protected |
Produce the sync change set for the sync request specified by aRequest and return the change set in aChangeset.
aRequest | Sync request data record. |
aSyncChangeset | Sync request change set. |
aImportChangeset | Changes for the import operation |
Definition at line 4707 of file sbBaseDevice.cpp.
|
protected |
Configure the destination library specified by aDstLib to sync to the media list specified by aMediaList.
aDstLib | Destination sync library. |
aMediaList | Media list to sync. |
Definition at line 4432 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::UnignoreMediaItem | ( | sbIMediaItem * | aItem | ) |
Restores listening to events for the given item
Definition at line 1885 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::UpdateDefaultLibrary | ( | sbIDeviceLibrary * | aDevLib | ) |
Update the default library to the library specified by aDevLib.
aDevLib | the device library to which to update the default library. |
Definition at line 1713 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::UpdateLibraryProperty | ( | sbILibrary * | aLibrary, |
const nsAString & | aPropertyID, | ||
const nsAString & | aPropertyValue | ||
) |
Update the property with the ID specified by aPropertyID to the value specified by aPropertyValue in the library specified by aLibrary if aPropertyValue is different than the current property value.
aLibrary | Library to update. |
aPropertyID | ID of property to update. |
aPropertyValue | Property value to which to update. |
Definition at line 1691 of file sbBaseDevice.cpp.
|
protectedvirtual |
Update locations of folders containing media.
Definition at line 5228 of file sbBaseDevice.cpp.
|
protected |
This updates a collection of media lists.
aMediaLists | The list of media lists to be updated |
Definition at line 4841 of file sbBaseDevice.cpp.
nsresult sbBaseDevice::UpdateOriginAndContentSrc | ( | TransferRequest * | aRequest, |
nsIURI * | aURI | ||
) |
Set the content source for the media item in the request specified by aRequest to the URI specified by aURI. If the content source has not already been set for the request, copy the media item content source to the origin URL property before updating the content source to aURI.
aRequest | Request for which to update media item. |
aURI | New content source URI. |
Definition at line 1943 of file sbBaseDevice.cpp.
|
protectedvirtual |
Update the device properties.
Definition at line 3041 of file sbBaseDevice.cpp.
|
protectedvirtual |
Update the device property specified by aName.
aName | Name of property to update. |
Definition at line 3065 of file sbBaseDevice.cpp.
|
protectedvirtual |
Update the device statistics properties.
Definition at line 3076 of file sbBaseDevice.cpp.
|
protected |
Update the destination compatibility for the streaming items in the batch.
aBatch | The batch to be updated. |
Definition at line 5870 of file sbBaseDevice.cpp.
|
protectedvirtual |
Update the name of the device volume specified by aVolume.
aVolume | Device volume for which to update name. |
Definition at line 3237 of file sbBaseDevice.cpp.
|
protected |
Update the names of all device volumes.
Definition at line 3211 of file sbBaseDevice.cpp.
|
protected |
Wait for the end of a request batch to be enqueued.
|
staticprotected |
Static callback for batch end wait timer.
|
protected |
Object instance callback for batch end wait timer.
|
friend |
Definition at line 643 of file sbBaseDevice.h.
|
friend |
Definition at line 106 of file sbBaseDevice.h.
|
friend |
Definition at line 644 of file sbBaseDevice.h.
|
friend |
Definition at line 105 of file sbBaseDevice.h.
|
friend |
Definition at line 646 of file sbBaseDevice.h.
|
friend |
Definition at line 107 of file sbBaseDevice.h.
|
friend |
Definition at line 645 of file sbBaseDevice.h.
|
friend |
Definition at line 843 of file sbBaseDevice.h.
|
friend |
Definition at line 104 of file sbBaseDevice.h.
|
friend |
Definition at line 108 of file sbBaseDevice.h.
static nsRefPtr< sbBaseDeviceMediaListListener > void * sbBaseDevice::aClosure |
Definition at line 441 of file sbBaseDevice.h.
nsRefPtr<sbBaseDeviceMediaListListener>& sbBaseDevice::aData |
Definition at line 441 of file sbBaseDevice.h.
nsRefPtr<sbBaseDeviceMediaListListener> sbBaseDevice::aData |
Definition at line 445 of file sbBaseDevice.h.
|
staticprotected |
Default per track storage overhead. 10000 is enough for one 8K block plus extra media database or filesystem overhead.
Definition at line 747 of file sbBaseDevice.h.
|
staticprotected |
Amount of time in milliseconds to delay presentation of the device setup dialog.
Definition at line 758 of file sbBaseDevice.h.
|
protected |
Definition at line 709 of file sbBaseDevice.h.
|
protected |
Definition at line 710 of file sbBaseDevice.h.
|
protected |
Definition at line 698 of file sbBaseDevice.h.
|
protected |
Definition at line 728 of file sbBaseDevice.h.
|
protected |
Definition at line 727 of file sbBaseDevice.h.
|
protected |
Definition at line 691 of file sbBaseDevice.h.
|
protected |
Definition at line 880 of file sbBaseDevice.h.
|
protected |
Definition at line 729 of file sbBaseDevice.h.
|
protected |
Definition at line 702 of file sbBaseDevice.h.
|
protected |
Definition at line 701 of file sbBaseDevice.h.
|
protected |
Definition at line 717 of file sbBaseDevice.h.
|
protected |
Definition at line 687 of file sbBaseDevice.h.
|
protected |
Definition at line 696 of file sbBaseDevice.h.
|
protected |
Definition at line 697 of file sbBaseDevice.h.
|
protected |
Definition at line 694 of file sbBaseDevice.h.
|
protected |
Definition at line 693 of file sbBaseDevice.h.
|
protected |
Definition at line 692 of file sbBaseDevice.h.
|
protected |
Definition at line 741 of file sbBaseDevice.h.
|
protected |
Definition at line 695 of file sbBaseDevice.h.
|
protected |
Definition at line 700 of file sbBaseDevice.h.
|
protected |
Definition at line 739 of file sbBaseDevice.h.
|
protected |
Definition at line 688 of file sbBaseDevice.h.
|
protected |
Definition at line 699 of file sbBaseDevice.h.
|
protected |
Definition at line 686 of file sbBaseDevice.h.
|
protected |
Definition at line 685 of file sbBaseDevice.h.
|
protected |
Definition at line 879 of file sbBaseDevice.h.
|
protected |
Definition at line 730 of file sbBaseDevice.h.
|
protected |
Definition at line 684 of file sbBaseDevice.h.
|
protected |
Definition at line 683 of file sbBaseDevice.h.
|
protected |
Definition at line 689 of file sbBaseDevice.h.
|
protected |
Definition at line 715 of file sbBaseDevice.h.
|
protected |
Definition at line 833 of file sbBaseDevice.h.
|
protected |
Definition at line 876 of file sbBaseDevice.h.
|
protected |
Definition at line 878 of file sbBaseDevice.h.
|
protected |
Definition at line 874 of file sbBaseDevice.h.
|
protected |
Definition at line 873 of file sbBaseDevice.h.
|
staticprotected |
Percent available space for syncing when building a sync playlist.
Definition at line 752 of file sbBaseDevice.h.