44 #include <sbIDeviceLibraryMediaSyncSettings.h>
45 #include <sbIDeviceLibrarySyncSettings.h>
64 NS_ENSURE_ARG_POINTER(aSyncSettings);
68 rv = InitializePrefs();
69 NS_ENSURE_SUCCESS(rv, rv);
71 rv = sbDeviceLibrary::GetSyncSettings(aSyncSettings);
72 NS_ENSURE_SUCCESS(rv, rv);
80 NS_ENSURE_ARG_POINTER(aSyncSettings);
84 rv = InitializePrefs();
85 NS_ENSURE_SUCCESS(rv, rv);
87 rv = sbDeviceLibrary::SetSyncSettings(aSyncSettings);
88 NS_ENSURE_SUCCESS(rv, rv);
95 nsIArray ** aFolderList)
97 NS_ENSURE_ARG_POINTER(aFolderList);
101 rv = InitializePrefs();
102 NS_ENSURE_SUCCESS(rv, rv);
104 rv = sbDeviceLibrary::GetSyncFolderListByType(aContentType,
106 NS_ENSURE_SUCCESS(rv, rv);
113 nsIArray *aFolderList)
115 NS_ENSURE_ARG_POINTER(aFolderList);
119 rv = InitializePrefs();
120 NS_ENSURE_SUCCESS(rv, rv);
122 rv = sbDeviceLibrary::SetSyncFolderListByType(aContentType,
124 NS_ENSURE_SUCCESS(rv, rv);
142 mPrefsInitialized(PR_FALSE)
168 sbIPDLibrary::InitializePrefs()
173 if (mPrefsInitialized)
178 rv = mDevice->GetMgmtType(&mgmtType);
179 NS_ENSURE_SUCCESS(rv, rv);
183 NS_ENSURE_SUCCESS(rv, rv);
185 nsCOMPtr<sbIDeviceLibraryMediaSyncSettings> mediaSyncSettings;
187 getter_AddRefs(mediaSyncSettings));
188 NS_ENSURE_SUCCESS(rv, rv);
190 rv = mediaSyncSettings->SetMgmtType(mgmtType);
191 NS_ENSURE_SUCCESS(rv, rv);
194 nsCOMPtr<nsIArray> syncPlaylistList;
195 rv = mDevice->GetSyncPlaylistList(getter_AddRefs(syncPlaylistList));
196 NS_ENSURE_SUCCESS(rv, rv);
198 rv = mediaSyncSettings->SetSelectedPlaylists(syncPlaylistList);
199 NS_ENSURE_SUCCESS(rv, rv);
202 NS_ENSURE_SUCCESS(rv, rv);
205 mPrefsInitialized = PR_TRUE;
NS_IMETHOD GetSyncFolderListByType(PRUint32 aContentType, nsIArray **_retval)
NS_IMETHOD SetSyncSettings(sbIDeviceLibrarySyncSettings *aSyncSettings)
sbIPDLibrary(sbIPDDevice *aDevice)
const unsigned long MEDIATYPE_AUDIO
NS_IMETHOD SetSyncFolderListByType(PRUint32 aContentType, nsIArray *aFolderList)
NS_IMETHOD GetSyncSettings(sbIDeviceLibrarySyncSettings **aSyncSettings)
Return the list of playlists the user wants to sync from the main library to the device.
Songbird iPod Device Library Definitions.
Songbird iPod Device Definitions.
attribute sbIDeviceLibrarySyncSettings syncSettings