Example #1
0
        /*
         * public static void ExportToCSV(Project project) {
         *      FileChooserDialog fChooser;
         *      FileFilter filter;
         *      string outputFile;
         *      CSVExport export;
         *
         *      fChooser = new FileChooserDialog(Catalog.GetString("Select Export File"),
         *                                       window,
         *                                       FileChooserAction.Save,
         *                                       "gtk-cancel",ResponseType.Cancel,
         *                                       "gtk-save",ResponseType.Accept);
         *      fChooser.SetCurrentFolder(MainClass.HomeDir());
         *      fChooser.DoOverwriteConfirmation = true;
         *      filter = new FileFilter();
         *      filter.Name = "CSV File";
         *      filter.AddPattern("*.csv");
         *      fChooser.AddFilter(filter);
         *      if(fChooser.Run() == (int)ResponseType.Accept) {
         *              outputFile=fChooser.Filename;
         *              outputFile = System.IO.Path.ChangeExtension(outputFile,"csv");
         *              export = new CSVExport(project, outputFile);
         *              export.WriteToFile();
         *      }
         *      fChooser.Destroy();
         * }*/

        private void CreateThumbnails(Project project)
        {
            IFramesCapturer capturer;
            IBusyDialog     dialog;

            dialog = guiToolkit.BusyDialog(Catalog.GetString("Creating video thumbnails. This can take a while."));
            dialog.Show();
            dialog.Pulse();

            /* Create all the thumbnails */
            capturer = multimediaToolkit.GetFramesCapturer();
            capturer.Open(project.Description.File.FilePath);
            foreach (Play play in project.AllPlays())
            {
                try {
                    capturer.SeekTime(play.Start.MSeconds + ((play.Stop - play.Start).MSeconds / 2),
                                      true);
                    play.Miniature = capturer.GetCurrentFrame(Constants.THUMBNAIL_MAX_WIDTH,
                                                              Constants.THUMBNAIL_MAX_HEIGHT);
                    dialog.Pulse();
                } catch (Exception ex) {
                    Log.Exception(ex);
                }
            }
            capturer.Dispose();
            dialog.Destroy();
        }
Example #2
0
 public RenderingJobsManager(IMultimediaToolkit multimediaToolkit, IGUIToolkit guiToolkit)
 {
     this.guiToolkit        = guiToolkit;
     this.multimediaToolkit = multimediaToolkit;
     this.stateBar          = guiToolkit.MainWindow.RenderingStateBar;
     capturer             = multimediaToolkit.GetFramesCapturer();
     jobs                 = new List <Job>();
     pendingJobs          = new List <Job>();
     stateBar.Cancel     += (sender, e) => CancelCurrentJob();
     stateBar.ManageJobs += (sender, e) => ManageJobs();
     guiToolkit.MainWindow.ConvertVideoFilesEvent += delegate(List <MediaFile> inputFiles, EncodingSettings encSettings) {
         ConversionJob job = new ConversionJob(inputFiles, encSettings);
         AddJob(job);
     };;
 }
Example #3
0
        private string CreateStillImage(string filename, FrameDrawing drawing)
        {
            Image  frame, final_image;
            string path = System.IO.Path.GetTempFileName().Replace(@"\", @"\\");

            capturer = multimediaToolkit.GetFramesCapturer();
            capturer.Open(filename);
            frame = capturer.GetFrame(drawing.Render, true);
            capturer.Dispose();
            if (frame == null)
            {
                Log.Error(String.Format("Could not get frame for file {0} at pos {1}",
                                        filename, drawing.Render.ToMSecondsString()));
                return(null);
            }
            final_image = Drawing.Utils.RenderFrameDrawingToImage(Config.DrawingToolkit, frame, drawing);
            final_image.Save(path);
            return(path);
        }