示例#1
0
 public MediaViewer(ISettingsViewModel viewmodel, IVideoPlayerController controller)
 {
     InitializeComponent();
     ShouldClose = false;
     this.Closing += MediaViewer_Closing;
     this.Loaded += MediaViewer_Loaded;
     this.View.Video.MediaEnded += (sender, ee) => controller.PlayQueue();
     _viewmodel = viewmodel;
     _viewmodel.PropertyChanged += SettingsChanged;
 }
示例#2
0
        public void Play(IEnumerable<FileNode> content, IVideoPlayerController videoPlayer)
        {
            this._content = new List<FileNode>(content);

            var file = PeekNext(videoPlayer);
            _counter++;

            videoPlayer.Queue.SetQueue(new List<FileNode>() { file });
            videoPlayer.PlayQueue();
        }
        public void Play(IEnumerable<FileNode> content, IVideoPlayerController videoPlayer)
        {
            var folder = _processor.Process(new GetFolderFromStringSettingQuery()
            {
                SettingName = Constants.PlayerPictureFolderSettingName
            });

            var picture = content.AsParallel().SingleOrDefault(x => folder.Contains(x));

            if (picture == null) return;

            videoPlayer.Queue.SetQueue(new List<FileNode>
            {
                picture
            });
            videoPlayer.PlayQueue();
        }
        public void Play(IEnumerable<FileNode> content, IVideoPlayerController videoPlayer)
        {
            var list = new List<FileNode>(content);
            if (list.Count == 0) return;
            var file = list[0];

            if (file.Type == FileType.Audio)
            {
                videoPlayer.Play(list[0]);
            }
            else
            {
                videoPlayer.Queue.SetQueue(new List<FileNode>()
                {
                    file
                });
                videoPlayer.PlayQueue();
            }

            // TODO : Remove this print
            Console.WriteLine("Single File Play Strategy");
        }
示例#5
0
 public void Play(IEnumerable<FileNode> content, IVideoPlayerController videoPlayer)
 {
     videoPlayer.Queue.SetQueue(content);
     videoPlayer.PlayQueue();
 }
        public void Play(IEnumerable<FileNode> content, IVideoPlayerController videoPlayer)
        {
            var statMusicFolder = _processor.Process(new GetFolderFromStringSettingQuery()
            {
                SettingName = Constants.PlayerStatMusicFolderSettingName
            });

            var statVideoFolder = _processor.Process(new GetFolderFromStringSettingQuery()
            {
                SettingName = Constants.PlayerStatVideoFolderSettingName
            });

            var statPictureFolder = _processor.Process(new GetFolderFromStringSettingQuery()
            {
                SettingName = Constants.PlayerStatPictureFolderSettingName
            });

            // TODO : If folder is null then notify user

            var music = content.AsParallel().SingleOrDefault(x => statMusicFolder.Contains(x));
            var video = content.AsParallel().SingleOrDefault(x => statVideoFolder.Contains(x)); // TODO : Fix if no Video exists
            var picture = content.AsParallel().SingleOrDefault(x => statPictureFolder.Contains(x));

            if (video == null)
            {
                var pictureFolder = _processor.Process(new GetFolderFromStringSettingQuery()
                {
                    SettingName = Constants.PlayerPictureFolderSettingName
                });
                video = content.AsParallel().SingleOrDefault(x => pictureFolder.Contains(x));
            }

            var res = new List<FileNode>()
            {
                music, video, picture
            }.Where(x => x != null);

            videoPlayer.Queue.SetQueue(res);

            Console.WriteLine("Using PlayerStatPlayStrategy");

            videoPlayer.PlayQueue();
        }