27 #include <nsArrayUtils.h>
28 #include <nsComponentManagerUtils.h>
29 #include <nsIClassInfoImpl.h>
30 #include <nsICryptoHash.h>
31 #include <nsIFileURL.h>
32 #include <nsIGenericFactory.h>
33 #include <nsIPropertyBag2.h>
34 #include <nsIWritablePropertyBag2.h>
35 #include <nsIProgrammingLanguage.h>
36 #include <nsIUUIDGenerator.h>
38 #include <nsServiceManagerUtils.h>
39 #include <nsThreadUtils.h>
40 #include <nsILocalFile.h>
43 #include <sbIDeviceEvent.h>
44 #include <sbILibraryManager.h>
45 #include <sbILocalDatabaseLibrary.h>
46 #include <sbIDeviceErrorMonitor.h>
71 sbIJobProgressListener,
80 #pragma warning(disable: 4355)
84 nsIPropertyBag *aProperties)
85 : mConnectLock(nsnull)
86 , mControllerID(aControllerId)
87 , mCreationProperties(aProperties)
88 , mPrefAutoEject(PR_FALSE)
89 , mPrefNotifySound(PR_FALSE)
91 mPropertiesLock = nsAutoMonitor::NewMonitor(
"sbCDDevice::mPropertiesLock");
92 NS_ENSURE_TRUE(mPropertiesLock, );
102 nsCOMPtr<sbILibrary> lib;
103 if (mDeviceLibrary) {
105 rv = mDeviceLibrary->GetLibrary(getter_AddRefs(lib));
109 rv = mDeviceLibrary->Finalize();
110 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
111 "sbCDDevice failed to finalize the device library");
112 mDeviceLibrary = nsnull;
115 if (mPropertiesLock) {
116 nsAutoMonitor::DestroyMonitor(mPropertiesLock);
117 mPropertiesLock = nsnull;
120 if (lib && !mDeviceLibraryPath.IsEmpty()) {
121 NS_ENSURE_SUCCESS(rv, );
122 nsCOMPtr<sbILocalDatabaseLibrary> localLib = do_QueryInterface(lib, &rv);
123 NS_ENSURE_SUCCESS(rv, );
125 nsCOMPtr<nsIURI>
uri;
126 rv = localLib->GetDatabaseLocation(getter_AddRefs(uri));
127 NS_ENSURE_SUCCESS(rv, );
129 nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(uri, &rv);
130 NS_ENSURE_SUCCESS(rv, );
132 nsCOMPtr<nsIFile> libraryFile;
133 rv = fileURL->GetFile(getter_AddRefs(libraryFile));
134 NS_ENSURE_SUCCESS(rv, );
136 rv = libraryFile->Append(mDeviceLibraryPath);
137 NS_ENSURE_SUCCESS(rv, );
139 rv = libraryFile->Remove(PR_FALSE);
140 NS_ENSURE_SUCCESS(rv, );
144 PR_DestroyRWLock(mConnectLock);
149 sbCDDevice::CreateDeviceID(nsID* aDeviceID)
154 PRUint32* buffer =
reinterpret_cast<PRUint32*
>(aDeviceID);
155 memset(buffer, 0,
sizeof(nsID));
158 nsCString identifier;
159 rv = mCDDevice->GetIdentifier(identifier);
160 NS_ENSURE_SUCCESS(rv, rv);
163 *buffer = HashString(identifier);
174 LOG(
"Enter sbCDDevice::InitDevice");
177 NS_ENSURE_FALSE(mConnectLock, NS_ERROR_ALREADY_INITIALIZED);
178 mConnectLock = PR_NewRWLock(PR_RWLOCK_RANK_NONE,
179 "sbCDDevice::mConnectLock");
180 NS_ENSURE_TRUE(mConnectLock, NS_ERROR_OUT_OF_MEMORY);
184 NS_ENSURE_TRUE(mDeviceContent, NS_ERROR_OUT_OF_MEMORY);
185 rv = mDeviceContent->Initialize();
186 NS_ENSURE_SUCCESS(rv, rv);
189 nsCOMPtr<nsIVariant> deviceVar;
190 rv = mCreationProperties->GetProperty(NS_LITERAL_STRING(
"sbICDDevice"),
191 getter_AddRefs(deviceVar));
192 NS_ENSURE_SUCCESS(rv, rv);
194 rv = deviceVar->GetAsISupports(getter_AddRefs(mCDDevice));
195 NS_ENSURE_SUCCESS(rv, rv);
198 rv = CreateDeviceID(&mDeviceID);
199 NS_ENSURE_SUCCESS(rv, rv);
205 LOG(
"Exit sbCDDevice::InitDevice");
210 nsresult sbCDDevice::InitializeProperties()
215 do_CreateInstance(
"@songbirdnest.com/Songbird/Device/DeviceProperties;1",
217 NS_ENSURE_SUCCESS(rv, rv);
219 nsCOMPtr<nsIVariant> var;
220 rv = mCreationProperties->GetProperty(NS_LITERAL_STRING(
"sbICDDevice"),
221 getter_AddRefs(var));
222 NS_ENSURE_SUCCESS(rv, rv);
224 nsCOMPtr<nsISupports> supports;
225 rv = var->GetAsISupports(getter_AddRefs(supports));
226 NS_ENSURE_SUCCESS(rv, rv);
228 nsCOMPtr<sbICDDevice> cdDevice = do_QueryInterface(supports, &rv);
229 NS_ENSURE_SUCCESS(rv, rv);
232 rv = cdDevice->GetName(deviceName);
233 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"ERROR: Could not get the device name!");
237 rv = mProperties->InitFriendlyName(
239 NS_ENSURE_SUCCESS(rv, rv);
241 rv = mProperties->InitDone();
242 NS_ENSURE_SUCCESS(rv, rv);
246 rv = mProperties->GetProperties(getter_AddRefs(properties));
247 NS_ENSURE_SUCCESS(rv, rv);
248 nsCOMPtr<nsIWritablePropertyBag2> writeProperties =
249 do_QueryInterface(properties, &rv);
250 NS_ENSURE_SUCCESS(rv, rv);
252 writeProperties->SetPropertyAsAString(
254 NS_LITERAL_STRING(
"ro"));
260 nsIPropertyBag *aProperties,
261 sbCDDevice **aOutCDDevice)
263 NS_ENSURE_ARG_POINTER(aProperties);
264 NS_ENSURE_ARG_POINTER(aOutCDDevice);
266 nsRefPtr<sbCDDevice> device =
new sbCDDevice(aControllerId, aProperties);
267 NS_ENSURE_TRUE(device, NS_ERROR_OUT_OF_MEMORY);
270 nsresult rv = device->Init();
271 NS_ENSURE_SUCCESS(rv, rv);
274 device.forget(aOutCDDevice);
286 sbCDDevice::GetName(nsAString&
aName)
289 nsAutoMonitor autoPropertiesLock(mPropertiesLock);
301 sbCDDevice::GetProductName(nsAString& aProductName)
304 nsAutoMonitor autoPropertiesLock(mPropertiesLock);
313 sbCDDevice::GetControllerId(nsID * *aControllerId)
316 NS_ENSURE_ARG_POINTER(aControllerId);
319 nsID* pId =
static_cast<nsID*
>(NS_Alloc(
sizeof(nsID)));
320 NS_ENSURE_TRUE(pId, NS_ERROR_OUT_OF_MEMORY);
321 *pId = mControllerID;
324 *aControllerId = pId;
331 sbCDDevice::GetId(nsID * *aId)
334 NS_ENSURE_ARG_POINTER(aId);
337 nsID* pId =
static_cast<nsID*
>(NS_Alloc(
sizeof(nsID)));
338 NS_ENSURE_TRUE(pId, NS_ERROR_OUT_OF_MEMORY);
348 sbCDDevice::CapabilitiesReset()
355 NS_ENSURE_SUCCESS(rv, rv);
356 mCapabilities->Init();
357 NS_ENSURE_SUCCESS(rv, rv);
360 rv = mCapabilities->SetFunctionTypes(&functionTypes, 1);
361 NS_ENSURE_SUCCESS(rv, rv);
365 NS_ENSURE_SUCCESS(rv, rv);
368 rv = mCapabilities->ConfigureDone();
369 NS_ENSURE_SUCCESS(rv, rv);
380 LOG(
"Enter sbCDDevice::Connect\n");
383 NS_ASSERTION(NS_IsMainThread(),
"not on main thread");
398 NS_ENSURE_SUCCESS(rv, rv);
401 "@songbirdnest.com/Songbird/Mediacore/TranscodeManager;1",
405 rv = CapabilitiesReset();
406 NS_ENSURE_SUCCESS(rv, rv);
416 nsRefPtr<sbBaseDeviceVolume> volume;
418 NS_ENSURE_SUCCESS(rv, rv);
421 char volumeGUID[NSID_LENGTH];
422 mDeviceID.ToProvidedString(volumeGUID);
423 rv = volume->SetGUID(NS_ConvertUTF8toUTF16(volumeGUID));
424 NS_ENSURE_SUCCESS(rv, rv);
428 NS_ENSURE_SUCCESS(rv, rv);
432 NS_ENSURE_SUCCESS(rv, rv);
438 autoDisconnect.forget();
441 LOG(
"Exit sbCDDevice::Connect\n");
453 sbCDDevice::DeviceSpecificDisconnect()
456 LOG(
"Enter sbCDDevice::DeviceSpecificDisconnect\n");
461 NS_ASSERTION(NS_IsMainThread(),
"not on main thread");
464 mTranscodeManager = nsnull;
467 nsCOMPtr<sbIDeviceLibrary> deviceLib = mDeviceLibrary.forget();
469 rv = deviceLib->Finalize();
470 NS_ENSURE_SUCCESS(rv, rv);
477 nsRefPtr<sbBaseDeviceVolume> volume;
483 rv = Unmount(volume);
484 NS_ENSURE_SUCCESS(rv, rv);
496 mCapabilities = nsnull;
499 LOG(
"Exit sbCDDevice::Disconnect\n");
506 sbCDDevice::GetConnected(PRBool *aConnected)
508 NS_ENSURE_ARG_POINTER(aConnected);
516 sbCDDevice::GetThreaded(PRBool *aThreaded)
518 NS_ENSURE_ARG_POINTER(aThreaded);
519 *aThreaded = PR_TRUE;
528 if (StringBeginsWith(aPrefName, NS_LITERAL_STRING(
"transcode_profile")))
530 nsCOMPtr<nsIPrefBranch> prefBranch;
532 getter_AddRefs(prefBranch));
533 NS_ENSURE_SUCCESS(rv, rv);
546 NS_ENSURE_ARG_POINTER(aPrefValue);
548 if (StringBeginsWith(aPrefName, NS_LITERAL_STRING(
"transcode_profile")))
550 nsCOMPtr<nsIPrefBranch> prefBranch;
552 getter_AddRefs(prefBranch));
553 NS_ENSURE_SUCCESS(rv, rv);
565 NS_ENSURE_ARG_POINTER(aCapabilities);
567 NS_IF_ADDREF(*aCapabilities = mCapabilities);
575 NS_ENSURE_ARG_POINTER(aContent);
576 NS_ENSURE_STATE(mDeviceContent);
577 NS_ADDREF(*aContent = mDeviceContent);
603 sbCDDevice::GetParameters(nsIPropertyBag2 * *aParameters)
606 NS_ENSURE_ARG_POINTER(aParameters);
609 nsresult rv = CallQueryInterface(mCreationProperties, aParameters);
610 NS_ENSURE_SUCCESS(rv, rv);
620 NS_ENSURE_ARG_POINTER(aProperties);
623 nsAutoMonitor autoPropertiesLock(mPropertiesLock);
625 *aProperties = nsnull;
629 NS_ADDREF(*aProperties = mProperties);
631 return NS_ERROR_UNEXPECTED;
662 NS_ENSURE_ARG_POINTER(aCurrentStatus);
663 return mStatus->GetCurrentStatus(aCurrentStatus);
670 NS_ENSURE_ARG_POINTER(aSupportsReformat);
671 *aSupportsReformat = PR_FALSE;
696 nsIPropertyBag2 *aRequestParameters)
699 LOG(
"sbCDDevice::SubmitRequest\n");
712 nsCOMPtr<sbIDeviceStatus> status;
713 rv = GetCurrentStatus(getter_AddRefs(status));
714 NS_ENSURE_SUCCESS(rv, rv);
716 PRUint32 currentState;
717 rv = status->GetCurrentState(¤tState);
718 NS_ENSURE_SUCCESS(rv, rv);
722 NS_ENSURE_SUCCESS(rv, rv);
730 NS_ENSURE_SUCCESS(rv, rv);
739 return NS_ERROR_NOT_IMPLEMENTED;
746 return NS_ERROR_NOT_IMPLEMENTED;
753 NS_ENSURE_TRUE(mCDDevice, NS_ERROR_UNEXPECTED);
756 rv = mCDDevice->Eject();
757 NS_ENSURE_SUCCESS(rv, rv);
766 return NS_ERROR_NOT_IMPLEMENTED;
795 nsIInputStream** retval)
820 NS_ASSERTION(NS_IsMainThread(),
"not on main thread");
824 NS_ENSURE_TRUE(
mConnected, NS_ERROR_NOT_AVAILABLE);
829 NS_ENSURE_SUCCESS(rv, rv);
843 char deviceID[NSID_LENGTH];
844 mDeviceID.ToProvidedString(deviceID);
848 mDeviceLibraryPath.AssignLiteral(
"CD");
849 mDeviceLibraryPath.Append(NS_ConvertUTF8toUTF16(deviceID + 1, NSID_LENGTH - 3));
850 mDeviceLibraryPath.AppendLiteral(
"@devices.library.songbirdnest.com");
853 nsCOMPtr<sbIDeviceLibrary> deviceLibrary;
856 getter_AddRefs(deviceLibrary));
857 NS_ENSURE_SUCCESS(rv, rv);
861 NS_ENSURE_SUCCESS(rv, rv);
864 mDeviceLibrary = deviceLibrary;
867 nsAutoString cdDiscHash;
868 rv = GetCDDiscHash(mCDDevice, cdDiscHash);
869 NS_ENSURE_SUCCESS(rv, rv);
872 nsAutoString prevCDDiscHash;
875 if (rv == NS_ERROR_NOT_AVAILABLE) {
876 prevCDDiscHash.Truncate();
879 NS_ENSURE_SUCCESS(rv, rv);
881 if (!cdDiscHash.Equals(prevCDDiscHash)) {
883 rv = mDeviceLibrary->Clear();
884 NS_ENSURE_SUCCESS(rv, rv);
887 NS_ENSURE_SUCCESS(rv, rv);
890 NS_ENSURE_SUCCESS(rv, rv);
897 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
898 "Failed to reset rip status for CD tracks");
902 NS_LITERAL_STRING(
"1"));
903 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
904 "Failed to reset selection for CD tracks");
909 NS_LITERAL_STRING(
"1"));
910 NS_ENSURE_SUCCESS(rv, rv);
917 NS_ENSURE_SUCCESS(rv, rv);
924 NS_ENSURE_SUCCESS(rv, rv);
928 NS_ENSURE_SUCCESS(rv, rv);
931 autoConnectLock.unlock();
942 NS_ASSERTION(NS_IsMainThread(),
"not on main thread");
946 NS_ENSURE_TRUE(
mConnected, NS_ERROR_NOT_AVAILABLE);
949 nsRefPtr<sbDeviceStatistics> deviceStatistics;
950 rv = aVolume->
GetStatistics(getter_AddRefs(deviceStatistics));
951 NS_ENSURE_SUCCESS(rv, rv);
953 NS_ENSURE_SUCCESS(rv, rv);
956 if (!mDeviceLibrary) {
961 rv = deviceStatistics->RemoveLibrary(mDeviceLibrary);
962 NS_ENSURE_SUCCESS(rv, rv);
966 NS_ENSURE_SUCCESS(rv, rv);
968 nsCOMPtr<sbILibraryManager> libManager =
969 do_GetService(
"@songbirdnest.com/Songbird/library/Manager;1", &rv);
970 NS_ENSURE_SUCCESS(rv, rv);
972 rv = libManager->UnregisterLibrary(mDeviceLibrary);
973 NS_ENSURE_SUCCESS(rv, rv);
985 PRBool isDiscInserted;
986 nsresult rv = mCDDevice->GetIsDiscInserted(&isDiscInserted);
987 aborted = NS_SUCCEEDED(rv) && !isDiscInserted ? PR_TRUE : PR_FALSE;
996 sbCDDevice::GetSupportedTranscodeProfiles(PRUint32 aType,
997 nsIArray **aSupportedProfiles)
1000 nsCOMPtr<nsIArray> profiles;
1002 aSupportedProfiles);
1003 NS_ENSURE_SUCCESS(rv, rv);
1018 sbCDDevice::HandleRipEnd()
1022 if (!NS_IsMainThread()) {
1023 nsCOMPtr<nsIThreadManager> threadMgr =
1024 do_GetService(
"@mozilla.org/thread-manager;1", &rv);
1025 NS_ENSURE_SUCCESS(rv, rv);
1027 nsCOMPtr<nsIThread> mainThread;
1028 rv = threadMgr->GetMainThread(getter_AddRefs(mainThread));
1029 NS_ENSURE_SUCCESS(rv, rv);
1031 nsCOMPtr<nsIRunnable> runnable =
1032 NS_NEW_RUNNABLE_METHOD(sbCDDevice,
this, ProxyHandleRipEnd);
1033 NS_ENSURE_TRUE(runnable, NS_ERROR_FAILURE);
1035 rv = mainThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
1036 NS_ENSURE_SUCCESS(rv, rv);
1039 ProxyHandleRipEnd();
1046 sbCDDevice::ProxyHandleRipEnd()
1054 nsCOMPtr<sbIDeviceErrorMonitor> errMonitor =
1055 do_GetService(
"@songbirdnest.com/device/error-monitor-service;1", &rv);
1056 NS_ENSURE_SUCCESS(rv, );
1059 rv = errMonitor->DeviceHasErrors(
this, EmptyString(), 0, &hasErrors);
1060 NS_ENSURE_SUCCESS(rv, );
1066 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Could not show user view errors!");
1070 rv = errMonitor->ClearErrorsForDevice(
this);
1071 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Could not clear the device errors!");
1075 if (mPrefAutoEject) {
1079 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Could not eject the CD!");
1083 if (mPrefNotifySound) {
1084 nsCOMPtr<nsISound> soundInterface =
1085 do_CreateInstance(
"@mozilla.org/sound;1", &rv);
1086 NS_ENSURE_SUCCESS(rv, );
1088 soundInterface->Beep();
1094 sbCDDevice::QueryUserViewErrors()
1098 if (!NS_IsMainThread()) {
1099 nsCOMPtr<nsIThreadManager> threadMgr =
1100 do_GetService(
"@mozilla.org/thread-manager;1", &rv);
1101 NS_ENSURE_SUCCESS(rv, rv);
1103 nsCOMPtr<nsIThread> mainThread;
1104 rv = threadMgr->GetMainThread(getter_AddRefs(mainThread));
1105 NS_ENSURE_SUCCESS(rv, rv);
1107 nsCOMPtr<nsIRunnable> runnable =
1108 NS_NEW_RUNNABLE_METHOD(sbCDDevice,
this, ProxyQueryUserViewErrors);
1109 NS_ENSURE_TRUE(runnable, NS_ERROR_FAILURE);
1111 rv = mainThread->Dispatch(runnable, NS_DISPATCH_NORMAL);
1112 NS_ENSURE_SUCCESS(rv, rv);
1115 ProxyQueryUserViewErrors();
1122 sbCDDevice::ProxyQueryUserViewErrors()
1125 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Could not show user view errors!");
1130 nsAString& aCDDiscHash)
1133 NS_ENSURE_ARG_POINTER(aCDDevice);
1139 nsCOMPtr<nsICryptoHash>
1140 cryptoHash = do_CreateInstance(
"@mozilla.org/security/hash;1", &rv);
1141 NS_ENSURE_SUCCESS(rv, rv);
1142 rv = cryptoHash->Init(nsICryptoHash::MD5);
1143 NS_ENSURE_SUCCESS(rv, rv);
1146 nsCOMPtr<sbICDTOC> toc;
1147 rv = mCDDevice->GetDiscTOC(getter_AddRefs(toc));
1148 NS_ENSURE_SUCCESS(rv, rv);
1151 nsCOMPtr<nsIArray> tracks;
1152 rv = toc->GetTracks(getter_AddRefs(tracks));
1153 NS_ENSURE_SUCCESS(rv, rv);
1154 PRUint32 trackCount;
1155 rv = tracks->GetLength(&trackCount);
1156 NS_ENSURE_SUCCESS(rv, rv);
1159 for (PRUint32
i = 0;
i < trackCount;
i++) {
1161 nsCOMPtr<sbICDTOCEntry> track = do_QueryElementAt(tracks,
i, &rv);
1162 NS_ENSURE_SUCCESS(rv, rv);
1165 PRInt32 frameOffset;
1166 rv = track->GetFrameOffset(&frameOffset);
1167 NS_ENSURE_SUCCESS(rv, rv);
1170 rv = cryptoHash->Update(reinterpret_cast<PRUint8 const *>(&frameOffset),
1172 NS_ENSURE_SUCCESS(rv, rv);
1176 PRInt32 leadOutOffset;
1177 rv = toc->GetLeadOutTrackOffset(&leadOutOffset);
1178 NS_ENSURE_SUCCESS(rv, rv);
1179 rv = cryptoHash->Update(reinterpret_cast<PRUint8 const *>(&leadOutOffset),
1181 NS_ENSURE_SUCCESS(rv, rv);
1184 nsCString cdDiscHash;
1185 rv = cryptoHash->Finish(PR_TRUE, cdDiscHash);
1186 NS_ENSURE_SUCCESS(rv, rv);
1187 aCDDiscHash.Assign(NS_ConvertASCIItoUTF16(cdDiscHash));
static nsresult GetTranscodeProfiles(PRUint32 aType, nsIArray **aProfiles)
NS_IMETHOD GetPreference(const nsAString &aPrefName, nsIVariant **_retval)
#define SB_PROPERTY_SHOULDRIP
nsresult CreateAndDispatchEvent(PRUint32 aType, nsIVariant *aData, PRBool aAsync=PR_TRUE, sbIDeviceEventTarget *aTarget=nsnull)
NS_SCRIPTABLE NS_IMETHOD ResetWarningDialogs(void)
#define SB_PRLOG_SETUP(x)
#define SB_PROPERTY_CDRIP_STATUS
nsresult CreateDeviceLibrary(const nsAString &aId, nsIURI *aLibraryLocation, sbIDeviceLibrary **_retval)
nsAutoPtr< sbDeviceStatusHelper > mStatus
[UNIMPLEMENTED UNTIL AFTER 0.3]
NS_IMETHOD GetIsDirectTranscoding(PRBool *aIsDirect)
static nsresult BulkSetProperty(sbIMediaList *aMediaList, const nsAString &aPropertyId, const nsAString &aPropertyValue, sbIPropertyArray *aPropertyFilter=nsnull, PRInt32 *aAbortFlag=nsnull)
NS_IMETHOD GetPrimaryLibrary(sbIDeviceLibrary **aPrimaryLibrary)
NS_IMETHOD GetPreviousState(PRUint32 *aState)
NS_SCRIPTABLE NS_IMETHOD SetWarningDialogEnabled(const nsAString &aWarning, PRBool aEnabled)
NS_SCRIPTABLE NS_IMETHOD OpenInputStream(nsIURI *aURI, nsIInputStream **retval)
nsRefPtr< sbBaseDeviceVolume > mPrimaryVolume
nsresult SetIsMounted(PRBool aIsMounted)
static nsresult QueryUserAbortRip(PRBool *aAbort)
NS_SCRIPTABLE NS_IMETHOD GetWarningDialogEnabled(const nsAString &aWarning, PRBool *_retval)
static nsresult QueryUserViewErrors(sbIDevice *aDevice)
nsresult GetPrefBranch(nsIPrefBranch **aPrefBranch)
#define SB_DEVICE_PROPERTY_ACCESS_COMPATIBILITY
#define SB_PROPERTY_HIDDEN
nsresult GetStatistics(sbDeviceStatistics **aStatistics)
NS_IMETHOD SyncLibraries(void)
const unsigned long EVENT_CDRIP_COMPLETED
Songbird Variant Utility Definitions.
[UNIMPLEMENTED UNTIL AFTER 0.3]
nsRefPtr< sbBaseDeviceVolume > mDefaultVolume
nsresult GetNameBase(nsAString &aName)
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
const PRUint32 FUNCTION_DEVICE
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
nsresult GetIsMounted(PRBool *aIsMounted)
virtual PRBool IsRequestAborted()
NS_IMETHOD GetState(PRUint32 *aState)
nsresult PushRequest(const PRUint32 aType, sbIMediaItem *aItem=nsnull, sbIMediaList *aList=nsnull, PRUint32 aIndex=PR_UINT32_MAX, PRUint32 aOtherIndex=PR_UINT32_MAX, nsISupports *aData=nsnull)
virtual nsresult UpdateProperties()
#define PREF_CDDEVICE_RIPBRANCH
#define SONGBIRD_DEVICECAPABILITIES_CONTRACTID
NS_IMPL_QUERY_INTERFACE3_CI(sbCDDevice, sbIDevice, sbIJobProgressListener, sbIDeviceEventTarget) NS_IMPL_CI_INTERFACE_GETTER3(sbCDDevice
nsresult GetPreferenceInternal(nsIPrefBranch *aPrefBranch, const nsAString &aPrefName, nsIVariant **_retval)
nsresult ReqProcessingStart()
NS_IMETHOD SupportsMediaItem(sbIMediaItem *aMediaItem, sbIDeviceSupportsItemCallback *aCallback)
const sbCreateProxiedComponent do_ProxiedGetService(const nsCID &aCID, nsresult *error=0)
NS_DECL_ISUPPORTS static NS_DECL_SBIDEVICECONTENT sbDeviceContent * New()
NS_IMETHOD GetDefaultLibrary(sbIDeviceLibrary **aDefaultLibrary)
#define SB_PROPERTY_CDDISCHASH
_updateTextAndScrollDataForFrame aContent
const unsigned long STATE_IDLE
NS_IMETHOD CancelRequests()
Media library abstraction.
nsresult GetProductNameBase(char const *aDefaultModelNumberString, nsAString &aProductName)
NS_IMETHOD GetIsBusy(PRBool *aIsBusy)
NS_IMETHOD ExportToDevice(sbIDeviceLibrary *aDevLibrary, sbILibraryChangeset *aChangeset)
readonly attribute sbIDeviceProperties properties
nsresult AddVolume(sbBaseDeviceVolume *aVolume)
nsresult RemoveLibrary(sbIDeviceLibrary *aDevLib)
const unsigned long STATE_TRANSCODE
NS_IMETHOD GetSupportsReformat(PRBool *_retval)
#define SB_PROPERTY_ALBUMNAME
#define SB_CD_DEVICE_AUTO_INVOKE(aName, aMethod)
NS_IMETHOD SubmitRequest(PRUint32 aRequest, nsIPropertyBag2 *aRequestParameters)
NS_IMETHOD GetCanDisconnect(PRBool *aCanDisconnect)
virtual nsresult InitDevice()
Songbird Device Status Services Definitions.
static NS_DECL_ISUPPORTS nsresult New(sbBaseDeviceVolume **aVolume, sbBaseDevice *aDevice)
Implemented to receive notifications from sbIJobProgress interfaces.
static nsresult New(const nsID &aControllerId, nsIPropertyBag *aProperties, sbCDDevice **aOutCDDevice)
nsresult SetDeviceLibrary(sbIDeviceLibrary *aDeviceLibrary)
NS_IMETHOD ImportFromDevice(sbILibrary *aImportToLibrary, sbILibraryChangeset *aImportChangeset)
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICE NS_DECL_SBIJOBPROGRESSLISTENER NS_DECL_NSICLASSINFO sbCDDevice(const nsID &aControllerId, nsIPropertyBag *aProperties)
nsresult RegisterDeviceCapabilities(sbIDeviceCapabilities *aCapabilities)
NS_IMETHOD SetState(PRUint32 aState)
_getSelectedPageStyle s i
NS_IMETHOD SetPreference(const nsAString &aPrefName, nsIVariant *aPrefValue)
nsresult SetPreferenceInternal(nsIPrefBranch *aPrefBranch, const nsAString &aPrefName, nsIVariant *aPrefValue, PRBool *aHasChanged)
#define SB_UNUSED_IN_RELEASE(decl)
virtual PRBool IsRequestAborted()
NS_IMETHOD SetDefaultLibrary(sbIDeviceLibrary *aDefaultLibrary)
const unsigned long STATE_DISCONNECTED
nsresult RemoveVolume(sbBaseDeviceVolume *aVolume)
nsresult AddLibrary(sbIDeviceLibrary *aDevLib)