sbBaseDevice.cpp File Reference
#include "sbBaseDevice.h"
#include <algorithm>
#include <cstddef>
#include <set>
#include <prtime.h>
#include <nsIDOMParser.h>
#include <nsIFileURL.h>
#include <nsIMutableArray.h>
#include <nsIPropertyBag2.h>
#include <nsITimer.h>
#include <nsIURI.h>
#include <nsIVariant.h>
#include <nsIPrefService.h>
#include <nsIPrefBranch.h>
#include <nsIProxyObjectManager.h>
#include <nsAppDirectoryServiceDefs.h>
#include <nsArrayUtils.h>
#include <nsAutoLock.h>
#include <nsAutoPtr.h>
#include <nsComponentManagerUtils.h>
#include <nsCRT.h>
#include <nsDirectoryServiceUtils.h>
#include <nsMemory.h>
#include <nsNetUtil.h>
#include <nsServiceManagerUtils.h>
#include <nsThreadUtils.h>
#include <nsIDOMDocument.h>
#include <nsIDOMElement.h>
#include <nsIDOMNodeList.h>
#include <nsIDOMWindow.h>
#include <nsIPromptService.h>
#include <nsIScriptSecurityManager.h>
#include <nsISupportsPrimitives.h>
#include <nsIWritablePropertyBag.h>
#include <nsIWritablePropertyBag2.h>
#include <nsIXMLHttpRequest.h>
#include <sbIDeviceContent.h>
#include <sbIDeviceCapabilities.h>
#include <sbIDeviceInfoRegistrar.h>
#include <sbIDeviceLibraryMediaSyncSettings.h>
#include <sbIDeviceLibrarySyncDiff.h>
#include <sbIDeviceLibrarySyncSettings.h>
#include <sbIDeviceEvent.h>
#include <sbIDeviceHelper.h>
#include <sbIDeviceManager.h>
#include <sbIDeviceProperties.h>
#include <sbIDownloadDevice.h>
#include <sbIJobCancelable.h>
#include <sbILibrary.h>
#include <sbILibraryDiffingService.h>
#include <sbILibraryUtils.h>
#include <sbILocalDatabaseSmartMediaList.h>
#include <sbIMediacoreManager.h>
#include <sbIMediacorePlaybackControl.h>
#include <sbIMediacoreSequencer.h>
#include <sbIMediacoreStatus.h>
#include <sbIMediaFileManager.h>
#include <sbIMediaInspector.h>
#include <sbIMediaItem.h>
#include <sbIMediaItemController.h>
#include <sbIMediaItemDownloader.h>
#include <sbIMediaItemDownloadJob.h>
#include <sbIMediaItemDownloadService.h>
#include <sbIMediaList.h>
#include <sbIOrderableMediaList.h>
#include <sbIPrompter.h>
#include <sbIPropertyManager.h>
#include <sbIPropertyUnitConverter.h>
#include <sbITranscodeManager.h>
#include <sbITranscodeAlbumArt.h>
#include <sbITranscodingConfigurator.h>
#include <sbArray.h>
#include <sbArrayUtils.h>
#include <sbDeviceLibrary.h>
#include <sbDeviceStatus.h>
#include <sbFileUtils.h>
#include <sbJobUtils.h>
#include <sbLibraryUtils.h>
#include <sbLocalDatabaseCID.h>
#include <sbMediaListEnumArrayHelper.h>
#include <sbMemoryUtils.h>
#include <sbPrefBranch.h>
#include <sbPropertiesCID.h>
#include <sbPropertyBagUtils.h>
#include <sbProxiedComponentManager.h>
#include <sbStandardDeviceProperties.h>
#include <sbStandardProperties.h>
#include <sbStringBundle.h>
#include <sbStringUtils.h>
#include <sbTranscodeUtils.h>
#include <sbURIUtils.h>
#include <sbVariantUtils.h>
#include <sbWatchFolderUtils.h>
#include "sbDeviceEnsureSpaceForWrite.h"
#include "sbDeviceProgressListener.h"
#include "sbDeviceStatusHelper.h"
#include "sbDeviceStreamingHandler.h"
#include "sbDeviceSupportsItemHelper.h"
#include "sbDeviceTranscoding.h"
#include "sbDeviceImages.h"
#include "sbDeviceUtils.h"
#include "sbDeviceXMLCapabilities.h"
#include "sbDeviceXMLInfo.h"
#include "sbLibraryListenerHelpers.h"

Go to the source code of this file.

Classes

class  MediaListListenerAttachingEnumerator
 
class  ShowMediaListEnumerator
 
class  sbDownloadAutoComplete
 
class  sbBaseDeviceInitHelper
 

Macros

#define LOG(args)   do{ } while(0)
 
#define TRACE(args)   do { } while(0)
 
#define PREF_DEVICE_PREFERENCES_BRANCH   "songbird.device."
 
#define PREF_DEVICE_LIBRARY_BASE   "library."
 
#define PREF_WARNING   "warning."
 
#define PREF_ORGANIZE_PREFIX   "media_management.library."
 
#define PREF_ORGANIZE_ENABLED   "media_management.library.enabled"
 
#define PREF_ORGANIZE_DIR_FORMAT   "media_management.library.format.dir"
 
#define PREF_ORGANIZE_FILE_FORMAT   "media_management.library.format.file"
 
#define SB_PROPERTY_UILIMITTYPE   "http://songbirdnest.com/data/1.0#uiLimitType"
 
#define RANDOM_LISTNAME   "device.error.not_enough_freespace.random_playlist_name"
 
#define PREF_ORGANIZE_DIR_FORMAT_DEFAULT   SB_PROPERTY_ARTISTNAME "," FILE_PATH_SEPARATOR "," SB_PROPERTY_ALBUMNAME
 
#define BATCH_TIMEOUT   200 /* number of milliseconds to wait for batching */
 
#define BYTES_PER_10MB   (10 * 1000 * 1000)
 

Functions

static nsresult GetPropertyBag (sbIDevice *aDevice, nsIPropertyBag2 **aProperties)
 
static nsresult GetWritableDeviceProperties (sbIDevice *aDevice, nsIWritablePropertyBag **aProperties)
 
 NS_IMPL_ISUPPORTS1 (MediaListListenerAttachingEnumerator, sbIMediaListEnumerationListener) NS_IMETHODIMP MediaListListenerAttachingEnumerator
 
 NS_IMPL_ISUPPORTS1 (ShowMediaListEnumerator, sbIMediaListEnumerationListener) ShowMediaListEnumerator
 
static nsresult DispatchDownloadError (sbBaseDevice *aDevice, nsAString const &aMessage, sbIMediaItem *aItem)
 
template<class T >
find_iterator (T start, T end, T target)
 
static nsresult AddAlbumArtFormats (PRUint32 aContentType, sbIDeviceCapabilities *aCapabilities, nsIMutableArray *aArray, PRUint32 numMimeTypes, char **mimeTypes)
 
void SBWriteRequestSplitBatches (const sbBaseDevice::Batch &aInput, sbBaseDevice::Batch &aNonTranscodeItems, sbBaseDevice::Batch &aTranscodeItems, sbBaseDevice::Batch &aPlaylistItems)
 

Variables

static const PRUint32 sbBaseDeviceSupportedFolderContentTypeList []
 

Macro Definition Documentation

#define BATCH_TIMEOUT   200 /* number of milliseconds to wait for batching */

Definition at line 172 of file sbBaseDevice.cpp.

#define BYTES_PER_10MB   (10 * 1000 * 1000)

Definition at line 173 of file sbBaseDevice.cpp.

#define LOG (   args)    do{ } while(0)

Definition at line 153 of file sbBaseDevice.cpp.

#define PREF_DEVICE_LIBRARY_BASE   "library."

Definition at line 159 of file sbBaseDevice.cpp.

#define PREF_DEVICE_PREFERENCES_BRANCH   "songbird.device."

Definition at line 158 of file sbBaseDevice.cpp.

#define PREF_ORGANIZE_DIR_FORMAT   "media_management.library.format.dir"

Definition at line 163 of file sbBaseDevice.cpp.

#define PREF_ORGANIZE_DIR_FORMAT_DEFAULT   SB_PROPERTY_ARTISTNAME "," FILE_PATH_SEPARATOR "," SB_PROPERTY_ALBUMNAME

Definition at line 169 of file sbBaseDevice.cpp.

#define PREF_ORGANIZE_ENABLED   "media_management.library.enabled"

Definition at line 162 of file sbBaseDevice.cpp.

#define PREF_ORGANIZE_FILE_FORMAT   "media_management.library.format.file"

Definition at line 164 of file sbBaseDevice.cpp.

#define PREF_ORGANIZE_PREFIX   "media_management.library."

Definition at line 161 of file sbBaseDevice.cpp.

#define PREF_WARNING   "warning."

Definition at line 160 of file sbBaseDevice.cpp.

#define RANDOM_LISTNAME   "device.error.not_enough_freespace.random_playlist_name"

Definition at line 166 of file sbBaseDevice.cpp.

#define SB_PROPERTY_UILIMITTYPE   "http://songbirdnest.com/data/1.0#uiLimitType"

Definition at line 165 of file sbBaseDevice.cpp.

#define TRACE (   args)    do { } while(0)

Definition at line 154 of file sbBaseDevice.cpp.

Function Documentation

static nsresult AddAlbumArtFormats ( PRUint32  aContentType,
sbIDeviceCapabilities aCapabilities,
nsIMutableArray *  aArray,
PRUint32  numMimeTypes,
char **  mimeTypes 
)
static

Definition at line 6124 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

static nsresult DispatchDownloadError ( sbBaseDevice aDevice,
nsAString const &  aMessage,
sbIMediaItem aItem 
)
static

Dispatches a download error to the device

Definition at line 643 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
T find_iterator ( start,
end,
target 
)
inline

Definition at line 2354 of file sbBaseDevice.cpp.

Here is the call graph for this function:

static nsresult GetPropertyBag ( sbIDevice aDevice,
nsIPropertyBag2 **  aProperties 
)
static

Definition at line 185 of file sbBaseDevice.cpp.

Here is the caller graph for this function:

static nsresult GetWritableDeviceProperties ( sbIDevice aDevice,
nsIWritablePropertyBag **  aProperties 
)
static

Definition at line 203 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 231 of file sbBaseDevice.cpp.

Definition at line 280 of file sbBaseDevice.cpp.

void SBWriteRequestSplitBatches ( const sbBaseDevice::Batch aInput,
sbBaseDevice::Batch aNonTranscodeItems,
sbBaseDevice::Batch aTranscodeItems,
sbBaseDevice::Batch aPlaylistItems 
)

Split out a batch into three separate batches so that items are processed in proper order and the status reporting system reports status properly.

Definition at line 6615 of file sbBaseDevice.cpp.

Here is the call graph for this function:

Variable Documentation

const PRUint32 sbBaseDeviceSupportedFolderContentTypeList[]
static