50 #include <sbIDeviceProperties.h>
51 #include <sbIMediacoreManager.h>
52 #include <sbIMediacorePlaybackControl.h>
53 #include <sbIMediacoreSequencer.h>
54 #include <sbIMediacoreStatus.h>
55 #include <sbIMediaListView.h>
62 #include <nsIClassInfoImpl.h>
63 #include <nsIProgrammingLanguage.h>
64 #include <nsIPropertyBag2.h>
65 #include <nsIWritablePropertyBag.h>
66 #include <nsIWritablePropertyBag2.h>
68 #include <nsServiceManagerUtils.h>
69 #include <nsIPromptService.h>
71 #include <nsThreadUtils.h>
157 sbIPDDevice::Connect()
162 rv = ConnectInternal();
170 sbIPDDevice::ConnectInternal()
184 NS_ENSURE_SUCCESS(rv, rv);
187 nsCOMPtr<nsIPropertyBag2>
properties = do_QueryInterface(mCreationProperties,
189 NS_ENSURE_SUCCESS(rv, rv);
192 rv = properties->GetPropertyAsAString(NS_LITERAL_STRING(
"MountPath"),
194 NS_ENSURE_SUCCESS(rv, rv);
197 rv = properties->GetPropertyAsAString(NS_LITERAL_STRING(
"FirewireGUID"),
199 if (NS_SUCCEEDED(rv)) {
201 ((
"Connect %s\n", NS_LossyConvertUTF16toASCII(mFirewireGUID).
get()));
203 FIELD_LOG((
"Connect could not get iPod Firewire GUID.\n"));
207 rv = CapabilitiesConnect();
208 NS_ENSURE_SUCCESS(rv, rv);
212 NS_ENSURE_SUCCESS(rv, rv);
216 NS_ENSURE_SUCCESS(rv, rv);
219 rv = LibraryConnect();
220 NS_ENSURE_SUCCESS(rv, rv);
224 NS_ENSURE_SUCCESS(rv, rv);
230 mConnected = PR_TRUE;
235 NS_ENSURE_SUCCESS(rv, rv);
240 NS_ENSURE_SUCCESS(rv, rv);
243 rv = SetUpIfNeeded();
244 NS_ENSURE_SUCCESS(rv, rv);
287 nsIVariant** _retval)
300 nsIVariant* aPrefValue)
303 NS_ENSURE_ARG_POINTER(aPrefValue);
312 rv = ReqPushSetNamedValue(REQUEST_SET_PREF, aPrefName, aPrefValue);
313 NS_ENSURE_SUCCESS(rv, rv);
327 nsIPropertyBag2* aRequestParameters)
330 LOG(
"Enter: sbIPDDevice::SubmitRequest\n");
357 LOG(
"Enter: sbIPDDevice::Eject\n");
362 nsCOMPtr<sbIMediacoreManager> mm =
364 NS_ENSURE_SUCCESS(rv, rv);
366 nsCOMPtr<sbIMediacoreSequencer> sequencer;
367 rv = mm->GetSequencer(getter_AddRefs(sequencer));
368 NS_ENSURE_SUCCESS(rv, rv);
370 nsCOMPtr<sbIMediacoreStatus> status;
371 rv = mm->GetStatus(getter_AddRefs(status));
372 NS_ENSURE_SUCCESS(rv, rv);
375 rv = status->GetState(&state);
376 NS_ENSURE_SUCCESS(rv, rv);
385 PRUint32 currentIndex;
386 rv = sequencer->GetViewPosition(¤tIndex);
387 NS_ENSURE_SUCCESS(rv, rv);
390 nsCOMPtr<sbIMediaListView> mediaListView;
391 rv = sequencer->GetView(getter_AddRefs(mediaListView));
392 NS_ENSURE_SUCCESS(rv, rv);
395 nsCOMPtr<sbIMediaItem> mediaItem;
396 rv = mediaListView->GetItemByIndex(currentIndex, getter_AddRefs(mediaItem));
397 NS_ENSURE_SUCCESS(rv, rv);
400 nsCOMPtr<sbILibrary> library;
401 rv = mediaItem->GetLibrary(getter_AddRefs(library));
402 NS_ENSURE_SUCCESS(rv, rv);
406 rv = mDeviceLibrary->Equals(library, &equal);
407 NS_ENSURE_SUCCESS(rv, rv);
413 NS_ENSURE_SUCCESS(rv, rv);
417 nsCOMPtr<sbIMediacorePlaybackControl> playbackControl;
418 rv = mm->GetPlaybackControl(getter_AddRefs(playbackControl));
419 NS_ENSURE_SUCCESS(rv, rv);
421 if (playbackControl) {
422 rv = playbackControl->Stop();
423 NS_ENSURE_SUCCESS(rv, rv);
463 sbIPDDevice::GetName(nsAString&
aName)
467 LOG(
"Enter: sbIPDDevice::GetName\n");
469 rv = mProperties->GetPropertyAsAString(NS_LITERAL_STRING(
"FriendlyName"),
471 NS_ENSURE_SUCCESS(rv, rv);
484 sbIPDDevice::GetProductName(nsAString& aProductName)
491 nsAutoString vendorName;
494 NS_ENSURE_SUCCESS(rv, rv);
497 rv = mProperties->GetPropertyAsAString
500 NS_ENSURE_SUCCESS(rv, rv);
504 nsAutoString modelNumber;
507 NS_ENSURE_SUCCESS(rv, rv);
510 rv = mProperties->GetPropertyAsAString
513 NS_ENSURE_SUCCESS(rv, rv);
515 if (modelNumber.IsEmpty()) {
521 if (!vendorName.IsEmpty()) {
522 nsTArray<nsString> params;
523 NS_ENSURE_TRUE(params.AppendElement(vendorName), NS_ERROR_OUT_OF_MEMORY);
524 NS_ENSURE_TRUE(params.AppendElement(modelNumber), NS_ERROR_OUT_OF_MEMORY);
527 productName.Assign(modelNumber);
531 aProductName.Assign(productName);
542 sbIPDDevice::GetControllerId(nsID** aControllerId)
545 NS_ENSURE_ARG_POINTER(aControllerId);
548 nsID* pId =
static_cast<nsID*
>(NS_Alloc(
sizeof(nsID)));
549 NS_ENSURE_TRUE(pId, NS_ERROR_OUT_OF_MEMORY);
552 *pId = mControllerID;
553 *aControllerId = pId;
564 sbIPDDevice::GetId(nsID** aId)
567 NS_ENSURE_ARG_POINTER(aId);
570 nsID* pId =
static_cast<nsID*
>(NS_Alloc(
sizeof(nsID)));
571 NS_ENSURE_TRUE(pId, NS_ERROR_OUT_OF_MEMORY);
586 sbIPDDevice::GetConnected(PRBool* aConnected)
588 NS_ENSURE_ARG_POINTER(aConnected);
589 *aConnected = mConnected;
600 sbIPDDevice::GetThreaded(PRBool* aThreaded)
602 NS_ENSURE_ARG_POINTER(aThreaded);
603 *aThreaded = PR_TRUE;
615 NS_ENSURE_ARG_POINTER(aCapabilities);
616 NS_ADDREF(*aCapabilities = mCapabilities);
628 NS_ENSURE_ARG_POINTER(aContent);
629 NS_ENSURE_STATE(mDeviceContent);
630 NS_ADDREF(*aContent = mDeviceContent);
671 sbIPDDevice::GetParameters(nsIPropertyBag2** aParameters)
674 NS_ENSURE_ARG_POINTER(aParameters);
680 nsCOMPtr<nsIPropertyBag2>
parameters = do_QueryInterface(mCreationProperties,
682 NS_ENSURE_SUCCESS(rv, rv);
683 NS_ADDREF(*aParameters = parameters);
697 NS_ENSURE_ARG_POINTER(aProperties);
700 NS_ADDREF(*aProperties = mProperties);
716 LOG(
"Enter: sbIPDDevice::GetState\n");
723 LOG(
"Enter: sbIPDDevice::SetState\n");
770 nsIInputStream** retval)
786 nsIPropertyBag* aProperties) :
790 mPrefConnected(PR_FALSE),
792 mIPodPrefsDirty(PR_FALSE),
793 mSyncPlaylistListDirty(PR_FALSE),
796 mConnectLock(nsnull),
797 mControllerID(aControllerID),
798 mCreationProperties(aProperties),
800 mITDBDirty(PR_FALSE),
802 mConnected(PR_FALSE),
808 LOG(
"Enter: sbIPDDevice::sbIPDDevice\n");
811 NS_ASSERTION(aProperties,
"aProperties is null");
822 LOG(
"Enter: sbIPDDevice::~sbIPDDevice\n");
841 sbIPDDevice::DBConnect()
844 nsAutoMonitor autoDBLock(mDBLock);
847 GError *gError = nsnull;
851 nsCString mountPath = NS_ConvertUTF16toUTF8(mMountPath);
854 mITDBDevice = itdb_device_new();
855 NS_ENSURE_TRUE(mITDBDevice, NS_ERROR_OUT_OF_MEMORY);
856 itdb_device_set_mountpoint(mITDBDevice, mountPath.get());
860 if (!IsFileSystemSupported()) {
863 sbIPDVariant(NS_ISUPPORTS_CAST(sbIDevice*,
this)).
get());
864 NS_ENSURE_SUCCESS(NS_ERROR_FAILURE, NS_ERROR_FAILURE);
870 rv = mCreationProperties2->HasKey(NS_LITERAL_STRING(
"HFSPlusReadOnly"),
872 NS_ENSURE_SUCCESS(rv, rv);
876 sbIPDVariant(NS_ISUPPORTS_CAST(sbIDevice*,
this)).
get());
877 NS_ENSURE_SUCCESS(NS_ERROR_FAILURE, NS_ERROR_FAILURE);
882 gchar* itdbPath = itdb_get_itunesdb_path(mountPath.get());
883 sbAutoGMemPtr autoITDBPath(itdbPath);
884 if (itdbPath == nsnull) {
885 FIELD_LOG((
"Missing iTunesDB, creating a new one.\n"));
886 if (!itdb_init_ipod(mountPath.get(), nsnull,
"iPod", &gError)) {
888 if (gError->message) {
891 g_error_free(gError);
893 NS_ENSURE_SUCCESS(NS_ERROR_UNEXPECTED, NS_ERROR_UNEXPECTED);
900 NS_ENSURE_SUCCESS(rv, rv);
903 mITDBDirty = PR_FALSE;
904 mITDB = itdb_parse(mountPath.get(), &gError);
906 if (gError->message) {
909 g_error_free(gError);
912 NS_ENSURE_TRUE(mITDB, NS_ERROR_FAILURE);
915 mMasterPlaylist = itdb_playlist_mpl(mITDB);
916 NS_ENSURE_TRUE(mMasterPlaylist, NS_ERROR_FAILURE);
919 NS_ConvertUTF8toUTF16 friendlyName(mMasterPlaylist->name);
922 rv = mProperties->SetPropertyInternal(NS_LITERAL_STRING(
"FriendlyName"),
924 NS_ENSURE_SUCCESS(rv, rv);
935 sbIPDDevice::DBDisconnect()
938 nsAutoMonitor autoDBLock(mDBLock);
944 mITDBDirty = PR_FALSE;
945 mMasterPlaylist = NULL;
947 itdb_device_free(mITDBDevice);
957 sbIPDDevice::LibraryConnect()
963 libID.AssignLiteral(
"iPod");
964 libID.Append(mFirewireGUID);
965 libID.AppendLiteral(
"@devices.library.songbirdnest.com");
967 NS_ENSURE_TRUE(mDeviceLibrary, NS_ERROR_OUT_OF_MEMORY);
969 NS_ENSURE_SUCCESS(rv, rv);
972 mDeviceLibraryML = do_QueryInterface
975 NS_ENSURE_SUCCESS(rv, rv);
979 NS_ENSURE_SUCCESS(rv, rv);
985 NS_LITERAL_STRING(
"0"));
986 NS_ENSURE_SUCCESS(rv, rv);
997 sbIPDDevice::LibraryDisconnect()
1000 if (mDeviceLibrary) {
1004 mDeviceLibrary = nsnull;
1005 mDeviceLibraryML = nsnull;
1016 sbIPDDevice::InitSysInfo()
1018 GError* gError = nsnull;
1022 if (!mFirewireGUID.IsEmpty()) {
1023 gchar* fwGUID = itdb_device_get_sysinfo(mITDBDevice,
"FirewireGuid");
1026 itdb_device_set_sysinfo(mITDBDevice,
1028 NS_ConvertUTF16toUTF8(mFirewireGUID).
get());
1031 success = itdb_device_write_sysinfo(mITDBDevice, &gError);
1034 if (gError->message)
1036 g_error_free(gError);
1039 NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
1066 sbIPDDevice::StatsInitialize()
1070 mLastStatsUpdate = PR_IntervalNow();
1084 sbIPDDevice::StatsFinalize()
1097 sbIPDDevice::StatsUpdate(PRBool aForceUpdate)
1100 PRUint64 musicSpace = 0;
1101 PRUint64 musicTimeMS = 0;
1102 PRUint32 musicTrackCount = 0;
1109 PRIntervalTime lastUpdateInterval;
1110 if (!aForceUpdate) {
1111 lastUpdateInterval = PR_IntervalNow() - mLastStatsUpdate;
1112 if (lastUpdateInterval < mStatsUpdatePeriod)
1117 mLastStatsUpdate = PR_IntervalNow();
1121 trackList = mITDB->tracks;
1124 Itdb_Track* track = (Itdb_Track *) trackList->data;
1125 trackList = trackList->next;
1128 if ((track->mediatype == 0) || (track->mediatype == 1)) {
1129 musicSpace += track->size;
1130 musicTimeMS += track->tracklen;
1136 success = itdb_device_get_storage_info(mITDB->device, &capacity, &free);
1137 NS_ENSURE_TRUE(success, );
1138 totalUsed = capacity - free;
1141 mProperties->SetPropertyInternal
1142 (NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#capacity"),
1144 mProperties->SetPropertyInternal
1145 (NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#freeSpace"),
1147 mProperties->SetPropertyInternal
1148 (NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#totalUsedSpace"),
1150 mProperties->SetPropertyInternal
1151 (NS_LITERAL_STRING(
"http://songbirdnest.com/device/1.0#musicUsedSpace"),
1178 sbIPDDevice::CreateAndDispatchFairPlayEvent(PRUint32 aType,
1180 nsAString& aAccountName,
1181 nsAString& aUserName,
1188 nsRefPtr<sbIPDFairPlayEvent> fairPlayEvent;
1196 NS_ENSURE_SUCCESS(rv, rv);
1199 nsCOMPtr<sbIDeviceEvent>
1200 event = do_QueryInterface
1202 NS_ENSURE_SUCCESS(rv, rv);
1203 rv = DispatchEvent(
event, aAsync, nsnull);
1204 NS_ENSURE_SUCCESS(rv, rv);
1227 NS_ENSURE_SUCCESS(rv, rv);
1230 mConnectLock = PR_NewRWLock(PR_RWLOCK_RANK_NONE,
"sbIPDDevice::mConnectLock");
1231 NS_ENSURE_TRUE(mConnectLock, NS_ERROR_OUT_OF_MEMORY);
1233 mDBLock = nsAutoMonitor::NewMonitor(
"sbIPDDevice::mDBLock");
1234 NS_ENSURE_TRUE(mDBLock, NS_ERROR_OUT_OF_MEMORY);
1237 mFileProtocolHandler =
1238 do_CreateInstance(
"@mozilla.org/network/protocol;1?name=file", &rv);
1239 NS_ENSURE_SUCCESS(rv, rv);
1243 do_GetService(
"@songbirdnest.com/Songbird/Properties/PropertyManager;1",
1245 NS_ENSURE_SUCCESS(rv, rv);
1249 do_GetService(
"@songbirdnest.com/Songbird/library/Manager;1", &rv);
1250 NS_ENSURE_SUCCESS(rv, rv);
1254 do_GetService(
"@songbirdnest.com/Songbird/IPDEventHandler;1", &rv);
1255 NS_ENSURE_SUCCESS(rv, rv);
1258 nsCOMPtr<nsIStringBundleService>
1259 stringBundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
1260 NS_ENSURE_SUCCESS(rv, rv);
1262 getter_AddRefs(mLocale));
1263 NS_ENSURE_SUCCESS(rv, rv);
1266 mCreationProperties2 = do_QueryInterface(mCreationProperties, &rv);
1267 NS_ENSURE_SUCCESS(rv, rv);
1270 rv = mLibraryManager->GetMainLibrary(getter_AddRefs(mSBMainLib));
1271 NS_ENSURE_SUCCESS(rv, rv);
1272 mSBMainML = do_QueryInterface(mSBMainLib, &rv);
1273 NS_ENSURE_SUCCESS(rv, rv);
1276 rv = CreateDeviceID(&mDeviceID);
1277 NS_ENSURE_SUCCESS(rv, rv);
1281 NS_ENSURE_TRUE(mIPDStatus, NS_ERROR_OUT_OF_MEMORY);
1283 NS_ENSURE_SUCCESS(rv, rv);
1287 NS_ENSURE_TRUE(mDeviceContent, NS_ERROR_OUT_OF_MEMORY);
1288 rv = mDeviceContent->Initialize();
1289 NS_ENSURE_SUCCESS(rv, rv);
1292 rv = MapInitialize();
1293 NS_ENSURE_SUCCESS(rv, rv);
1296 rv = PrefInitialize();
1297 NS_ENSURE_SUCCESS(rv, rv);
1300 rv = StatsInitialize();
1301 NS_ENSURE_SUCCESS(rv, rv);
1325 mDeviceContent->Finalize();
1326 mDeviceContent = nsnull;
1330 mProperties->Finalize();
1331 mProperties = nsnull;
1334 nsAutoMonitor::DestroyMonitor(mDBLock);
1339 PR_DestroyRWLock(mConnectLock);
1340 mConnectLock = nsnull;
1347 mIPDStatus = nsnull;
1350 mCreationProperties = nsnull;
1351 mFileProtocolHandler = nsnull;
1352 mPropertyManager = nsnull;
1353 mLibraryManager = nsnull;
1354 mSBMainLib = nsnull;
1356 mIPodEventHandler = nsnull;
1370 NS_ENSURE_TRUE(mProperties, NS_ERROR_OUT_OF_MEMORY);
1371 rv = mProperties->Initialize();
1372 NS_ENSURE_SUCCESS(rv, rv);
1385 sbIPDDevice::ImportDatabase()
1393 NS_LITERAL_STRING(
"0"));
1394 NS_ENSURE_SUCCESS(rv, rv);
1397 rv = ImportTracks();
1398 NS_ENSURE_SUCCESS(rv, rv);
1401 rv = ImportPlaylists();
1402 NS_ENSURE_SUCCESS(rv, rv);
1417 sbIPDDevice::DBFlush()
1419 GError *gError = nsnull;
1422 nsAutoMonitor autoDBLock(mDBLock);
1429 if (!itdb_write(mITDB, &gError)) {
1431 if (gError->message)
1433 g_error_free(gError);
1436 NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
1441 if (!itdb_shuffle_write(mITDB, &gError)) {
1443 if (gError->message)
1445 g_error_free(gError);
1448 NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_FAILURE);
1452 mITDBDirty = PR_FALSE;
1455 StatsUpdate(PR_TRUE);
1466 sbIPDDevice::CapabilitiesConnect()
1473 NS_ENSURE_SUCCESS(rv, rv);
1474 rv = mCapabilities->Init();
1475 NS_ENSURE_SUCCESS(rv, rv);
1478 PRUint32 functionTypeList[] =
1480 rv = mCapabilities->SetFunctionTypes(functionTypeList,
1481 NS_ARRAY_LENGTH(functionTypeList));
1482 NS_ENSURE_SUCCESS(rv, rv);
1487 rv = mCapabilities->AddContentTypes
1490 NS_ARRAY_LENGTH(contentTypeList));
1491 NS_ENSURE_SUCCESS(rv, rv);
1497 NS_ENSURE_SUCCESS(rv, rv);
1500 rv = mCapabilities->ConfigureDone();
1501 NS_ENSURE_SUCCESS(rv, rv);
1520 NS_ASSERTION(aMediaItem,
"aMediaItem is null");
1521 NS_ASSERTION(aIPodID,
"aIPodID is null");
1528 nsAutoString iPodIDStr;
1529 rv = aMediaItem->GetProperty
1532 NS_ENSURE_SUCCESS(rv, rv);
1535 int numScanned = PR_sscanf(NS_ConvertUTF16toUTF8(iPodIDStr).
get(),
1538 NS_ENSURE_TRUE(numScanned, NS_ERROR_FAILURE);
1554 sbIPDDevice::CreateDeviceID(nsID* aDeviceID)
1557 NS_ASSERTION(aDeviceID,
"aDeviceID is null");
1564 rv = GetParameters(getter_AddRefs(parameters));
1565 NS_ENSURE_SUCCESS(rv, rv);
1568 PRUint8* buffer = (PRUint8*) aDeviceID;
1569 memset(buffer, 0,
sizeof(nsID));
1574 rv = AddNSIDHash(buffer,
1580 "Couldn't add the device manufaturer to the device ID hash.");
1581 rv = AddNSIDHash(buffer, offset, parameters,
1585 "Couldn't add the device model number to the device ID hash.");
1586 rv = AddNSIDHash(buffer, offset, parameters,
1590 "Couldn't add the device serial number to the device ID hash.");
1607 sbIPDDevice::AddNSIDHash(
unsigned char* aBuffer,
1609 nsIPropertyBag2* aPropBag,
1610 const nsAString& aProp)
1613 nsresult rv = aPropBag->GetPropertyAsACString(aProp, value);
1614 NS_ENSURE_SUCCESS(rv, rv);
1616 const nsCString::char_type *
p, *end;
1618 for (value.BeginReading(&p, &end); p < end; ++
p) {
1619 PRUint32
data = (*p) & 0x7F;
1620 data <<= (aOffset / 7 + 1) % 8;
1621 PRInt32 index = (aOffset + 6) / 8;
1623 aBuffer[(index - 1) %
sizeof(nsID)] ^= (data & 0xFF00) >> 8;
1624 aBuffer[index %
sizeof(nsID)] ^= (data & 0xFF);
1640 sbIPDDevice::IsFileSystemSupported()
1646 return itdb_device_get_storage_info(mITDBDevice, &capacity, &free);
1652 sbIPDDevice::SetUpIfNeeded()
1658 rv = GetIsSetUp(&isSetUp);
1659 NS_ENSURE_SUCCESS(rv, rv);
1664 sbIPDVariant(NS_ISUPPORTS_CAST(sbIDevice*,
this)).
get());
1674 NS_ENSURE_ARG(aCurrentStatus);
1680 return NS_ERROR_NOT_IMPLEMENTED;
1684 NS_ENSURE_ARG_POINTER(aCanReformat);
1685 *aCanReformat = PR_FALSE;
static sbDeviceEvent * CreateEvent()
NS_IMETHOD GetPreference(const nsAString &aPrefName, nsIVariant **_retval)
const PRUint32 FUNCTION_AUDIO_PLAYBACK
#define IPOD_STATS_UPDATE_PERIOD
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 IPOD_LOCALE_BUNDLE_PATH
const char * sbIPDSupportedAudioMediaList[]
[UNIMPLEMENTED UNTIL AFTER 0.3]
NS_IMETHOD GetIsDirectTranscoding(PRBool *aIsDirect)
Songbird iPod Device Utility Definitions.
static nsresult BulkSetProperty(sbIMediaList *aMediaList, const nsAString &aPropertyId, const nsAString &aPropertyValue, sbIPropertyArray *aPropertyFilter=nsnull, PRInt32 *aAbortFlag=nsnull)
virtual nsresult InitializeProperties()
NS_IMETHOD GetPrimaryLibrary(sbIDeviceLibrary **aPrimaryLibrary)
NS_IMETHOD GetPreviousState(PRUint32 *aState)
NS_SCRIPTABLE NS_IMETHOD SetWarningDialogEnabled(const nsAString &aWarning, PRBool aEnabled)
NS_IMPL_QUERY_INTERFACE2_CI(sbCDDeviceMarshall, sbIDeviceMarshall, sbICDDeviceListener) NS_IMPL_CI_INTERFACE_GETTER2(sbCDDeviceMarshall
NS_SCRIPTABLE NS_IMETHOD OpenInputStream(nsIURI *aURI, nsIInputStream **retval)
nsresult GetCurrentStatus(sbIDeviceStatus **aCurrentStatus)
NS_SCRIPTABLE NS_IMETHOD GetWarningDialogEnabled(const nsAString &aWarning, PRBool *_retval)
virtual nsresult DeviceSpecificDisconnect()
#define SB_PROPERTY_HIDDEN
PRUint32 sbIPDSupportedMediaListLength
#define SB_PROPERTY_DEVICE_PERSISTENT_ID
Base iPod device event interface.
NS_IMETHOD SyncLibraries(void)
#define SB_DEVICE_PROPERTY_MANUFACTURER
[UNIMPLEMENTED UNTIL AFTER 0.3]
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICE NS_DECL_NSICLASSINFO sbIPDDevice(const nsID &aControllerID, nsIPropertyBag *aProperties)
friend class sbIPDLibrary
const PRUint32 CONTENT_PLAYLIST
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
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)
readonly attribute nsIPropertyBag2 parameters
#define SONGBIRD_DEVICECAPABILITIES_CONTRACTID
nsresult ReqProcessingStart()
NS_IMETHOD SupportsMediaItem(sbIMediaItem *aMediaItem, sbIDeviceSupportsItemCallback *aCallback)
NS_DECL_ISUPPORTS static NS_DECL_SBIDEVICECONTENT sbDeviceContent * New()
NS_IMETHOD GetDefaultLibrary(sbIDeviceLibrary **aDefaultLibrary)
readonly attribute AString name
Songbird iPod Device Definitions.
virtual nsresult InitializeProperties()
nsresult PromptForEjectDuringPlayback(PRBool *aEject)
_updateTextAndScrollDataForFrame aContent
Songbird iPod Device FairPlay Event Definitions.
const unsigned long EVENT_IPOD_NOT_INITIALIZED
Songbird iPod Device Logging Definitions.
NS_IMETHOD CancelRequests()
Media library abstraction.
attribute unsigned long state
NS_IMETHOD GetIsBusy(PRBool *aIsBusy)
NS_IMETHOD ExportToDevice(sbIDeviceLibrary *aDevLibrary, sbILibraryChangeset *aChangeset)
readonly attribute sbIDeviceProperties properties
nsresult RemoveLibrary(sbIDeviceLibrary *aDevLib)
const unsigned long EVENT_IPOD_HFSPLUS_READ_ONLY
friend class sbIPDProperties
NS_IMETHOD GetSupportsReformat(PRBool *_retval)
const PRUint32 CONTENT_AUDIO
NS_IMETHOD SubmitRequest(PRUint32 aRequest, nsIPropertyBag2 *aRequestParameters)
NS_IMETHOD GetCanDisconnect(PRBool *aCanDisconnect)
const char * sbIPDSupportedMediaList[]
#define SB_DEVICE_PROPERTY_SERIAL_NUMBER
const unsigned long EVENT_IPOD_UNSUPPORTED_FILE_SYSTEM
#define SB_PROPERTY_AVAILABILITY
NS_IMPL_CI_INTERFACE_GETTER2(sbDataRemoteWrapper, sbIDataRemote, nsIClassInfo) sbDataRemoteWrapper
nsresult InitializeDeviceLibrary(sbDeviceLibrary *aDevLib, const nsAString &aId, nsIURI *aLibraryLocation)
NS_IMETHOD ImportFromDevice(sbILibrary *aImportToLibrary, sbILibraryChangeset *aImportChangeset)
#define SB_DEVICE_PROPERTY_MODEL
static nsresult DeleteUnavailableItems(sbIMediaList *aMediaList)
NS_IMETHOD SetState(PRUint32 aState)
readonly attribute AString productName
NS_IMETHOD SetPreference(const nsAString &aPrefName, nsIVariant *aPrefValue)
void FinalizeDeviceLibrary(sbIDeviceLibrary *aDevLib)
NS_IMETHOD SetDefaultLibrary(sbIDeviceLibrary *aDefaultLibrary)
PRUint32 sbIPDSupportedAudioMediaListLength
#define SB_SYNC_PARTNER_PREF
nsresult AddLibrary(sbIDeviceLibrary *aDevLib)