public ModelPlaylist CreatePlaylist(uint aId) { lock (iLock) { ModelPlaylist playlist; if (iModelPlaylistList.TryGetValue(aId, out playlist)) { playlist.IncRef(); RemoveStalePlaylists(); return(playlist); } playlist = new ModelPlaylist(aId, iServicePlaylistManager); playlist.IncRef(); iIdArray.Lock(); int index = iIdArray.Index(aId); Assert.Check(index != -1); uint token = iTokenArray[index]; playlist.Open(token); iIdArray.Unlock(); iModelPlaylistList.Add(playlist.Id, playlist); RemoveStalePlaylists(); return(playlist); } }
public ModelPlaylist Insert(uint aAfterId, string aName, string aDescription, uint aImageId) { uint newId = iServicePlaylistManager.PlaylistInsertSync(aAfterId, aName, aDescription, aImageId); ModelPlaylist p = new ModelPlaylist(newId, iServicePlaylistManager); p.Open(0); return(p); }
public void DestroyPlaylist(ModelPlaylist aModelPlaylist) { aModelPlaylist.DecRef(); }