26 #ifndef __SBDEVICEUTILS__H__
27 #define __SBDEVICEUTILS__H__
31 #include <nsIMutableArray.h>
32 #include <nsStringGlue.h>
35 #include <sbIMediaListListener.h>
36 #include <sbITranscodingConfigurator.h>
39 #include "sbIDeviceStatus.h"
43 class nsIMutableArray;
98 const nsAString& aPropertyId,
99 const nsAString& aPropertyValue,
101 PRInt32 *aAbortFlag = nsnull);
110 nsAString
const & aProperty,
111 nsAString
const &
aValue);
138 const nsCString& aSpec,
161 const nsAString& aDevicePersistentId,
176 const nsAString& aDevicePersistentId,
190 PRUint64* aWriteLength);
209 PRInt64 aSpaceNeeded,
210 PRInt64 aSpaceAvailable,
258 PRUint32 & aSampleRate);
267 PRUint32 & aSampleRate,
268 PRUint32 & aChannels,
269 PRUint32 & aBitRate);
284 (
const nsAString& aURL,
292 (
const nsAString& aMimeType,
293 const PRUint32 aContentType,
294 nsTArray<sbExtensionToContentFormatEntry_t>& aFormatTypeList);
305 const nsAString& aCodec,
306 nsAString& aMimeType);
320 PRUint32 & aSampleRate,
322 bool & aNeedsTranscoding);
336 bool & aNeedsTranscoding);
352 nsIArray ** aProfiles);
359 nsIArray *aPropertyArray,
360 nsString aPrefNameBase);
365 nsCString &aExtension);
371 nsCString &aContainer,
373 nsCString &aVideoType,
374 nsCString &aAudioType);
378 PRUint32 aTranscodeType,
399 PRUint32 *aContentType,
400 PRUint32 *aFunctionType);
410 PRUint32 *aContentType,
411 PRUint32 *aFunctionType);
431 PRUint16 aListContentType);
444 PRUint32 aContentType,
445 nsTArray<nsString>& aFileExtensionList);
469 PRUint32 & aMgmtType);
488 nsID
const * aDeviceID,
522 PRLogModuleInfo *aLogModule);
551 PRUint32 aListenerType =
ALL) :
554 mListenerType(aListenerType),
577 PRUint32 mListenerType;
static nsresult GetTranscodeProfiles(PRUint32 aType, nsIArray **aProfiles)
static nsresult GetOriginMediaItemByDevicePersistentId(sbILibrary *aLibrary, const nsAString &aDevicePersistentId, sbIMediaItem **aItem)
static nsresult GetTranscodedFileExtension(sbITranscodeProfile *aProfile, nsCString &aExtension)
sbExtensionToContentFormatEntry_t const MAP_FILE_EXTENSION_CONTENT_FORMAT[]
[UNIMPLEMENTED UNTIL AFTER 0.3]
static nsresult ShowDeviceErrors(sbIDevice *aDevice)
static nsresult BulkSetProperty(sbIMediaList *aMediaList, const nsAString &aPropertyId, const nsAString &aPropertyValue, sbIPropertyArray *aPropertyFilter=nsnull, PRInt32 *aAbortFlag=nsnull)
static nsresult SetLinkedSyncPartner(sbIDevice *aDevice)
static nsresult QueryUserAbortRip(PRBool *aAbort)
static nsresult QueryUserViewErrors(sbIDevice *aDevice)
static nsresult SetOriginIsInMainLibrary(sbIMediaItem *aMediaItem, sbILibrary *aDevLibrary, PRBool aMark)
static nsresult GetDeviceLibraryForItem(sbIDevice *aDevice, sbIMediaItem *aItem, sbIDeviceLibrary **_retval)
static nsresult NewDeviceLibraryURI(sbIDeviceLibrary *aDeviceLibrary, const nsCString &aSpec, nsIURI **aURI)
static bool IsItemDRMProtected(sbIMediaItem *aMediaItem)
static nsresult GetDeviceCapsTypeFromListContentType(PRUint16 aListContentType, PRUint32 *aContentType, PRUint32 *aFunctionType)
An object defining a transcoding profile.
sbDeviceListenerIgnore(sbBaseDevice *aDevice, PRUint32 aListenerType=ALL)
static nsresult QueryUserSpaceExceeded(sbIDevice *aDevice, sbIDeviceLibrary *aLibrary, PRInt64 aSpaceNeeded, PRInt64 aSpaceAvailable, PRBool *aAbort)
static nsresult GetOrganizedPath(nsIFile *aParent, sbIMediaItem *aItem, nsIFile **_retval)
static nsresult ApplyPropertyPreferencesToProfile(sbIDevice *aDevice, nsIArray *aPropertyArray, nsString aPrefNameBase)
static nsresult GetSupportedTranscodeProfiles(PRUint32 aType, sbIDevice *aDevice, nsIArray **aProfiles)
static nsresult GetDeviceCapsTypeFromMediaItem(sbIMediaItem *aMediaItem, PRUint32 *aContentType, PRUint32 *aFunctionType)
static PRBool IsMediaItemSupported(sbIDevice *aDevice, sbIMediaItem *aMediaItem)
static nsresult GetFormatTypesForMimeType(const nsAString &aMimeType, const PRUint32 aContentType, nsTArray< sbExtensionToContentFormatEntry_t > &aFormatTypeList)
For a MIME type, get format information describing it (extension, mime type, etc. ...
static nsresult GetFormatTypeForURL(const nsAString &aURL, sbExtensionToContentFormatEntry_t &aFormatType)
For a URL, get format information describing it (extension, mime type, etc.
static nsresult GetCodecAndContainerForMimeType(nsCString aMimeType, nsCString &aContainer, nsCString &aCodec, nsCString &aVideoType, nsCString &aAudioType)
static nsresult GetDeviceWriteLength(sbIDeviceLibrary *aDeviceLibrary, sbIMediaItem *aMediaItem, PRUint64 *aWriteLength)
static bool ArePlaylistsSupported(sbIDevice *aDevice)
void SetIgnore(PRBool aIgnore)
static nsresult GetFormatTypeForURI(nsIURI *aURI, sbExtensionToContentFormatEntry_t &aFormatType)
For a URI, get format information describing it (extension, mime type, etc.
static nsresult GetFormatTypeForItem(sbIMediaItem *aItem, sbExtensionToContentFormatEntry_t &aFormatType, PRUint32 &aBitRate, PRUint32 &aSampleRate)
For a media item, get format information describing it (extension, mime type, etc.
static bool ShouldLogDeviceInfo()
static nsresult GetSyncItemInLibrary(sbIMediaItem *aMediaItem, sbILibrary *aTargetLibrary, sbIMediaItem **aSyncItem)
Media library abstraction.
static nsCString GetDeviceIdentifier(sbIDevice *aDevice)
static nsresult GetMediaItemByDevicePersistentId(sbILibrary *aLibrary, const nsAString &aDevicePersistentId, sbIMediaItem **aItem)
static nsresult DeleteByProperty(sbIMediaList *aMediaList, nsAString const &aProperty, nsAString const &aValue)
static PRBool IsMediaListContentTypeSupported(sbIDevice *aDevice, PRUint16 aListContentType)
static nsresult DoesItemNeedTranscoding(sbExtensionToContentFormatEntry_t &aFormatType, PRUint32 &aBitRate, PRUint32 &aSampleRate, sbIDevice *aDevice, bool &aNeedsTranscoding)
Determine if an item needs transcoding.
~sbDeviceListenerIgnore()
static nsresult GetDeviceLibraryForLibrary(sbIDevice *aDevice, sbILibrary *aLibrary, sbIDeviceLibrary **_retval)
static nsresult GetAudioMimeTypeForFormatTypes(const nsAString &aContainer, const nsAString &aCodec, nsAString &aMimeType)
static nsresult GetMediaSettings(sbIDeviceLibrary *aDevLib, PRUint32 aMediaType, sbIDeviceLibraryMediaSyncSettings **aMediaSettings)
static nsresult GetMgmtTypeForMedia(sbIDeviceLibrary *aDevLib, PRUint32 aMediaType, PRUint32 &aMgmtType)
static nsresult DeleteUnavailableItems(sbIMediaList *aMediaList)
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
static nsresult GetTranscodingConfigurator(PRUint32 aTranscodeType, sbIDeviceTranscodingConfigurator **aConfigurator)
PRUint32 const MAP_FILE_EXTENSION_CONTENT_FORMAT_LENGTH
static nsresult GetDeviceLibrary(nsAString const &aDeviceLibGuid, sbIDevice *aDevice, sbIDeviceLibrary **aDeviceLibrar)
static nsresult AddSupportedFileExtensions(sbIDevice *aDevice, PRUint32 aContentType, nsTArray< nsString > &aFileExtensionList)
char const * ContainerFormat