65 NS_ENSURE_ARG_POINTER(aVolume);
66 NS_ENSURE_ARG_POINTER(aDevice);
73 NS_ENSURE_TRUE(volume, NS_ERROR_OUT_OF_MEMORY);
74 rv = volume->Initialize(aDevice);
75 NS_ENSURE_SUCCESS(rv, rv);
78 volume.forget(aVolume);
116 NS_ENSURE_ARG_POINTER(aIsMounted);
118 *aIsMounted = mIsMounted;
126 mIsMounted = aIsMounted;
134 NS_ENSURE_ARG_POINTER(aRemovable);
136 *aRemovable = mRemovable;
144 mRemovable = aRemovable;
152 NS_ENSURE_ARG_POINTER(aDeviceLibrary);
154 NS_IF_ADDREF(*aDeviceLibrary = mDeviceLibrary);
164 nsCOMPtr<sbIDeviceLibrary> currentLibrary;
165 nsAutoString currentLibraryGUID;
168 currentLibrary = mDeviceLibrary;
170 if (currentLibrary) {
171 rv = currentLibrary->GetGuid(currentLibraryGUID);
172 NS_ENSURE_SUCCESS(rv, rv);
176 if (currentLibrary) {
183 mDeviceLibrary = nsnull;
188 if (aDeviceLibrary) {
189 nsAutoString libraryGUID;
190 rv = aDeviceLibrary->GetGuid(libraryGUID);
191 NS_ENSURE_SUCCESS(rv, rv);
195 NS_ERROR_OUT_OF_MEMORY);
199 mDeviceLibrary = aDeviceLibrary;
210 NS_ENSURE_ARG_POINTER(aStatistics);
212 NS_ENSURE_STATE(aStatistics);
213 NS_ADDREF(*aStatistics = mStatistics);
230 mVolumeLock = nsAutoLock::NewLock(
"sbBaseDeviceVolume::mVolumeLock");
231 NS_ENSURE_TRUE(
mVolumeLock, NS_ERROR_OUT_OF_MEMORY);
238 NS_ENSURE_SUCCESS(rv, rv);
246 mIsMounted(PR_FALSE),
virtual ~sbBaseDeviceVolume()
NS_DECL_ISUPPORTS static NS_DECL_SBIMEDIALISTENUMERATIONLISTENER nsresult New(class sbBaseDevice *aDevice, sbDeviceStatistics **aDeviceStatistics)
nsresult SetIsMounted(PRBool aIsMounted)
Songbird Base Device Volume Definitions.
nsresult GetStatistics(sbDeviceStatistics **aStatistics)
nsresult GetIsMounted(PRBool *aIsMounted)
nsresult GetGUID(nsAString &aGUID)
nsresult GetRemovable(PRInt32 *aRemovable)
nsresult GetDeviceLibrary(sbIDeviceLibrary **aDeviceLibrary)
nsresult SetRemovable(PRInt32 aRemovable)
nsresult SetGUID(const nsAString &aGUID)
nsresult SetDeviceLibrary(sbIDeviceLibrary *aDeviceLibrary)
virtual nsresult Initialize(sbBaseDevice *aDevice)
nsInterfaceHashtableMT< nsStringHashKey, sbBaseDeviceVolume > mVolumeLibraryGUIDTable