sbBaseDevice Class Referenceabstract

#include <sbBaseDevice.h>

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

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 ()
 
sbDeviceTranscodingGetDeviceTranscoding () const
 
PRLock * StateLock ()
 
PRUint32 GetDeviceState ()
 
sbDeviceImagesGetDeviceImages () 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)
 

Protected Attributes

PRLock * mStateLock
 
PRUint32 mState
 
PRLock * mPreviousStateLock
 
PRUint32 mPreviousState
 
PRInt32 mIgnoreMediaListCount
 
PRUint32 mPerTrackOverhead
 
nsAutoPtr< sbDeviceStatusHelpermStatus
 
nsCOMPtr< sbIDeviceLibrarymDefaultLibrary
 
nsCOMPtr< sbILibrarymMainLibrary
 
nsRefPtr
< sbBaseDeviceLibraryListener
mLibraryListener
 
nsRefPtr
< sbDeviceBaseLibraryCopyListener
mLibraryCopyListener
 
nsDataHashtableMT
< nsISupportsHashKey, nsRefPtr
< sbBaseDeviceMediaListListener > > 
mMediaListListeners
 
nsCOMPtr< sbIDeviceInfoRegistrarmInfoRegistrar
 
PRUint32 mInfoRegistrarType
 
nsCOMPtr< sbIDeviceCapabilitiesmCapabilities
 
PRLock * mPreferenceLock
 
PRUint32 mMusicLimitPercent
 
sbDeviceTranscodingmDeviceTranscoding
 
sbDeviceImagesmDeviceImages
 
PRUint32 mCanTranscodeAudio
 
PRUint32 mCanTranscodeVideo
 
PRUint32 mSyncType
 
bool mEnsureSpaceChecked
 
PRRWLock * mConnectLock
 
PRBool mConnected
 
nsCOMPtr< nsITimer > mDeferredSetupDeviceTimer
 
nsRefPtr
< sbDeviceRequestThreadQueue
mRequestThreadQueue
 
nsClassHashtableMT
< nsIDHashKey, OrganizeData
mOrganizeLibraryPrefs
 
nsClassHashtable
< nsUint32HashKey, nsString > 
mMediaFolderURLTable
 
nsDataHashtableMT
< nsStringHashKey, PRBool > 
mTrackSourceTable
 
PRLock * mVolumeLock
 
nsTArray< nsRefPtr
< sbBaseDeviceVolume > > 
mVolumeList
 
nsInterfaceHashtableMT
< nsStringHashKey,
sbBaseDeviceVolume
mVolumeGUIDTable
 
nsInterfaceHashtableMT
< nsStringHashKey,
sbBaseDeviceVolume
mVolumeLibraryGUIDTable
 
nsRefPtr< sbBaseDeviceVolumemPrimaryVolume
 
nsRefPtr< sbBaseDeviceVolumemDefaultVolume
 
- Protected Attributes inherited from sbBaseDeviceEventTarget
nsCOMArray
< sbIDeviceEventListener
mListeners
 
nsDeque mStates
 
nsCOMPtr< nsIWeakReference > mParentEventTarget
 

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
 

Detailed Description

Base class for implementing a device

Derived classes should

Definition at line 99 of file sbBaseDevice.h.

Member Typedef Documentation

Member Enumeration Documentation

anonymous enum
protected
Enumerator
CAN_TRANSCODE_UNKNOWN 
CAN_TRANSCODE_YES 
CAN_TRANSCODE_NO 

Definition at line 704 of file sbBaseDevice.h.

Constructor & Destructor Documentation

sbBaseDevice::sbBaseDevice ( )

Definition at line 400 of file sbBaseDevice.cpp.

sbBaseDevice::~sbBaseDevice ( )
virtual

Definition at line 469 of file sbBaseDevice.cpp.

Member Function Documentation

nsresult sbBaseDevice::AddLibrary ( sbIDeviceLibrary aDevLib)

Add the library specified by aDevLib to the device content.

Parameters
aDevLibthe device library to add.

Definition at line 1464 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::AddMediaLists ( sbILibrary aLibrary,
nsIArray *  aMediaLists 
)
protected

This adds teh media lists to the given library

Parameters
aLibraryThe library the media lists are to be added
aMediaListsThe list of media lists to be added

Definition at line 4781 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::AddVolume ( sbBaseDeviceVolume aVolume)
protected

Add the media volume specified by aVolume to the set of device media volumes.

Parameters
aVolumeVolume to add.

Definition at line 2566 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettings ( class nsIDOMDocument *  aDeviceSettingsDocument)
protectedvirtual

Apply the contents of the device settings document specified by aDeviceSettingsDocument to the device settings.

Parameters
aDeviceSettingsDocumentDevice settings document.

Definition at line 2804 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettingsDeviceInfo ( class nsIDOMDocument *  aDeviceSettingsDocument)
protected

Apply the device info content of the device settings document specified by aDeviceSettingsDocument.

Parameters
aDeviceSettingsDocumentDevice settings document.

Definition at line 2897 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettingsDocument ( )
protectedvirtual

Apply the contents of the device settings document to the device settings.

Definition at line 2781 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettingsToCapabilities ( class nsIDOMDocument *  aDeviceSettingsDocument)
protected

Apply the contents of the device settings document specified by aDeviceSettingsDocument to the device capabilities.

Parameters
aDeviceSettingsDocumentDevice settings document.

Definition at line 3000 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettingsToProperty ( class nsIDOMDocument *  aDeviceSettingsDocument,
const nsAString &  aPropertyName 
)
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.

Parameters
aDeviceSettingsDocumentDevice settings document.
aPropertyNameName of device property to which to apply.

Definition at line 2831 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::ApplyDeviceSettingsToProperty ( const nsAString &  aPropertyName,
nsIVariant *  aPropertyValue 
)
protectedvirtual

Apply the device settings property value specified by aPropertyValue to the device property specified by aPropertyName.

Parameters
aPropertyNameName of device property to which to apply.
aPropertyValueDevice settings property value.

Definition at line 2888 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::ApplyLibraryOrganizePreference ( sbIDeviceLibrary aLibrary,
const nsAString &  aLibraryPrefName,
const nsAString &  aLibraryPrefBase,
nsIVariant *  aPrefValue 
)
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.

See Also
ApplyLibraryPreference
Parameters
aLibraryLibrary for which to apply preference.
aLibraryPrefNameLibrary preference name.
aLibraryPrefBase[optional] Library preference base.
aPrefValueLibrary preference value.

Definition at line 3678 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::ApplyLibraryPreference ( sbIDeviceLibrary aLibrary,
const nsAString &  aLibraryPrefName,
nsIVariant *  aPrefValue 
)
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.

Parameters
aLibraryLibrary for which to apply preference.
aLibraryPrefNameLibrary preference name.
aPrefValueLibrary preference value.

Definition at line 3630 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::ApplyPreference ( const nsAString &  aPrefName,
nsIVariant *  aPrefValue 
)
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.

Parameters
aPrefNameName of preference to apply.
aPrefValueValue of preference.

Definition at line 3516 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 ( )

Definition at line 2310 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::ChangeState ( PRUint32  aState)
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.

nsresult sbBaseDevice::CheckAccess ( sbIDeviceLibrary aDevLib)
virtual

Check the library access (read-only vs. read-write) of the device library specified by aDevLib and prompt the user if needed.

Parameters
aDevLibthe device library to check.

Definition at line 1532 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

nsresult sbBaseDevice::CopyChangedMediaItemsToMediaList ( sbILibraryChange aChange,
sbIMediaList aMediaList 
)
protected

Copies media items to a media list for a media list change.

Parameters
aChangethe change to get the items from
aMediaListthe list to copy to

Definition at line 6571 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aTypeType of event.
aDataEvent data.
aAsyncIf 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

Parameters
aTypetype of event
aDataevent data
aAsyncif true, dispatch asynchronously
aTargetevent target

Definition at line 2043 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

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.

Parameters
aIdthe ID for the library
aLibraryLocationthe file to name the library, or null to use some default
Returns
the library created (or re-used if it exists)

Definition at line 1349 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::CreateTransferRequest ( PRUint32  aRequestType,
nsIPropertyBag2 *  aRequestParameters,
TransferRequest **  aTransferRequest 
)

Definition at line 1981 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aFileURIFirst file URI to try creating.
aUniqueFileReturned unique file object.
aUniqueFileURIReturned URI of unique file.

Definition at line 2139 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void sbBaseDevice::DeferredSetupDevice ( nsITimer *  aTimer,
void *  aClosure 
)
staticprotected

Callback functions for deferring the presentation of the initial device setup dialog.

Definition at line 5478 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::DeferredSetupDevice ( )
protected

Definition at line 5487 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

NS_IMETHODIMP sbBaseDevice::Disconnect ( )

Definition at line 511 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::DispatchTranscodeErrorEvent ( sbIMediaItem aMediaItem,
const nsAString &  aErrorMessage 
)
protected

Dispatch a transcode error event for the media item specified by aMediaItem with the error message specified by aErrorMessage.

Parameters
aMediaItemThe media item for which to dispatch an error event.
aErrorMessageError event message.

Definition at line 6084 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aRequestRequest for which to download item.
aDeviceStatusHelperHelper to use to update device status.

Definition at line 758 of file sbBaseDevice.cpp.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::EnsureSpaceForSync ( sbILibraryChangeset aChangeset,
PRBool *  aCapacityExceeded,
PRBool *  aAbort 
)
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.

Parameters
aChangesetThe change set to check for space
aCapacityExceededReturns whether the capacity was exceeded
aAbortAbort sync if true.
nsresult sbBaseDevice::EnsureSpaceForWrite ( sbILibraryChangeset aChangeset,
sbIDeviceLibrary aDevLibrary 
)
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.

Parameters
aChangesetThe changest to ensure space for. The changes within the changeset may be modified on return.
aDevLibraryThe device library representing the device for whom the changeset was generated.

Definition at line 2362 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::ExportToDevice ( sbIDeviceLibrary aDevLibrary,
sbILibraryChangeset aChangeset 
)

Definition at line 4894 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void sbBaseDevice::FinalizeDeviceLibrary ( sbIDeviceLibrary aDevLib)

Finalize a library for the device

Parameters
aDevLibthe 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.

nsresult sbBaseDevice::GenerateFilename ( sbIMediaItem aItem,
nsACString &  aFilename 
)
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.

Parameters
aItemThe item we're generating a filename for
aFilenameThe 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.

nsresult sbBaseDevice::GetCapabilitiesPreference ( nsIVariant **  aCapabilities)
protected

Return in aCapabilities the device capabilities preference. Return a void variant if no device capabilities preference has been set.

Parameters
aCapabilitiesReturned device capabilities preference.

Definition at line 3838 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt64 sbBaseDevice::GetChangeSize ( sbIDeviceLibrary aDestLibrary,
sbILibraryChange aChange 
)
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

Parameters
aDestLibraryThe destination library for the change
aChangeThe change item to use

Definition at line 4499 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::GetDefaultLibrary ( sbIDeviceLibrary **  aDefaultLibrary)

Definition at line 5951 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

sbDeviceImages* sbBaseDevice::GetDeviceImages ( ) const
inline

Definition at line 638 of file sbBaseDevice.h.

nsresult sbBaseDevice::GetDeviceSettingsDocument ( class nsIDOMDocument **  aDeviceSettingsDocument)
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.

Parameters
aDeviceSettingsDocumentReturned device settings document object.

Definition at line 2691 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetDeviceSettingsDocument ( nsIFile *  aDeviceSettingsFile,
class nsIDOMDocument **  aDeviceSettingsDocument 
)
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.

Parameters
aDeviceSettingsFileFile containing device settings.
aDeviceSettingsDocumentReturned device settings document object.

Definition at line 2701 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::GetDeviceSettingsDocument ( nsTArray< PRUint8 > &  aDeviceSettingsContent,
class nsIDOMDocument **  aDeviceSettingsDocument 
)
protected

Return in aDeviceSettingsDocument the device settings contained in aDeviceSettingsContent.

Parameters
aDeviceSettingsContentDevice settings content.
aDeviceSettingsDocumentReturned device settings document object.

Definition at line 2758 of file sbBaseDevice.cpp.

PRUint32 sbBaseDevice::GetDeviceState ( )
inline

Return the state without locking. This is for use in conjunction with StateLock

Definition at line 634 of file sbBaseDevice.h.

sbDeviceTranscoding* sbBaseDevice::GetDeviceTranscoding ( ) const
inline

Definition at line 619 of file sbBaseDevice.h.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetDeviceTranscodingProperty ( PRUint32  aTranscodeType,
const nsAString &  aPropertyName,
nsIVariant **  aPropertyValue 
)
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.

Parameters
aTranscodeTypeType of transcode. E.g., sbITranscodeProfile::TRANSCODE_TYPE_AUDIO.
aPropertyNameName of property.
aPropertyValueReturned property value.

Definition at line 6023 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetDeviceWriteDestURI ( sbIMediaItem aWriteDstItem,
nsIURI *  aContentSrcBaseURI,
nsIURI *  aWriteSrcURI,
nsIURI **  aDestinationURI 
)
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.

Note
The URI is not suitable for inserting into contentSrc directly; it needs to go through sbILibraryUtils::getContentURI

Definition at line 5235 of file sbBaseDevice.cpp.

Here is the call graph for this function:

bool sbBaseDevice::GetEnsureSpaceChecked ( ) const
inline

Returns true if the space has been checked.

Definition at line 594 of file sbBaseDevice.h.

nsresult sbBaseDevice::GetExcludedFolders ( nsTArray< nsString > &  aExcludedFolders)
protected

Definition at line 6462 of file sbBaseDevice.cpp.

Here is the call graph for this function:

static nsresult sbBaseDevice::GetImportSettings ( sbIDeviceLibrary aDevLibrary,
PRBool *  aImportAudio,
PRBool *  aImportVideo 
)
staticprotected

Returns boolean flags for whether we should import audio and/or video

Parameters
aSettingsA sync settings object
aImportAudioReturns whether audio should be imported
aImportVideoReturns 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.

PRBool sbBaseDevice::GetIsLibraryPreference ( const nsAString &  aPrefName)
protected

Return true if the preference specified by aPrefName is a library preference.

Parameters
aPrefNameName of preference.
Returns
True if preference is a library preference.

Definition at line 3549 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetItemContentType ( sbIMediaItem aMediaItem,
PRUint32 *  aContentType 
)
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.

Parameters
aMediaItemMedia item for which to get content type.
aContentTypeReturned content type.

Definition at line 1910 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetLibraryPreference ( sbIDeviceLibrary aLibrary,
const nsAString &  aLibraryPrefName,
nsIVariant **  aPrefValue 
)
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.

Parameters
aLibraryLibrary for which to get preference.
aLibraryPrefNameLibrary preference name to get.
aPrefValueReturned preference value.

Definition at line 3600 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetLibraryPreference ( const nsAString &  aLibraryPrefBase,
const nsAString &  aLibraryPrefName,
nsIVariant **  aPrefValue 
)
protected

Return in aPrefValue the value of the library preference specified by the library preference base aLibraryPrefBase and library preference name aLibraryPrefName.

Parameters
aLibraryPrefBaseLibrary preference base.
aLibraryPrefNameLibrary preference name.
aPrefValueReturned preference value.

Definition at line 3618 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetLibraryPreferenceBase ( sbIDeviceLibrary aLibrary,
nsAString &  aPrefBase 
)
protected

Return in aPrefBase the library preference base for the library specified by aLibrary.

Parameters
aLibraryLibrary for which to get preference base.
aPrefBaseReturned library preference base.

Definition at line 3815 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetLibraryPreferenceName ( const nsAString &  aPrefName,
nsAString &  aLibraryPrefName 
)
protected

Return in aLibraryPrefName the library preference name for the preference with the device preference name aPrefName.

Parameters
aPrefNameDevice preference name.
aLibraryPrefNameReturned library preference name.

Definition at line 3787 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetLibraryPreferenceName ( const nsAString &  aPrefName,
const nsAString &  aLibraryPrefBase,
nsAString &  aLibraryPrefName 
)
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.

Parameters
aPrefNameDevice preference name.
aLibraryPrefBaseLibrary preference base.
aLibraryPrefNameReturned library preference name.

Definition at line 3801 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::GetLocalDeviceDir ( nsIFile **  aLocalDeviceDir)
protected

Return in aLocalDeviceDir the local directory in which to store device related files (e.g., device settings file backups).

Parameters
aLocalDeviceDirRetured local device file directory.

Definition at line 3875 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::GetMusicAvailableSpace ( sbILibrary aLibrary,
PRInt64 *  aMusicAvailableSpace 
)
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.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetMusicFreeSpace ( sbILibrary aLibrary,
PRInt64 *  aFreeMusicSpace 
)
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.

Parameters
aLibraryLibrary for which to get space.
aFreeMusicSpaceReturned free music space.

Definition at line 2461 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetMusicLimitSpacePercent ( const nsAString &  aPrefBase,
PRUint32 *  aOutLimitPercentage 
)
protected

Return the current limited music space as a percentage that the device's pref is currently set to.

Parameters
aPrefBaseThe device preference root.
aOutLimitPercentageThe 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.

Here is the call graph for this function:

nsresult sbBaseDevice::GetNameBase ( nsAString &  aName)
protected

Base implementation for the device name.

Parameters
aNamethe returned name

Definition at line 6329 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetPrefBranch ( nsIPrefBranch **  aPrefBranch)
protected

Definition at line 3480 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetPrefBranch ( sbIDeviceLibrary aLibrary,
nsIPrefBranch **  aPrefBranch 
)
protected

Definition at line 3493 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetPrefBranch ( const char *  aPrefBranchName,
nsIPrefBranch **  aPrefBranch 
)
protected

Definition at line 3410 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetPrefBranchRoot ( nsACString &  aRoot)
protected

Definition at line 3458 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::GetPreference ( const nsAString &  aPrefName,
nsIVariant **  _retval 
)

Definition at line 983 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetPreferenceInternal ( nsIPrefBranch aPrefBranch,
const nsAString &  aPrefName,
nsIVariant **  _retval 
)
protected

Definition at line 918 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetPreferenceLibrary ( const nsAString &  aPrefName,
sbIDeviceLibrary **  aLibrary,
nsAString &  aLibraryPrefBase 
)
protected

Return in aLibrary, if not null, the library corresponding to the library preference specified by aPrefName. Return the library pref base in aLibraryPrefBase.

Parameters
aPrefNameName of library preference.
aLibraryOptionally returned preference library.
aLibraryPrefBaseLibrary preference base.
Returns
NS_ERROR_NOT_AVAILABLE Preference is not a library preference or library is not available.

Definition at line 3555 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

nsresult sbBaseDevice::GetProductNameBase ( char const *  aDefaultModelNumberString,
nsAString &  aProductName 
)
protected

Base implementation for the product name

Parameters
aDefaultModelNumberStringThe localized string name for the default model number
aProductStringthe localized sttring name for the product name
aProductNameThe returned product name

Definition at line 6366 of file sbBaseDevice.cpp.

Here is the call graph for this function:

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.

Parameters
aRequestRequest for which to get temporary file factory.
aTemporaryFileFactoryReturned temporary file factory for request.

Definition at line 614 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetShouldLimitMusicSpace ( const nsAString &  aPrefBase,
PRBool *  aOutShouldLimitSpace 
)
protected

Returns if the device pref to enable music space limiting is turned on.

Parameters
aPrefBaseThe device preference root.
aOutShouldLimitSpaceThe 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.

Here is the call graph for this function:

NS_IMETHODIMP sbBaseDevice::GetState ( PRUint32 *  aState)

Definition at line 1291 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::GetSupportedAlbumArtFormats ( nsIArray **  aFormats)
protected

Definition at line 6159 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::GetSupportedTranscodeProfiles ( PRUint32  aType,
nsIArray **  aSupportedProfiles 
)
protectedvirtual

Returns a list of transcode profiles that the device supports

Parameters
aTypethe type of transcode profiles to retrieve.
aSupportedProfilesthe list of profiles that were found
Returns
NS_OK if successful else some NS_ERROR value

Definition at line 6014 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::GetSupportsReformat ( PRBool *  _retval)

Definition at line 6309 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::GetVolumeForItem ( sbIMediaItem aItem,
sbBaseDeviceVolume **  aVolume 
)
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.

Parameters
aItemMedia item for which to get volume.
aVolumeReturned media volume.
Returns
NS_ERROR_NOT_AVAILABLE Media item does not belong to a volume.

Definition at line 2650 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::GetWarningDialogEnabled ( const nsAString &  aWarning,
PRBool *  _retval 
)

Definition at line 3353 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::HandleSyncCompletedRequest ( TransferRequest aRequest)
protected

Handle the sync-completed request, updating the last-sync timestamp.

Parameters
aRequestRequest data record.

Definition at line 4100 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::HandleSyncRequest ( TransferRequest aRequest)
protected

Handle the sync request specified by aRequest.

Parameters
aRequestRequest data record.

Definition at line 3989 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::HasPreference ( nsAString &  aPrefName,
PRBool *  aHasPreference 
)

Return true in aHasPreference if the device has the preference specified by aHasPreference.

Parameters
aPrefNameThe preference to check. Returned true if device has preference.

Definition at line 1184 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::IgnoreMediaItem ( sbIMediaItem aItem)

Ignores events for the given media item

Definition at line 1880 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::IgnoreWatchFolderPath ( nsIURI *  aURI,
sbAutoIgnoreWatchFolderPath **  aIgnorePath 
)
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.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::Init ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual nsresult sbBaseDevice::InitDevice ( )
inlineprotectedvirtual

This allows the derived classes to be initialized if needed

Reimplemented in sbCDDevice.

Definition at line 655 of file sbBaseDevice.h.

Here is the caller graph for this function:

nsresult sbBaseDevice::InitializeDeviceLibrary ( sbDeviceLibrary aDevLib,
const nsAString &  aId,
nsIURI *  aLibraryLocation 
)

Initialize a library for the device. The library must be finalized by calling FinalizeDeviceLibrary.

Parameters
aDevLibthe device library to initialize.
aIdthe ID for the library
aLibraryLocationthe file to name the library, or null to use some default

Definition at line 1368 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::InitializeDeviceLibraryPreferences ( sbDeviceLibrary aDevLib)

Initialize the preferences for the device library specified by aDevLib.

Parameters
aDevLibthe 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.

Here is the call graph for this function:

nsresult sbBaseDevice::InitializeProperties ( )
protectedvirtual

Initialize the device properties.

Reimplemented in sbIPDDevice.

Definition at line 3030 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

PRBool sbBaseDevice::IsRequestAborted ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::ListenToList ( sbIMediaList aList)

Called when a media list has been added to the device library

Parameters
aListthe media list to listen for modifications

Definition at line 1749 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::ListenToMediaLists ( sbILibrary aLibrary)
protected

This hooks up media list listeners for playlists in the given library this is generally called after a mount is finished.

Parameters
aLibrarythe library containing the playlists to listen to

Definition at line 5429 of file sbBaseDevice.cpp.

void sbBaseDevice::LogDeviceFolders ( )
protected

Log the list of device folders.

Definition at line 6485 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

PLDHashOperator sbBaseDevice::LogDeviceFoldersEnum ( const unsigned int &  aKey,
nsString *  aData,
void *  aUserArg 
)
staticprotected

Enumerator function for logging the list of device folders.

Definition at line 6494 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

static sbBaseDevice::NS_HIDDEN_ ( PLDHashOperator  )
static
static sbBaseDevice::NS_HIDDEN_ ( PLDHashOperator  )
static
nsresult sbBaseDevice::OnDefaultLibraryChanged ( )
virtual

Handle a change to the default library.

Definition at line 1740 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::OpenInputStream ( nsIURI *  aURI,
nsIInputStream **  retval 
)

Definition at line 3404 of file sbBaseDevice.cpp.

virtual nsresult sbBaseDevice::ProcessBatch ( Batch aBatch)
pure virtual

Process this batch of requests

Implemented in sbMockDevice.

nsresult sbBaseDevice::ProcessInfoRegistrars ( )
protected

Process the info registrars to find out which ones are interested in us.

Definition at line 5514 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::PromptForEjectDuringPlayback ( PRBool *  aEject)
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.

Parameters
aEject[out, retval] Should the device be ejected?

Definition at line 5159 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

nsresult sbBaseDevice::RegenerateMediaURL ( sbIMediaItem aItem,
nsIURI **  _retval 
)

Regenerate the Media URL when the media management service is enabled.

Note
This method will regenerate the content URL for the Media Item.

Definition at line 2225 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::RegisterDeviceCapabilities ( sbIDeviceCapabilities aCapabilities)
protected

Calls any registered device capabilities augmenter.

Parameters
aCapabilitiesCapabilities 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.

Here is the call graph for this function:

nsresult sbBaseDevice::RegisterDeviceInfo ( )
protected

Calls the device info registrars to register the device info.

Definition at line 5579 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::RemoveLibrary ( sbIDeviceLibrary aDevLib)

Remove the library specified by aDevLib from the device content.

Parameters
aDevLibthe device library to remove.

Definition at line 1638 of file sbBaseDevice.cpp.

Here is the call graph for this function:

PLDHashOperator sbBaseDevice::RemoveLibraryEnumerator ( nsISupports aList,
nsCOMPtr< nsIMutableArray > &  aItems,
void *  aUserArg 
)
staticprotected

Hashtable enumerator function that removes the items from the list

Definition at line 6530 of file sbBaseDevice.cpp.

template<class T >
nsresult sbBaseDevice::RemoveLibraryItems ( iter,
end 
)
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.

Parameters
iterStarting point of the requests
endTypical iteration end point (1 past the last item)

Definition at line 1539 of file sbBaseDevice.h.

Here is the call graph for this function:

nsresult sbBaseDevice::RemoveVolume ( sbBaseDeviceVolume aVolume)
protected

Remove the media volume specified by aVolume from the set of device media volumes.

Parameters
aVolumeVolume to remove.

Definition at line 2603 of file sbBaseDevice.cpp.

Here is the call graph for this function:

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  )

Definition at line 3385 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SendSyncCompleteRequest ( )
protected

Send a sync-completed request to be handled by the device.

Definition at line 3957 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::SetDefaultLibrary ( sbIDeviceLibrary aDefaultLibrary)

Definition at line 5959 of file sbBaseDevice.cpp.

Here is the call graph for this function:

void sbBaseDevice::SetEnsureSpaceChecked ( bool  aChecked)
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

Parameters
aIgnoreListenerIgnore flag value.

Definition at line 1859 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::SetIgnoreMediaListListeners ( PRBool  aIgnoreListener)

Set the ignore flag on all media list listeners registered for the library for this device.

Parameters
aIgnoreListenerIgnore flag value.

Definition at line 1844 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

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.

Parameters
aLibraryThe library containing the media lists you wish to hide.
aHiddenTrue 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.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aPrefBranchThe branch to set preferences on.
aPrefNameName of the preference to set.
aPrefValueValue to set preference.
aHasChangedTrue if preference value changed.

Definition at line 1060 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::SetPreferenceInternal ( nsIPrefBranch aPrefBranch,
const nsAString &  aPrefName,
nsIVariant *  aPrefValue 
)
protected

Definition at line 1017 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SetPreferenceInternalNoNotify ( const nsAString &  aPrefName,
nsIVariant *  aPrefValue,
PRBool *  aPrefChanged 
)
protected

Definition at line 1047 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SetPreviousState ( PRUint32  aState)

Set the device's previous state

Parameters
aStatenew device state

Definition at line 1279 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::SetState ( PRUint32  aState)

Definition at line 1301 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::SetupDevice ( )
protected

Present the user with a dialog for the initial device setup.

Definition at line 5447 of file sbBaseDevice.cpp.

Here is the call graph for this function:

NS_IMETHODIMP sbBaseDevice::SetWarningDialogEnabled ( const nsAString &  aWarning,
PRBool  aEnabled 
)

Definition at line 3331 of file sbBaseDevice.cpp.

Here is the call graph for this function:

PRLock* sbBaseDevice::StateLock ( )
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.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP sbBaseDevice::SupportsMediaItem ( sbIMediaItem aMediaItem,
sbIDeviceSupportsItemCallback aCallback 
)

Definition at line 5700 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::SupportsMediaItem ( sbIMediaItem aMediaItem,
sbDeviceSupportsItemHelper aCallback,
PRBool  aReportErrors,
PRBool *  _retval 
)
protected

Internal version of SupportsMediaItem.

Parameters
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.

Exceptions
NS_ERROR_IN_PROGRESSif the result will be asynchronously supplied via the callback.

Definition at line 5731 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SupportsMediaItemDRM ( sbIMediaItem aMediaItem,
PRBool  aReportErrors,
PRBool *  _retval 
)
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.

Parameters
aMediaItemMedia item to check.
aReportErrorsIf true, report device errors.
_retvalReturned true if DRM is supported.

Definition at line 2539 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::SyncCreateAndSyncToList ( sbILibrary aSrcLib,
sbIDeviceLibrary aDstLib,
PRInt64  aAvailableSpace 
)
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.

Parameters
aSrcLibSource library from which to sync.
aDstLibDestination library to which to sync.
aAvailableSpaceSpace available for sync.
Returns
NS_OK if successful. NS_ERROR_ABORT if user aborts syncing. else some other NS_ERROR value.

Definition at line 4163 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::SyncCreateSyncMediaList ( sbILibrary aSrcLib,
sbIDeviceLibrary aDstLib,
PRInt64  aAvailableSpace,
sbIMediaList **  aSyncMediaList 
)
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.

Parameters
aSrcLibSource library of sync.
aDstLibDestination library to which to sync.
aAvailableSpaceSpace available for sync.
aSyncMediaListCreated sync media list.
Returns
NS_OK if successful. NS_ERROR_ABORT if user aborts syncing. else some other NS_ERROR value.

Definition at line 4223 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SyncGetSyncAvailableSpace ( sbILibrary aLibrary,
PRInt64 *  aAvailableSpace 
)
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.

Parameters
aLibrarySync destination library.
aAvailableSpaceSpace available for sync.

Definition at line 4610 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::SyncGetSyncItemSizes ( sbIDeviceLibrary aDestLibrary,
sbILibraryChangeset aChangeset,
PRInt64  aAvailableSpace,
PRUint32 &  aLastChangeThatFit,
PRInt64 &  aTotalSyncSize 
)
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.

Parameters
aDstLibSync destination library.
aChangesetList of items from which to sync.
aAvailableSpaceThe available space on the device in bytes
aLastChangeThatFitIndex of the last item that fits in available space
aTotalSyncSizeTotal size of all sync items.

Definition at line 4554 of file sbBaseDevice.cpp.

Here is the call graph for this function:

NS_IMETHODIMP sbBaseDevice::SyncLibraries ( void  )

Definition at line 549 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::SyncMainLibraryFlag ( sbIMediaItem aMediaItem)
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.

Parameters
aMediaItemMedia item to check.

Definition at line 5105 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::SyncProduceChangeset ( TransferRequest aRequest,
sbILibraryChangeset **  aExportChangeset,
sbILibraryChangeset **  aImportChangeset 
)
protected

Produce the sync change set for the sync request specified by aRequest and return the change set in aChangeset.

Parameters
aRequestSync request data record.
aSyncChangesetSync request change set.
aImportChangesetChanges for the import operation

Definition at line 4707 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::SyncToMediaList ( sbIDeviceLibrary aDstLib,
sbIMediaList aMediaList 
)
protected

Configure the destination library specified by aDstLib to sync to the media list specified by aMediaList.

Parameters
aDstLibDestination sync library.
aMediaListMedia 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.

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateDefaultLibrary ( sbIDeviceLibrary aDevLib)

Update the default library to the library specified by aDevLib.

Parameters
aDevLibthe device library to which to update the default library.

Definition at line 1713 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aLibraryLibrary to update.
aPropertyIDID of property to update.
aPropertyValueProperty value to which to update.

Definition at line 1691 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateMediaFolders ( )
protectedvirtual

Update locations of folders containing media.

Definition at line 5228 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::UpdateMediaLists ( nsIArray *  aMediaLists)
protected

This updates a collection of media lists.

Parameters
aMediaListsThe list of media lists to be updated

Definition at line 4841 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
aRequestRequest for which to update media item.
aURINew content source URI.

Definition at line 1943 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateProperties ( )
protectedvirtual

Update the device properties.

Definition at line 3041 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateProperty ( const nsAString &  aName)
protectedvirtual

Update the device property specified by aName.

Parameters
aNameName of property to update.

Definition at line 3065 of file sbBaseDevice.cpp.

nsresult sbBaseDevice::UpdateStatisticsProperties ( )
protectedvirtual

Update the device statistics properties.

Definition at line 3076 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateStreamingItemSupported ( Batch aBatch)
protected

Update the destination compatibility for the streaming items in the batch.

Parameters
aBatchThe batch to be updated.

Definition at line 5870 of file sbBaseDevice.cpp.

Here is the call graph for this function:

nsresult sbBaseDevice::UpdateVolumeName ( sbBaseDeviceVolume aVolume)
protectedvirtual

Update the name of the device volume specified by aVolume.

Parameters
aVolumeDevice volume for which to update name.

Definition at line 3237 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::UpdateVolumeNames ( )
protected

Update the names of all device volumes.

Definition at line 3211 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseDevice::WaitForBatchEnd ( )
protected

Wait for the end of a request batch to be enqueued.

static void sbBaseDevice::WaitForBatchEndCallback ( nsITimer *  aTimer,
void *  aClosure 
)
staticprotected

Static callback for batch end wait timer.

void sbBaseDevice::WaitForBatchEndCallback ( )
protected

Object instance callback for batch end wait timer.

Friends And Related Function Documentation

friend class sbBaseDeviceInitHelper
friend

Definition at line 643 of file sbBaseDevice.h.

friend class sbBaseDeviceVolume
friend

Definition at line 106 of file sbBaseDevice.h.

friend class sbDeviceEnsureSpaceForWrite
friend

Definition at line 644 of file sbBaseDevice.h.

friend class sbDeviceImages
friend

Definition at line 105 of file sbBaseDevice.h.

friend class sbDeviceReqAddedEvent
friend

Definition at line 646 of file sbBaseDevice.h.

friend class sbDeviceRequestThreadQueue
friend

Definition at line 107 of file sbBaseDevice.h.

friend class sbDeviceStatistics
friend

Definition at line 645 of file sbBaseDevice.h.

friend class sbDeviceSupportsItemHelper
friend

Definition at line 843 of file sbBaseDevice.h.

friend class sbDeviceTranscoding
friend

Definition at line 104 of file sbBaseDevice.h.

friend class sbDevieEnsureSpaceForWrite
friend

Definition at line 108 of file sbBaseDevice.h.

Member Data Documentation

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.

const PRUint32 sbBaseDevice::DEFAULT_PER_TRACK_OVERHEAD = 10000
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.

const PRUint32 sbBaseDevice::DEFER_DEVICE_SETUP_DELAY = 2000
staticprotected

Amount of time in milliseconds to delay presentation of the device setup dialog.

Definition at line 758 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mCanTranscodeAudio
protected

Definition at line 709 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mCanTranscodeVideo
protected

Definition at line 710 of file sbBaseDevice.h.

nsCOMPtr<sbIDeviceCapabilities> sbBaseDevice::mCapabilities
protected

Definition at line 698 of file sbBaseDevice.h.

PRBool sbBaseDevice::mConnected
protected

Definition at line 728 of file sbBaseDevice.h.

PRRWLock* sbBaseDevice::mConnectLock
protected

Definition at line 727 of file sbBaseDevice.h.

nsCOMPtr<sbIDeviceLibrary> sbBaseDevice::mDefaultLibrary
protected

Definition at line 691 of file sbBaseDevice.h.

nsRefPtr<sbBaseDeviceVolume> sbBaseDevice::mDefaultVolume
protected

Definition at line 880 of file sbBaseDevice.h.

nsCOMPtr<nsITimer> sbBaseDevice::mDeferredSetupDeviceTimer
protected

Definition at line 729 of file sbBaseDevice.h.

sbDeviceImages* sbBaseDevice::mDeviceImages
protected

Definition at line 702 of file sbBaseDevice.h.

sbDeviceTranscoding* sbBaseDevice::mDeviceTranscoding
protected

Definition at line 701 of file sbBaseDevice.h.

bool sbBaseDevice::mEnsureSpaceChecked
protected

Definition at line 717 of file sbBaseDevice.h.

PRInt32 sbBaseDevice::mIgnoreMediaListCount
protected

Definition at line 687 of file sbBaseDevice.h.

nsCOMPtr<sbIDeviceInfoRegistrar> sbBaseDevice::mInfoRegistrar
protected

Definition at line 696 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mInfoRegistrarType
protected

Definition at line 697 of file sbBaseDevice.h.

nsRefPtr<sbDeviceBaseLibraryCopyListener> sbBaseDevice::mLibraryCopyListener
protected

Definition at line 694 of file sbBaseDevice.h.

nsRefPtr<sbBaseDeviceLibraryListener> sbBaseDevice::mLibraryListener
protected

Definition at line 693 of file sbBaseDevice.h.

nsCOMPtr<sbILibrary> sbBaseDevice::mMainLibrary
protected

Definition at line 692 of file sbBaseDevice.h.

nsClassHashtable<nsUint32HashKey, nsString> sbBaseDevice::mMediaFolderURLTable
protected

Definition at line 741 of file sbBaseDevice.h.

nsDataHashtableMT<nsISupportsHashKey, nsRefPtr<sbBaseDeviceMediaListListener> > sbBaseDevice::mMediaListListeners
protected

Definition at line 695 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mMusicLimitPercent
protected

Definition at line 700 of file sbBaseDevice.h.

nsClassHashtableMT<nsIDHashKey, OrganizeData> sbBaseDevice::mOrganizeLibraryPrefs
protected

Definition at line 739 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mPerTrackOverhead
protected

Definition at line 688 of file sbBaseDevice.h.

PRLock* sbBaseDevice::mPreferenceLock
protected

Definition at line 699 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mPreviousState
protected

Definition at line 686 of file sbBaseDevice.h.

PRLock* sbBaseDevice::mPreviousStateLock
protected

Definition at line 685 of file sbBaseDevice.h.

nsRefPtr<sbBaseDeviceVolume> sbBaseDevice::mPrimaryVolume
protected

Definition at line 879 of file sbBaseDevice.h.

nsRefPtr<sbDeviceRequestThreadQueue> sbBaseDevice::mRequestThreadQueue
protected

Definition at line 730 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mState
protected

Definition at line 684 of file sbBaseDevice.h.

PRLock* sbBaseDevice::mStateLock
protected

Definition at line 683 of file sbBaseDevice.h.

nsAutoPtr<sbDeviceStatusHelper> sbBaseDevice::mStatus
protected

Definition at line 689 of file sbBaseDevice.h.

PRUint32 sbBaseDevice::mSyncType
protected

Definition at line 715 of file sbBaseDevice.h.

nsDataHashtableMT<nsStringHashKey, PRBool> sbBaseDevice::mTrackSourceTable
protected

Definition at line 833 of file sbBaseDevice.h.

nsInterfaceHashtableMT<nsStringHashKey, sbBaseDeviceVolume> sbBaseDevice::mVolumeGUIDTable
protected

Definition at line 876 of file sbBaseDevice.h.

nsInterfaceHashtableMT<nsStringHashKey, sbBaseDeviceVolume> sbBaseDevice::mVolumeLibraryGUIDTable
protected

Definition at line 878 of file sbBaseDevice.h.

nsTArray< nsRefPtr<sbBaseDeviceVolume> > sbBaseDevice::mVolumeList
protected

Definition at line 874 of file sbBaseDevice.h.

PRLock* sbBaseDevice::mVolumeLock
protected

Definition at line 873 of file sbBaseDevice.h.

const PRUint32 sbBaseDevice::SYNC_PLAYLIST_AVAILABLE_PCT = 95
staticprotected

Percent available space for syncing when building a sync playlist.

Definition at line 752 of file sbBaseDevice.h.


The documentation for this class was generated from the following files: