public void Play(string[] filenames)
 {
     for (int i = 0; i < filenames.Length; i++)
     {
         PlayedFiles.Enqueue(filenames[i]);
     }
 }
        public static ObservableCollection <VideoFolder> LoadChildrenFiles(IFolder Parentdir, bool newpath = false)
        {
            ObservableCollection <VideoFolder> Toparent = new ObservableCollection <VideoFolder>();

            List <FileInfo> files = FileExplorerCommonHelper.GetFilesByExtensions(Parentdir.Directory, formats);

            if (files.Count > 0)
            {
                ApplicationService.CreateLastSeenFolder(Parentdir);
                ApplicationService.LoadLastSeenFile(Parentdir);
            }

            for (int i = 0; i < files.Count; i++)
            {
                VideoFolderChild vd;
                PlayedFiles      pdf = (PlayedFiles)LastSeenHelper.GetProgress(Parentdir, files[i].Name);
                vd = new VideoFolderChild(Parentdir, files[i])
                {
                    FileSize = FileExplorerCommonHelper.FileSizeConverter(files[i].Length),
                    FileType = FileType.File
                };
                if (pdf != null)
                {
                    vd.LastPlayedPoisition = pdf;
                }
                else
                {
                    vd.LastPlayedPoisition = new PlayedFiles(files[i].Name);
                }


                Toparent.Add(vd);
            }
            return(Toparent);
        }
Exemple #3
0
        public void SetLastSeen(VideoFolderChild videoFolderChild)
        {
            PlayedFiles pdf = applicationService.SavedLastSeenCollection.GetLastSeen(videoFolderChild.FileInfo.Name) as PlayedFiles;

            if (pdf != null)
            {
                videoFolderChild.LastPlayedPoisition = pdf;
            }
            else
            {
                videoFolderChild.LastPlayedPoisition = new PlayedFiles(videoFolderChild.FileInfo.Name);
            }
        }
Exemple #4
0
        public static void RemoveLastSeen(IFolder ifolder, ILastSeen obj)
        {
            if (ifolder.LastSeenCollection == null)
            {
                return;
            }
            PlayedFiles playdfile = obj as PlayedFiles;

            if (ifolder.LastSeenCollection.Contains(playdfile))
            {
                ifolder.LastSeenCollection.Remove((PlayedFiles)obj);
            }
        }
        public static VideoFolder LoadChildrenFiles(DirectoryInfo directoryInfo, bool newpath = false)
        {
            IFolder Parentdir = new VideoFolder(directoryInfo.Parent.FullName);

            ApplicationService.CreateLastSeenFolder(Parentdir);
            ApplicationService.LoadLastSeenFile(Parentdir);
            FileInfo         fileInfo = new FileInfo(directoryInfo.FullName);
            VideoFolderChild vd;
            PlayedFiles      pdf = (PlayedFiles)LastSeenHelper.GetProgress(Parentdir, fileInfo.Name);

            vd = new VideoFolderChild(Parentdir, fileInfo)
            {
                FileSize = FileExplorerCommonHelper.FileSizeConverter(fileInfo.Length),
                FileType = FileType.File
            };
            if (pdf != null)
            {
                vd.LastPlayedPoisition = pdf;
            }
            else
            {
                vd.LastPlayedPoisition = new PlayedFiles(fileInfo.Name);
            }
            IEnumerable <FileInfo> files = null;

            using (ShellObject shell = ShellObject.FromParsingName(vd.FilePath))
            {
                IShellProperty prop = shell.Properties.System.Media.Duration;
                vd.Duration = prop.FormatForDisplay(PropertyDescriptionFormat.ShortTime);
                var duration = shell.Properties.System.Media.Duration;
                if (duration.Value != null)
                {
                    vd.MaxiProgress = double.Parse(duration.Value.ToString());
                }

                files = FileExplorerCommonHelper.GetSubtitleFiles(directoryInfo.Parent);
            }
            vd.SubPath = FileExplorerCommonHelper.MatchSubToMedia(vd.Name, files);
            return(vd);
        }
 public void Play(string filename)
 {
     PlayedFiles.Enqueue(filename);
 }