Exemple #1
0
        public List <EditionJob> ConfigureRenderingJob(IPlayList playlist)
        {
            VideoEditionProperties vep;
            List <EditionJob>      jobs = new List <EditionJob>();
            int response;

            if (playlist.Count == 0)
            {
                WarningMessage(Catalog.GetString("The playlist you want to render is empty."));
                return(null);
            }

            vep = new VideoEditionProperties();
            vep.TransientFor = mainWindow as Gtk.Window;
            response         = vep.Run();
            while (response == (int)ResponseType.Ok)
            {
                if (!vep.SplitFiles && vep.EncodingSettings.OutputFile == "")
                {
                    WarningMessage(Catalog.GetString("Please, select a video file."));
                    response = vep.Run();
                }
                else if (vep.SplitFiles && vep.OutputDir == "")
                {
                    WarningMessage(Catalog.GetString("Please, select an output directory."));
                    response = vep.Run();
                }
                else
                {
                    break;
                }
            }
            if (response == (int)ResponseType.Ok)
            {
                if (!vep.SplitFiles)
                {
                    jobs.Add(new EditionJob(playlist, vep.EncodingSettings));
                }
                else
                {
                    int i = 0;
                    foreach (PlayListPlay play in playlist)
                    {
                        EncodingSettings settings = vep.EncodingSettings;
                        PlayList         pl       = new PlayList();
                        string           filename = String.Format("{0}-{1}.{2}", i.ToString("d4"), play.Name,
                                                                  settings.EncodingProfile.Extension);

                        pl.Add(play);
                        settings.OutputFile = Path.Combine(vep.OutputDir, filename);
                        jobs.Add(new EditionJob(pl, settings));
                        i++;
                    }
                }
            }
            vep.Destroy();
            return(jobs);
        }
        public static Job ConfigureRenderingJob(IPlayList playlist, Gtk.Widget parent)
        {
            VideoEditionProperties vep;
            Job job = null;
            int response;

            vep = new VideoEditionProperties();
            vep.TransientFor = (Gtk.Window)parent.Toplevel;
            response         = vep.Run();
            while (response == (int)ResponseType.Ok && vep.EncodingSettings.OutputFile == "")
            {
                MessagePopup.PopupMessage(parent, MessageType.Warning,
                                          Catalog.GetString("Please, select a video file."));
                response = vep.Run();
            }
            if (response == (int)ResponseType.Ok)
            {
                job = new Job(playlist, vep.EncodingSettings, vep.EnableAudio, vep.TitleOverlay);
            }
            vep.Destroy();
            return(job);
        }
Exemple #3
0
        public List <EditionJob> ConfigureRenderingJob(Playlist playlist)
        {
            VideoEditionProperties vep;
            List <EditionJob>      jobs = new List <EditionJob> ();
            int response;

            Log.Information("Configure rendering job");
            if (playlist.Elements.Count == 0)
            {
                WarningMessage(Catalog.GetString("The playlist you want to render is empty."));
                return(null);
            }

            vep          = new VideoEditionProperties(mainWindow as Gtk.Window);
            vep.Playlist = playlist;
            response     = vep.Run();
            while (response == (int)ResponseType.Ok)
            {
                if (!vep.SplitFiles && vep.EncodingSettings.OutputFile == "")
                {
                    WarningMessage(Catalog.GetString("Please, select a video file."));
                    response = vep.Run();
                }
                else if (vep.SplitFiles && vep.OutputDir == null)
                {
                    WarningMessage(Catalog.GetString("Please, select an output directory."));
                    response = vep.Run();
                }
                else
                {
                    break;
                }
            }
            if (response == (int)ResponseType.Ok)
            {
                if (!vep.SplitFiles)
                {
                    jobs.Add(new EditionJob(playlist, vep.EncodingSettings));
                }
                else
                {
                    int i = 0;
                    foreach (IPlaylistElement play in playlist.Elements)
                    {
                        EncodingSettings settings;
                        Playlist         pl;
                        string           name, ext, filename;

                        settings = vep.EncodingSettings;
                        pl       = new Playlist();
                        if (play is PlaylistPlayElement)
                        {
                            name = (play as PlaylistPlayElement).Play.Name;
                            ext  = settings.EncodingProfile.Extension;
                        }
                        else
                        {
                            name = "image";
                            ext  = "png";
                        }
                        filename = String.Format("{0}-{1}.{2}", i.ToString("d4"), name, ext);

                        pl.Elements.Add(play);
                        settings.OutputFile = Path.Combine(vep.OutputDir, filename);
                        jobs.Add(new EditionJob(pl, settings));
                        i++;
                    }
                }
            }
            vep.Destroy();
            return(jobs);
        }