42 #include <sbIDeviceManager.h>
45 #include <nsAutoPtr.h>
46 #include <nsServiceManagerUtils.h>
91 NS_ENSURE_ARG_POINTER(aUserID);
102 sbIPDFairPlayEvent::GetAccountName(nsAString& aAccountName)
104 aAccountName.Assign(mAccountName);
114 sbIPDFairPlayEvent::GetUserName(nsAString& aUserName)
116 aUserName.Assign(mUserName);
126 sbIPDFairPlayEvent::GetMediaItem(
sbIMediaItem** aMediaItem)
128 NS_ENSURE_ARG_POINTER(aMediaItem);
129 NS_IF_ADDREF(*aMediaItem = mMediaItem);
160 nsAString& aAccountName,
161 nsAString& aUserName,
165 NS_ENSURE_ARG_POINTER(aFairPlayEvent);
166 NS_ENSURE_ARG_POINTER(aDevice);
173 NS_ENSURE_TRUE(
event, NS_ERROR_OUT_OF_MEMORY);
174 rv =
event->InitEvent(aDevice,
180 NS_ENSURE_SUCCESS(rv, rv);
183 NS_ADDREF(*aFairPlayEvent =
event);
227 sbIPDFairPlayEvent::InitEvent(
sbIDevice* aDevice,
230 nsAString& aAccountName,
231 nsAString& aUserName,
235 NS_ASSERTION(aDevice,
"aDevice is null");
241 nsCOMPtr<sbIDeviceManager2>
242 manager = do_GetService(
"@songbirdnest.com/Songbird/DeviceManager;2", &rv);
243 NS_ENSURE_SUCCESS(rv, rv);
246 rv = aDevice->GetState(&deviceState);
247 NS_ENSURE_SUCCESS(rv, rv);
250 rv = manager->CreateEvent(aType,
255 getter_AddRefs(mDeviceEvent));
256 NS_ENSURE_SUCCESS(rv, rv);
257 mSBDeviceEvent = do_QueryInterface(mDeviceEvent, &rv);
258 NS_ENSURE_SUCCESS(rv, rv);
262 mAccountName.Assign(aAccountName);
263 mUserName.Assign(aUserName);
264 mMediaItem = aMediaItem;
static sbDeviceEvent * CreateEvent()
virtual ~sbIPDFairPlayEvent()
Base iPod device event interface.
readonly attribute unsigned long deviceState
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
iPod device event interface for FairPlay events.
Songbird iPod Device FairPlay Event Definitions.
const unsigned long STATE_IDLE