Exemple #1
0
        public virtual void retrieveListFromAvTransportUri(String _listId, String _avTransportUri, String _avTransportUriMetaData)
        {
            String        cid;
            UPNPMediaList mediaList = this.getList(_listId);

            if (mediaList == null)
            {
                mediaList = this.createListObject(_listId);
                mediaList.listDataReady += mediaList_listDataReadySink;
                mediaList.itemAdded     += mediaList_itemAddedSink;
                lists.Add(_listId, mediaList);
            }

            cid = this.getParameterFromAvTransportUri(_avTransportUri, "cid");
            if (String.IsNullOrWhiteSpace(cid))
            {
                mediaList.retrieveListByMetaData(_avTransportUriMetaData);
            }
            else
            {
                mediaList.retrieveListByContainerId(cid);
            }

            lists[_listId] = mediaList;
        }
Exemple #2
0
        protected virtual MediaItem_Playlist createPlaylistQueue(String _playlistName)
        {
            System.String      givenName, queueIdCreated, containerInfoMetaData;
            CpContentDirectory contentDirectory = Global.getMediaServerManager().getContentDirectory();

            contentDirectory.CreateQueueSync(_playlistName, PlaylistRootContainerId, out givenName, out queueIdCreated, out containerInfoMetaData);

            UPNPMediaList dummyList = new UPNPMediaList();

            dummyList.createItemsFromMetaData(containerInfoMetaData);
            MediaItem_Playlist mediaItem = (MediaItem_Playlist)dummyList.list[0];

            /*Regex regex = new Regex(@"<dc:title>(?<command>.+)</dc:title>");
             * Match match = regex.Match(containerInfoMetaData);
             * if (match.Success)
             * {
             *  givenName = match.Groups["command"].Value;
             * }*/

            if (playlistCreated != null)
            {
                playlistCreated(givenName);
            }

            return(mediaItem);
        }
Exemple #3
0
        public void retrieveListByContainerUpdateId(String _containerUpdateIdValue)
        {
            String[] containerUpdateAry = _containerUpdateIdValue.Split(',');
            String   containerId;

            if (containerUpdateIdEventDisabled)
            {
                return;
            }

            for (int aryIdx = 0; aryIdx < containerUpdateAry.Count(); aryIdx += 2)
            {
                containerId = containerUpdateAry[aryIdx];
                //containerId = System.Uri.UnescapeDataString(containerId);
                UPNPMediaList mediaList = this.getListByContainerId(containerId);
                if (mediaList != null)
                {
                    mediaList.retriveList();
                }
            }
        }
        protected virtual MediaItem_Playlist createPlaylistQueue(String _playlistName)
        {
            System.String givenName, queueIdCreated, containerInfoMetaData;
            CpContentDirectory contentDirectory = Global.getMediaServerManager().getContentDirectory();

            contentDirectory.CreateQueueSync(_playlistName, PlaylistRootContainerId, out givenName, out queueIdCreated, out containerInfoMetaData);

            UPNPMediaList dummyList = new UPNPMediaList();
            dummyList.createItemsFromMetaData(containerInfoMetaData);
            MediaItem_Playlist mediaItem = (MediaItem_Playlist)dummyList.list[0];
            /*Regex regex = new Regex(@"<dc:title>(?<command>.+)</dc:title>");
            Match match = regex.Match(containerInfoMetaData);
            if (match.Success)
            {
                givenName = match.Groups["command"].Value;
            }*/

            if(playlistCreated!=null) playlistCreated(givenName);

            return mediaItem;
        }