Beispiel #1
0
        internal PlayListDocumentIcon(Document doc)
        {
            InitializeComponent();

            Document = doc;

            // Depending on document type this control will be used and displayed slightly differently
            switch (doc.Type)
            {
            case DocumentType.PlayList:
                PlaylistButton.Visibility       = Visibility.Visible;
                CreatePlaylistButton.Visibility = Visibility.Collapsed;
                break;

            case DocumentType.Sound:
                // Display image of sound files
                break;

            case DocumentType.Video:
                // Same VideoIcon image but instead of V we have video name text; Or better we have some screenshots about that video, e.g.created by user during watching the movie, though I don't believe screenshot can help make VW very clean-looking
                break;
            }
            MediaControls.Setup(VirtualWorkspaceWindow.CurrentWindow.GetVlcPlayerHandler(), doc);

            // Manual Binding
            Document.PropertyChanged += Document_PropertyChanged;
            Document_PropertyChanged(null, null);
            MediaControls.PropertyChanged += MediaControls_PropertyChanged;
            PlayingDocument = MediaControls.PlayingDocument;

            NotifyPropertyChanged("DisplayName");
            NotifyPropertyChanged("DisplayText");
        }
Beispiel #2
0
        internal void Update(MULTITUDE.Class.DocumentTypes.Document target)
        {
            // Switch interface elements depending on document type
            switch (target.Type)
            {
            case Class.DocumentTypes.DocumentType.PlayList:
                UpdateInterfaceVisibility((target as Playlist).GetCurrentMedia().Type);
                break;

            case Class.DocumentTypes.DocumentType.Sound:
            case Class.DocumentTypes.DocumentType.Video:
                UpdateInterfaceVisibility(target.Type);
                break;

            default:
                throw new InvalidOperationException("Unsupported document type in Media Player.");
            }

            // Setup playback
            MediaControls.Setup(vlcPlayer, target, true);
        }