Esempio n. 1
0
        public NodeItem Create(ItemDesc aDesc, ref UInt32 aNextId)
        {
            NodeItem item = new NodeItem(aNextId, aDesc.Id, aDesc.LibItem);

            aNextId++;
            return(item);
        }
Esempio n. 2
0
        public void Add(LibraryItem aItem)
        {
            ItemDesc desc = new ItemDesc();

            desc.LibItem = aItem;
            desc.Id      = iNextId;
            iNextId++;

            foreach (TopLevelContainer c in iTopLevelContainerList)
            {
                c.Builder.Add(c.Container, desc, ref iNextId);
            }
        }
Esempio n. 3
0
        public void Add(NodeContainer aParent, ItemDesc aDesc, ref UInt32 aNextId)
        {
            string containerKey  = iFactory.ContainerKey(aDesc.LibItem);
            string containerName = iFactory.ContainerName(aDesc.LibItem);

            if (string.IsNullOrEmpty(containerKey))
            {
                containerKey  = "Unknown";
                containerName = "Unknown";
            }

            NodeContainer container = aParent.Container(containerKey);

            if (container == null)
            {
                container = iFactory.Create(containerName, aDesc.LibItem, aNextId);
                aNextId++;
                aParent.Add(containerKey, container);
            }

            iChild.Add(container, aDesc, ref aNextId);
        }
Esempio n. 4
0
        public void Add(NodeContainer aParent, LibraryPlaylist aPlaylist, ref UInt32 aNextId)
        {
            // create the container for the playlist
            NodePlaylist playlist = new NodePlaylist(aPlaylist.Name, aNextId, null);

            aNextId++;

            // given that the ID (from the aNextId variable) is unique, it is easy to construct
            // a unique key for the playlist - having <playlistname><playlistid> ensures
            // uniqueness and alphabetical sorting
            aParent.Add(playlist.Name + playlist.Id.ToString(), playlist);

            // add all tracks
            foreach (long libItemId in aPlaylist.Items)
            {
                if (iItemDict.ContainsKey(libItemId))
                {
                    ItemDesc desc = iItemDict[libItemId];
                    NodeItem item = new NodeItem(aNextId, desc.Id, desc.LibItem);
                    aNextId++;
                    playlist.Add(item);
                }
            }
        }
Esempio n. 5
0
 public void Add(NodeContainer aParent, ItemDesc aDesc, ref UInt32 aNextId)
 {
     iItemDict.Add(aDesc.LibItem.TrackId, aDesc);
 }
Esempio n. 6
0
        public void Add(NodeContainer aParent, ItemDesc aDesc, ref UInt32 aNextId)
        {
            NodeItem item = iFactory.Create(aDesc, ref aNextId);

            aParent.Add(item);
        }