상속: MediaItem_TrackContainer
예제 #1
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);
        }
예제 #2
0
        public static MediaItem newFromUpnpItemClass(String _upnpItemClass, String _raumfeldSection)
        {
            MediaItem mediaItem;

            switch (_upnpItemClass)
            {
            case "object.item.audioItem.musicTrack":
                mediaItem = new MediaItem_Track();
                break;

            case "object.container.album.musicAlbum":
                mediaItem = new MediaItem_Album();
                break;

            case "object.container.albumContainer":
                mediaItem = new MediaItem();     // @@@
                break;

            case "object.container.person.musicArtist":
                mediaItem = new MediaItem_Artist();
                break;

            case "object.container.genre.musicGenre":
                mediaItem = new MediaItem_Genre();
                break;

            case "object.container.person.musicComposer":
                mediaItem = new MediaItem_Composer();
                break;

            case "object.container.trackContainer":
                mediaItem = new MediaItem_TrackContainer();
                break;

            case "object.container.trackContainer.napster":
                mediaItem = new MediaItem_TrackContainer();
                break;

            case "object.item.audioItem.audioBroadcast.radio":
                mediaItem = new MediaItem_Radio();
                break;

            case "object.item.audioItem.audioBroadcast.lastFM":
                mediaItem = new MediaItem_LastFm();
                break;

            case "object.item.audioItem.audioBroadcast.rhapsody":
                mediaItem = new MediaItem_RhapsodyRadio();
                break;

            case "object.item.audioItem.audioBroadcast.lineIn":
                mediaItem = new MediaItem_LineIn();
                break;

            case "object.container.playlistContainer":
                mediaItem = new MediaItem_Playlist();
                break;

            case "object.container.playlistContainer.queue":
                if (_raumfeldSection == "Playlists")
                {
                    mediaItem = new MediaItem_Playlist();
                }
                else
                {
                    mediaItem = new MediaItem();
                }
                break;

            case "object.container":
                mediaItem = new MediaItem();
                break;

            case "object.container.storageFolder":
                mediaItem = new MediaItem_StorageFolder();
                break;

            case "object.container.favoritesContainer":
                mediaItem = new MediaItem();
                break;

            case "object.container.playlistContainer.shuffle":
                mediaItem = new MediaItem_Shuffle();
                break;

            default:
                mediaItem = new MediaItem();
                break;
            }

            mediaItem.upnpItemClass = _upnpItemClass;

            return(mediaItem);
        }
예제 #3
0
        public static MediaItem newFromUpnpItemClass(String _upnpItemClass, String _raumfeldSection)
        {
            MediaItem mediaItem;

            switch (_upnpItemClass)
            {
                case "object.item.audioItem.musicTrack":
                    mediaItem = new MediaItem_Track();
                    break;
                case "object.container.album.musicAlbum":
                    mediaItem = new MediaItem_Album();
                    break;
                case "object.container.albumContainer":
                    mediaItem = new MediaItem(); // @@@
                    break;
                case "object.container.person.musicArtist":
                    mediaItem = new MediaItem_Artist();
                    break;
                case "object.container.genre.musicGenre":
                    mediaItem = new MediaItem_Genre();
                    break;
                case "object.container.person.musicComposer":
                    mediaItem = new MediaItem_Composer();
                    break;
                case "object.container.trackContainer":
                    mediaItem = new MediaItem_TrackContainer();
                    break;
                case "object.container.trackContainer.napster":
                    mediaItem = new MediaItem_TrackContainer();
                    break;
                case "object.item.audioItem.audioBroadcast.radio":
                    mediaItem = new MediaItem_Radio();
                    break;
                case "object.item.audioItem.audioBroadcast.lastFM":
                    mediaItem = new MediaItem_LastFm();
                    break;
                case "object.item.audioItem.audioBroadcast.rhapsody":
                    mediaItem = new MediaItem_RhapsodyRadio();
                    break;
                case "object.item.audioItem.audioBroadcast.lineIn":
                    mediaItem = new MediaItem_LineIn();
                    break;
                case "object.container.playlistContainer":
                    mediaItem = new MediaItem_Playlist();
                    break;
                case "object.container.playlistContainer.queue":
                    if (_raumfeldSection == "Playlists")
                    {
                        mediaItem = new MediaItem_Playlist();
                    }
                    else
                    {
                        mediaItem = new MediaItem();
                    }
                    break;
                case "object.container":
                    mediaItem = new MediaItem();
                    break;
                case "object.container.storageFolder":
                    mediaItem = new MediaItem_StorageFolder();
                    break;
                case "object.container.favoritesContainer":
                    mediaItem = new MediaItem();
                    break;
                case "object.container.playlistContainer.shuffle":
                    mediaItem = new MediaItem_Shuffle();
                    break;
                default:
                    mediaItem = new MediaItem();
                    break;
            }

            mediaItem.upnpItemClass = _upnpItemClass;

            return mediaItem;
        }