56 #include <sbIDeviceLibraryMediaSyncSettings.h>
57 #include <sbIDeviceLibrarySyncSettings.h>
70 sbIPDDevice::SyncFromIPodTracks()
73 GList* trackList = mITDB->tracks;
79 Itdb_Track* track = (Itdb_Track*) trackList->data;
80 trackList = trackList->next;
83 SyncFromIPodTrack(track);
98 sbIPDDevice::SyncFromIPodTrack(Itdb_Track* aTrack)
101 NS_ASSERTION(aTrack,
"aTrack is null");
107 nsCOMPtr<sbIMediaItem> mediaItem;
111 getter_AddRefs(mediaItem));
112 NS_ENSURE_SUCCESS(rv, rv);
115 if (aTrack->playcount2 > 0) {
117 guint32 playcount = 0;
119 NS_ENSURE_SUCCESS(rv, rv);
122 playcount += aTrack->playcount2;
123 aTrack->playcount2 = 0;
127 NS_ENSURE_SUCCESS(rv, rv);
145 sbIPDDevice::SyncFromDevice()
151 NS_ENSURE_SUCCESS(rv, rv);
154 rv = SyncFromIPodTracks();
155 NS_ENSURE_SUCCESS(rv, rv);
158 rv = SyncFromOTGPlaylists();
159 NS_ENSURE_SUCCESS(rv, rv);
170 sbIPDDevice::SyncFromOTGPlaylists()
175 GList* playlistList = mITDB->playlists;
176 while (playlistList) {
181 Itdb_Playlist* playlist = (Itdb_Playlist*) playlistList->data;
182 playlistList = playlistList->next;
186 if (playlist->is_otg) {
188 nsCOMPtr<sbIMediaList> mediaList;
189 rv = ImportPlaylist(mSBMainLib, playlist, getter_AddRefs(mediaList));
190 NS_ENSURE_SUCCESS(rv, rv);
192 nsCOMPtr<sbIDeviceLibrarySyncSettings> syncSettings;
193 rv = mDeviceLibrary->GetSyncSettings(getter_AddRefs(syncSettings));
194 NS_ENSURE_SUCCESS(rv, rv);
196 nsCOMPtr<sbIDeviceLibraryMediaSyncSettings> mediaSyncSettings;
198 getter_AddRefs(mediaSyncSettings));
199 NS_ENSURE_SUCCESS(rv, rv);
204 rv = mediaSyncSettings->GetMgmtType(&mgmtType);
205 if (NS_SUCCEEDED(rv) &&
208 mediaSyncSettings->SetPlaylistSelected(mediaList, PR_TRUE);
static nsresult GetOriginMediaItemByDevicePersistentId(sbILibrary *aLibrary, const nsAString &aDevicePersistentId, sbIMediaItem **aItem)
#define SB_PROPERTY_PLAYCOUNT
static nsresult SetLinkedSyncPartner(sbIDevice *aDevice)
const unsigned long MEDIATYPE_AUDIO
virtual PRBool IsRequestAborted()
Songbird iPod Device Definitions.