Beispiel #1
0
 protected ProjectBuilder(Project project, ProgressEventHandler total_handler, ProgressEventHandler task_handler)
 {
     this.project = project;
     this.total_handler = total_handler;
     this.task_handler = task_handler;
     total = new ProgressEventArgs ();
 }
        public CheckDependenciesDialog(Project project)
            : base("CheckDependenciesDialog.ui", "dependencies")
        {
            text_buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            capabilitiesview.Buffer = text_buffer;

            Gtk.TextBuffer buffer_intro = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            textview_intro.Buffer = buffer_intro;
            buffer_intro.Text = Catalog.GetString ("Mistelix uses a set of external components. Their availability determines Mistelix's capabilities. The following list shows the level of support of your system for Mistelix and if there are actions required.");
        }
Beispiel #3
0
        public string Convert(Project project)
        {
            bool rslt;
            string of = GetOutputFile (project.Details.Type);
            string outfile =  project.FileToFullPath (of);

            Logger.Debug ("Video.Convert. File {0} to {1}", filename, outfile);
            // TODO: If rslt != 0 throw an exception
            rslt =  Backends.GStreamer.Video.Convert (filename, outfile, (uint) project.Details.FramesPerSecond);
            return outfile;
        }
Beispiel #4
0
        public BuildProjectDialog(Project project)
            : base("BuildProjectDialog.ui", "buildproject")
        {
            Gtk.TextBuffer buffer_intro;
            this.project = project;
            buffer = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            status_text.Buffer = buffer;

            color = totalprogress_label.Style.Background (StateType.Normal);
            buffer_intro = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            textview_intro.Buffer = buffer_intro;
            textview_intro.ModifyBase (Gtk.StateType.Normal, color);
            buffer_intro.Text = Catalog.GetString ("Welcome to the project building process. Press the 'Generate' button to start this process.");
        }
Beispiel #5
0
        public ThemeSelectionDialog(Project project)
            : base("ThemeSelectionDialog.ui", "themeselection")
        {
            this.project = project;
            hpaned.Position = 200; // W (left)
            selected_theme = null;
            menu_drawing_area = new MenuBackgroundPreview ();
            selectbutton_drawing_area = new ButtonPreview (project);
            highlightbutton_drawing_area = new ButtonPreview (project);

            browse_file = new BrowseFile (file_hbox, project.Details.CustomMenuBackground, true);
            browse_file.DefaultDirectory = Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey);
            menu_drawing_area.CustomMenuBackground = project.Details.CustomMenuBackground;

            color = author_label.Style.Background (StateType.Normal);
            textview_intro.ModifyBase (Gtk.StateType.Normal, color);

            Gtk.Button clean_button = new Gtk.Button (Catalog.GetString ("Clean"));
            clean_button.Clicked += delegate
            {
                browse_file.Filename = null;
                menu_drawing_area.CustomMenuBackground = null;
            };

            file_hbox.Add (clean_button);
            file_hbox.ShowAll ();

            PrepareTree ();
            backpreview_box.Add (menu_drawing_area);
            backpreview_box.ShowAll ();

            highlightbutton_box.Add (highlightbutton_drawing_area);
            highlightbutton_box.ShowAll ();

            selectbutton_box.Add (selectbutton_drawing_area);
            selectbutton_box.ShowAll ();

            browse_file.FileSelectedChanged += delegate
            {
                menu_drawing_area.CustomMenuBackground = browse_file.Filename;
            };

            Gtk.TextBuffer buffer_intro = new Gtk.TextBuffer (new Gtk.TextTagTable ());
            textview_intro.Buffer = buffer_intro;
            buffer_intro.Text = String.Format (
                Catalog.GetString ("Menu themes define how the main DVD menu looks. Here you define the default background image and the type of buttons. For more information visit: {0}"),
                Defines.THEMES_URL);
        }
Beispiel #6
0
        public AuthoringPaneView(Gtk.VBox parent, Project project)
        {
            Project = project;
            active_item = -1;
            DragDataReceived += new DragDataReceivedHandler (HandleTargetDragDataReceived);

            EventBox eb = new EventBox (); // Provides a window for this windowless widget
            parent.Add (eb);

            eb.Add (this);
            Gtk.Drag.DestSet (this, DestDefaults.All, tag_dest_target_table,
                      DragAction.Copy | DragAction.Move);

            eb.ButtonPressEvent += HandleButtonPress;
            eb.ButtonReleaseEvent += HandleButtonRelease;
            eb.MotionNotifyEvent += HandleMotionNotify;

            UpdateTheme ();
        }
Beispiel #7
0
        static void Main()
        {
            SlideImage img;
            TimeSpan time;
            byte [] pixels;
            Project project = new Project ();
            Stopwatch stopWatch = new Stopwatch ();
            int times = 10;

            project.Details.SetResolution (720, 576);
            Application.Init ();

            stopWatch.Start ();
            for (int i = 0; i < times; i++)
            {
                img = new SlideImage ("../dataset/images/image1.jpg");
                img.Title = "Hello world";
                img.Project = project;
                pixels = img.Pixels;
            }
            stopWatch.Stop();
            time = stopWatch.Elapsed;
            Console.WriteLine ("Images with title. Time needed {0}", time);

            stopWatch.Reset ();
            stopWatch.Start ();
            for (int i = 0; i < times; i++)
            {
                img = new SlideImage ("../dataset/images/image1.jpg");
                img.Project = project;
                pixels = img.Pixels;
            }

            time = stopWatch.Elapsed;
            Console.WriteLine ("Images. Time needed {0}", time);
            return;
        }
Beispiel #8
0
        void OnOK(object sender, EventArgs args)
        {
            TreeIter iter;

            // if directory doesn't exist ask the user to create it
            if (!Directory.Exists (output_dir.Text)) {
                MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent,
                    MessageType.Question, ButtonsType.YesNo,
                    Catalog.GetString ("The output directory provided does not exist. Do you want to create it?"));

                ResponseType result = (ResponseType)md.Run ();
                md.Destroy ();

                if (result == ResponseType.Yes) {
                    try {
                        Directory.CreateDirectory (output_dir.Text);
                    }
                    catch (Exception) {
                        MessageDialog mderror = new MessageDialog (this, DialogFlags.DestroyWithParent,
                            MessageType.Error, ButtonsType.Ok,
                            Catalog.GetString ("Unable to create directory."));

                        mderror.Run ();
                        mderror.Destroy ();
                        return;
                    }
                } else {
                    return;
                }
            }

            project = new Project ();
            project.Details.OutputDir = output_dir.Text;
            project.Details.Name = name.Text;

            if (pal_radio.Active)
                project.Details.Format = VideoFormat.PAL;
            else
                project.Details.Format = VideoFormat.NTSC;

            if (slideshows_radio.Active) {
                project.Details.Type = ProjectType.Slideshows;
                if (resolution_combobox.GetActiveIter (out iter)) {
                    int idx = (int) resolution_combobox.Model.GetValue (iter, COL_INDEX);
                    project.Details.SetResolution (ResolutionManager.List[idx].Width, ResolutionManager.List[idx].Height);
                }
            }
            else {
                project.Details.Type = ProjectType.DVD;
                project.Details.SetDvdResolution ();
            }

            if (fourbythree_radio.Active)
                project.Details.AspectRatio = AspectRatio.FourByThree;
            else
                project.Details.AspectRatio = AspectRatio.SixteenByNine;

            Respond (ResponseType.Ok);
        }
Beispiel #9
0
        public void CopyProperties(SlideImage src)
        {
            // TODO: Missing SlideImage properties
            width = src.width;
            height = src.height;
            stride = src.stride;
            alpha = src.alpha;
            channels = src.channels;
            Effects = src.Effects;
            project = src.project;
            Position = src.Position;

            image = src.image;
        }
        public ProjectPropertiesDialog(Project project)
            : base("ProjectPropertiesDialog.ui", "projectproperties")
        {
            Gtk.Box.BoxChild child;
            TreeIter iter;
            bool more;

            this.project = project;
            dvd_project = project.Details.Type == ProjectType.DVD;

            // General tab
            name.Text = project.Details.Name;
            output_dir.Text = project.Details.OutputDir;

            fontslides_button.FontName = project.Details.SlideshowsFontName;

            backslides_button.UseAlpha = foreslides_button.UseAlpha = true;
            foreslides_button.Alpha = (ushort) (project.Details.SlideshowsForeColor.A * 65535);
            backslides_button.Alpha = (ushort) (project.Details.SlideshowsBackColor.A * 65535);

            foreslides_button.Color = Utils.CairoToGdkColor (project.Details.SlideshowsForeColor);
            backslides_button.Color = Utils.CairoToGdkColor (project.Details.SlideshowsBackColor);

            if (dvd_project == true) // DVD tab
            {
                notebook.RemovePage (PAGE_THEORA);

                fontbuttons_button.FontName = project.Details.ButtonsFontName;

                forebuttons_button.UseAlpha = backbuttons_button.UseAlpha = true;
                forebuttons_button.Alpha = (ushort) (project.Details.ButtonsForeColor.A * 65535);
                backbuttons_button.Alpha = (ushort) (project.Details.ButtonsBackColor.A * 65535);

                forebuttons_button.Color = Utils.CairoToGdkColor (project.Details.ButtonsForeColor);
                backbuttons_button.Color = Utils.CairoToGdkColor (project.Details.ButtonsBackColor);

                pal_radio.Active = project.Details.Format == VideoFormat.PAL;
                ntsc_radio.Active = project.Details.Format == VideoFormat.NTSC;

                fourbythree_radio.Active = project.Details.AspectRatio == AspectRatio.FourByThree;
                sixteenbynine_radio.Active = project.Details.AspectRatio == AspectRatio.SixteenByNine;

                thumbnail_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
                CellRenderer thumbnail_cell = new CellRendererText ();
                thumbnail_combo.Model = thumbnail_store;
                thumbnail_combo.PackStart (thumbnail_cell, true);
                thumbnail_combo.SetCellDataFunc (thumbnail_cell, Utils.ComboBoxCellFunc);
                LoadThumbnailsIntoCombo ();

                // Default thumbnail size
                int thumbnail = project.Details.ButtonThumbnailSize;
                int current;

                more = thumbnail_store.GetIterFirst (out iter);
                while (more)
                {
                    current = (int) thumbnail_store.GetValue (iter, COLUMN_ID);
                    if (thumbnail == current) {
                        thumbnail_combo.SetActiveIter (iter);
                        break;
                    }
                    more = thumbnail_store.IterNext (ref iter);
                }

                // Margins
                child = (Gtk.Box.BoxChild) (fourbythree_hbox [fourbythree_radio]);
                child.Padding = PADDING + OFFSET;

                child = (Gtk.Box.BoxChild) (sixteenbynine_hbox [sixteenbynine_radio]);
                child.Padding = PADDING + OFFSET;

                child = (Gtk.Box.BoxChild) (pal_hbox [pal_radio]);
                child.Padding = PADDING + OFFSET;

                child = (Gtk.Box.BoxChild) (ntsc_hbox [ntsc_radio]);
                child.Padding = PADDING + OFFSET;

            } else { // Theora tab

                notebook.RemovePage (PAGE_DVD);

                resolution_store = new ListStore (typeof (string), typeof (int)); // DisplayName, index to array
                CellRenderer resolution_cell = new CellRendererText ();
                resolution_combobox.Model = resolution_store;
                resolution_combobox.PackStart (resolution_cell, true);
                resolution_combobox.SetCellDataFunc (resolution_cell, Utils.ComboBoxCellFunc);
                LoadResolutionIntoCombo ();

                // Select default item in the combobox list
                more = resolution_store.GetIterFirst (out iter);
                while (more)
                {
                    int idx = (int) resolution_store.GetValue (iter, COL_INDEX);
                    if (ResolutionManager.List[idx].Width == project.Details.Width &&
                        ResolutionManager.List[idx].Height == project.Details.Height) {
                        resolution_combobox.SetActiveIter (iter);
                        break;
                    }
                    more = resolution_store.IterNext (ref iter);
                }

                child = (Gtk.Box.BoxChild) (resolution_hbox [resolution_label]);
                child.Padding = PADDING + OFFSET;
            }

            // Top margin for the General tab
            child = (Gtk.Box.BoxChild) (general_vbox [vbox25]);
            child.Padding = PADDING;

            // Left margin for controls
            child = (Gtk.Box.BoxChild) (name_hbox [name]);
            child.Padding = PADDING;

            child = (Gtk.Box.BoxChild) (output_dir_hbox [output_dir]);
            child.Padding = PADDING;
        }
Beispiel #11
0
        void OpenProject(string filename)
        {
            try {
                Project load_project;

                load_project = new Project ();
                load_project.Load (filename);
                project = authoring_view.Project = element_view.Project = load_project;
                SensitiveToProjectContext ();
                app_window.QueueDraw ();
                element_view.LoadElements ();
                authoring_view.UpdateTheme ();
                app_window.QueueDraw ();
                UpdateWindowTitle ();

                recent_files.Add (filename);

            } catch (Exception e) {

                String msg;
                msg = String.Format (Catalog.GetString ("Error loading project '{0}'"), e.Message);
                MessageDialog md = new MessageDialog (app_window,
                                      	DialogFlags.Modal, MessageType.Warning,
                                      	ButtonsType.Ok, msg);

                md.Run ();
                md.Destroy ();
            }
        }
Beispiel #12
0
 public ButtonPreview(Project project)
 {
     this.project = project;
     spumux = new Spumux (project);
 }
Beispiel #13
0
        public static void Create(Project project)
        {
            if (dialog != null)
                dialog.Destroy ();

            dialog = new AddSlideDialog (project);
        }
Beispiel #14
0
 public DvdAuthor(Project project)
 {
     this.project = project;
 }
Beispiel #15
0
        public string Generate(Project project, ProgressEventHandler progress)
        {
            int total_frames = 0;
            int frames_sec = project.Details.FramesPerSecond;
            ProgressEventArgs args = new ProgressEventArgs ();

            for (int i = 0; i < images.Count - 1; i++)
            {
                total_frames += (frames_sec * images[i].ShowTime) + (images[i].TransitionTime * frames_sec);
                ((SlideImage) images[i]).Project = project;
            }

            ((SlideImage) images[images.Count - 1]).Project = project;
            total_frames += frames_sec * images[images.Count - 1].ShowTime;
            args.Total = images.Count;

            Logger.Debug ("SlideShow.Generate. Generating MPEG for " + images.Count + " images " + "total frames " + total_frames + " at " + filename);

            string outfile;

            if (filename == null)
                outfile = GetOutputFile (project.Details.Type);
            else
                outfile = filename;

            Backends.GStreamer.SlideShow.CreateStream (project.FileToFullPath (outfile), project.Details.Type,
                (uint) project.Details.Width, (uint) project.Details.Height, (uint) frames_sec, (uint) total_frames);

            if (AudioFile != null) {
                Logger.Debug ("SlideShow.Generate. Audiofile {0}", AudioFile);
                Backends.GStreamer.SlideShow.AddAudio (AudioFile);
            }

            Transition transition;
            Logger.Debug ("SlideShow.Generate. Images.Count {0}", images.Count);

            // We need to make sure that source and target slides are loaded. Here we make sure that source is loaded
            ((SlideImage) images[0]).LoadSlide ();

            for (int i = 0;  i < images.Count - 1; i++) {

                if (progress != null) {
                    args.Progress = args.Progress + 1;
                    progress (this, args);
                }

                Logger.Debug ("SlideShow.Generate. Send Fixed image {0}, time {1} (frames)", i, (uint) (frames_sec * images[i].ShowTime));
                transition = TransitionManager.CreateFromName (images[i].Transition);
                Backends.GStreamer.SlideShow.AddImageFixed (((SlideImage)images[i]), (uint) (frames_sec * images[i].ShowTime));

                // Transition between two images
                Logger.Debug ("SlideShow.Generate. Generate transition for frames_sec {0} and time {1}", frames_sec, images[i].TransitionTime);

                // We need to make sure that source and target slides are loaded. Here we make sure that target is loaded
                ((SlideImage) images[i + 1]).LoadSlide (); // Here we do target

                transition.Source = (SlideImage) images[i];
                transition.Target = (SlideImage) images[i + 1];
                transition.Frames = frames_sec * images[i].TransitionTime;
                foreach (SlideImage img in transition)
                    Backends.GStreamer.SlideShow.AddImage (img);

                Logger.Debug ("Sending subimage completed");
                ((SlideImage) images[i]).ReleasePixels ();
            }

            Logger.Debug ("SlideShow.Generate. Send fixed image time {0} (frames)", (uint) (frames_sec * images[images.Count -1].ShowTime));
            Backends.GStreamer.SlideShow.AddImageFixed (((SlideImage)images[images.Count - 1]), (uint) (frames_sec * images[images.Count -1].ShowTime));
            ((SlideImage) images[images.Count - 1]).ReleasePixels ();

            if (progress != null) {
                args.Progress = args.Progress + 1;
                progress (this, args);
            }

            // This a blocking call. It does not return until the pipeline sends an EOS
            Backends.GStreamer.SlideShow.Close ();
            Logger.Debug ("SlideShow.Generate. Finished generation");
            return project.FileToFullPath (outfile);
        }
Beispiel #16
0
 public DvdMenu(Project project)
 {
     this.project = project;
     UpdateTheme ();
 }
Beispiel #17
0
 void NewProject(ProjectType type)
 {
     NewProjectDialog dialog = new NewProjectDialog (type);
     if (dialog.RunModal () == ResponseType.Ok) {
         project = authoring_view.Project = element_view.Project = dialog.NewProject;
         SensitiveToProjectContext ();
         element_view.LoadElements ();
         app_window.QueueDraw ();
         UpdateWindowTitle ();
     }
 }
Beispiel #18
0
 void OnClose(object sender, EventArgs args)
 {
     project = null;
     SensitiveToProjectContext ();
 }
Beispiel #19
0
        // TODO: Since allows editing probably should be renamed to SlideDialog
        public AddSlideDialog(Project project)
            : base("AddSlideDialog.ui", "addslide")
        {
            this.project = project;
            LoadWindowPosition ();

            image_view = new SlideShowImageView ();
            image_view.ChangeEvent = new ShowImageSelectionEventHandler (OnChangeImage);
            image_view.UpdatedElements = new ShowImageUpdatedElementsEventHandler (OnUpdatedImages);
            scrolled_images.Add (image_view);

            up_button.Clicked += new EventHandler (OnButtonUp);
            down_button.Clicked += new EventHandler (OnButtonDown);
            audio_button.Clicked += new EventHandler (OnButtonAudio);

            file_view = new ImagesFileView ();
            new DirectoryView (vbox_dir, new ChangeDirectoryEventHandler (OnDirectoryChanged),
                Mistelix.Preferences.GetStringValue (Preferences.ImagesDirectoryKey));

            scrolledwin_files.Add (file_view);

            drawing_area = new TransitionPreview ();
            ctrls_hbox.Add (drawing_area);
            drawing_area.Visible = true;

            file_view.ShowAll ();
            left_vbox.ShowAll ();
            vpaned.Position = 650; // W (left)
            hpaned.Position = 300; // H (right)

            transition_store = new ListStore (typeof (string), typeof (string)); // DisplayName, Name
            LoadTransitionsIntoCombo ();
            transition_combo.Model = transition_store;

            CellRenderer transition_cell = new CellRendererText ();
            transition_combo.PackStart (transition_cell, true);
            transition_combo.SetCellDataFunc (transition_cell, Utils.ComboBoxCellFunc);
            transition_store.SetSortFunc (0, new Gtk.TreeIterCompareFunc (TransitionSort));
            transition_store.SetSortColumnId (0, SortType.Ascending);

            textposition_store = new ListStore (typeof (string), typeof (int)); // DisplayName, int
            textposition_combo.Model = textposition_store;
            CellRenderer textposition_cell = new CellRendererText ();
            textposition_combo.PackStart (textposition_cell, true);
            textposition_combo.SetCellDataFunc (textposition_cell, Utils.ComboBoxCellFunc);
            LoadTextPositionsIntoCombo ();

            SetTransisitionToNone ();
            ImageControlsSensitive (false);
            OnUpdatedImages (this, EventArgs.Empty);
            duration_spin.ValueChanged += new EventHandler (TimeValueChanged);
        }
Beispiel #20
0
 public Spumux(Project project)
 {
     this.project = project;
 }