public ContainerSharedPlaylist(ModelPlaylistManager aPlaylistManager, container aContainer) { iLock = new object(); iMetadata = aContainer; iPlaylistManager = aPlaylistManager; }
private void Initialised(object sender, EventArgs e) { ModelPlaylistManager pm = sender as ModelPlaylistManager; if (pm != null) { lock (iLock) { iOpenPlaylistManagers.Remove(pm.PlaylistManager); iOpenPlaylistManagers.Add(pm.PlaylistManager, pm); iMetadata.ChildCount = iOpenPlaylistManagers.Count; } if (EventContentAdded != null) { EventContentAdded(this, EventArgs.Empty); } } }
public void Save(string aName, string aDescription, uint aImageId) { if (iOptionSaveLocation.Native == iLocalPlaylists.Metadata.Title) { iLocalPlaylists.Save(aName, iList); } else { ModelPlaylistManager pm = iSharedPlaylists.Find(iOptionSaveLocation.Native); if (pm == null) { throw new PlaylistManagerNotFoundException(); } ModelPlaylist p = pm.Insert(0, aName, aDescription, aImageId); DidlLite didl = new DidlLite(); didl.AddRange(iList); p.Insert(0, didl); } }
private void PlaylistManagerAdded(object sender, PlaylistManagers.EventArgsPlaylistManager e) { ModelPlaylistManager playlistManager = null; try { playlistManager = new ModelPlaylistManager(e.PlaylistManager, iEventProvider); playlistManager.EventPlaylistManagerInitialised += Initialised; playlistManager.EventSubscriptionError += EventSubscriptionError; playlistManager.Open(); lock (iLock) { iPlaylistManagers.Add(e.PlaylistManager, playlistManager); } } catch (Exception) { // failed to create the playlist manager - a dodgy playlist manger shouldn't crash the application UserLog.WriteLine(string.Format("{0}: Failed to create playlist manager ({1}, {2})", DateTime.Now, e.PlaylistManager.Name, e.PlaylistManager.Device.Model)); } }