예제 #1
0
 void HandleEventCreated(EventCreatedEvent e)
 {
     lasteventbox.Visible = true;
     lastlabel.Text       = e.TimelineEvent.Name;
     lastlabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(e.TimelineEvent.Color));
     lastevent = e.TimelineEvent;
 }
예제 #2
0
 void FillFormats()
 {
     videoStandardList = Misc.FillImageFormat(imagecombobox, VideoStandards.Capture,
                                              App.Current.Config.CaptureVideoStandard);
     encProfileList = Misc.FillEncodingFormat(encodingcombobox, App.Current.Config.CaptureEncodingProfile);
     qualList       = Misc.FillQuality(qualitycombobox, App.Current.Config.CaptureEncodingQuality);
 }
예제 #3
0
        protected void OnAddbuttonClicked(object sender, System.EventArgs e)
        {
            TreeIter iter;

            var           msg   = Catalog.GetString("Add file");
            List <string> paths = FileChooserHelper.OpenFiles(this, msg, null, null, null, null);

            foreach (string path in paths)
            {
                MediaFile mediaFile = Misc.DiscoverFile(path, this);
                if (mediaFile != null)
                {
                    AppendFile(mediaFile);
                }
            }
            CheckStatus();

            if (Files.Count > 0)
            {
                maxHeight = Files.Max(f => f.VideoHeight);
                sizecombobox.GetActiveIter(out iter);
                selectedVideoStandard = stdStore.GetValue(iter, 1) as VideoStandard;
                FillStandards();
            }
        }
예제 #4
0
        public SliderView(double lowerValue, double upperValue, double pageIncrement, double buttonIncrement)
            : base(WindowType.Toplevel)
        {
            this.Build();
            this.buttonIncrement = buttonIncrement;
            this.lowerValue      = lowerValue;

            moreButtonImage.Image = App.Current.ResourcesLocator.LoadIcon("vas-plus", App.Current.Style.IconSmallWidth);
            lessButtonImage.Image = App.Current.ResourcesLocator.LoadIcon("vas-minus", App.Current.Style.IconSmallWidth);
            morebutton.ApplyStyle(StyleConf.ButtonNormal, App.Current.Style.IconSmallWidth);
            lessbutton.ApplyStyle(StyleConf.ButtonNormal, App.Current.Style.IconSmallWidth);

            morebutton.Clicked            += OnMorebuttonClicked;
            lessbutton.Clicked            += OnLessbuttonClicked;
            scale.Adjustment.Upper         = upperValue;
            scale.Adjustment.Lower         = lowerValue;
            scale.Adjustment.PageIncrement = buttonIncrement;
            scale.Adjustment.StepIncrement = pageIncrement;
            scale.ModifyFont(FontDescription.FromString(App.Current.Style.Font + " 8"));
            scale.ValueChanged       += OnScaleValueChanged;
            scale.FormatValue        += HandleScaleFormatValue;
            scale.ButtonPressEvent   += HandleScaleFormatValue;
            scale.ButtonReleaseEvent += HandleScaleFormatValue;

            Misc.SetFocus(this, false);
        }
예제 #5
0
        void SetStyle(int height, int fontSize, int timeWidth)
        {
            string font = String.Format("{0} {1}px", App.Current.Style.Font, fontSize);

            Pango.FontDescription desc = Pango.FontDescription.FromString(font);

            controllerbox.HeightRequest = height;
            hourseventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase));

            hourText.FontSize     = fontSize;
            hourText.TextColor    = App.Current.Style.TextBase;
            hourText.FontSlant    = FontSlant.Normal;
            minutesText.FontSize  = fontSize;
            minutesText.TextColor = App.Current.Style.TextBase;
            minutesText.FontSlant = FontSlant.Normal;
            secondsText.FontSize  = fontSize;
            secondsText.TextColor = App.Current.Style.TextBase;
            secondsText.FontSlant = FontSlant.Normal;

            hourseventbox.WidthRequest = timeWidth;
            minuteseventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase));
            minuteseventbox.WidthRequest = timeWidth;
            secondseventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.ThemeBase));
            secondseventbox.WidthRequest = timeWidth;
            label1.ModifyFont(desc);
            label1.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.TextBase));
            label2.ModifyFont(desc);
            label2.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.TextBase));
            periodlabel.ModifyFont(desc);
            periodlabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.TextBase));
        }
예제 #6
0
 void SetButtonColor(DrawingArea area, Color color)
 {
     Gdk.Color gcolor = Misc.ToGdkColor(color);
     area.ModifyBg(StateType.Normal, gcolor);
     area.ModifyBg(StateType.Active, gcolor);
     area.ModifyBg(StateType.Insensitive, gcolor);
     area.ModifyBg(StateType.Prelight, gcolor);
     area.ModifyBg(StateType.Selected, gcolor);
 }
예제 #7
0
        void HandleDrawableChangedEvent(IEnumerable <IBlackboardObject> drawables)
        {
            selectedDrawable      = (drawables == null || drawables.Count() > 1) ? null : drawables.FirstOrDefault() as Drawable;
            colorbutton.Sensitive = !(selectedDrawable is Text);

            ignoreChanges = true;
            if (selectedDrawable == null)
            {
                colorbutton.Color           = Misc.ToGdkColor(blackboard.Color);
                colorbutton.Alpha           = Color.ByteToUShort(blackboard.Color.A);
                textcolorbutton.Color       = Misc.ToGdkColor(blackboard.TextColor);
                backgroundcolorbutton.Color = Misc.ToGdkColor(blackboard.TextBackgroundColor);
                backgroundcolorbutton.Alpha = Color.ByteToUShort(blackboard.TextBackgroundColor.A);
                linesizespinbutton.Value    = OriginalSize(blackboard.LineWidth);
                if (blackboard.LineStyle == LineStyle.Normal)
                {
                    stylecombobox.Active = 0;
                }
                else
                {
                    stylecombobox.Active = 1;
                }
                typecombobox.Active = (int)blackboard.LineType;
            }
            else
            {
                if (selectedDrawable is Text)
                {
                    textcolorbutton.Color       = Misc.ToGdkColor((selectedDrawable as Text).TextColor);
                    backgroundcolorbutton.Color = Misc.ToGdkColor(selectedDrawable.FillColor);
                    backgroundcolorbutton.Alpha = Color.ByteToUShort(selectedDrawable.FillColor.A);
                    textspinbutton.Value        = OriginalSize((selectedDrawable as Text).TextSize);
                }
                else
                {
                    colorbutton.Color    = Misc.ToGdkColor(selectedDrawable.StrokeColor);
                    colorbutton.UseAlpha = true;
                    colorbutton.Alpha    = Color.ByteToUShort(selectedDrawable.StrokeColor.A);
                }
                if (selectedDrawable is Line)
                {
                    typecombobox.Active = (int)(selectedDrawable as Line).Type;
                }
                linesizespinbutton.Value = OriginalSize(selectedDrawable.LineWidth);
                if (selectedDrawable.Style == LineStyle.Normal)
                {
                    stylecombobox.Active = 0;
                }
                else
                {
                    stylecombobox.Active = 1;
                }
            }

            UpdateSettingsVisibility(blackboard.Tool);
            ignoreChanges = false;
        }
        void SetStyle()
        {
            FontDescription desc = FontDescription.FromString(App.Current.Style.Font + " 18");

            infoeventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteBackgroundDark));
            infolabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText));
            infolabel.ModifyFont(desc);
            videoseventbox.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteBackgroundDark));
            videoslabel.ModifyFg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteText));
            videoslabel.ModifyFont(desc);
        }
예제 #9
0
        void HandleTextColorSet(object sender, EventArgs e)
        {
            if (ignoreChanges)
            {
                return;
            }

            if (selectedDrawable is Text)
            {
                (selectedDrawable as Text).TextColor = Misc.ToLgmColor(textcolorbutton.Color);
                QueueDraw();
            }
            else
            {
                blackboard.TextColor = Misc.ToLgmColor(textcolorbutton.Color);
            }
        }
예제 #10
0
 void HandleColorSet(object sender, EventArgs e)
 {
     if (ignoreChanges)
     {
         return;
     }
     if (sender == colorbutton1)
     {
         template.Colors [0] = Misc.ToLgmColor(colorbutton1.Color);
         template.UpdateColors();
         drawingarea.QueueDraw();
     }
     else
     {
         template.Colors [1] = Misc.ToLgmColor(colorbutton2.Color);
     }
     Edited = true;
 }
예제 #11
0
        public TeamTemplateEditor()
        {
            this.Build();

            applyimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-apply", StyleConf.ButtonDialogIconSize);

            teamtagger = new LMTeamTaggerView(new WidgetWrapper(drawingarea));
            shieldvbox.WidthRequest = SHIELD_SIZE;
            shieldimage.SetSize(SHIELD_SIZE);
            playerimage.SetSize(PLAYER_SIZE);
            colorbutton1.Color     = Misc.ToGdkColor(Color.Red1);
            colorbutton1.ColorSet += HandleColorSet;
            colorbutton2.Color     = Misc.ToGdkColor(Color.Green1);
            colorbutton2.ColorSet += HandleColorSet;

            ConnectSignals();

            ClearPlayer();
        }
예제 #12
0
 void HandleColorSet(object sender, EventArgs e)
 {
     if (ignoreChanges)
     {
         return;
     }
     if (selectedDrawable != null)
     {
         selectedDrawable.StrokeColor = Misc.ToLgmColor(colorbutton.Color, colorbutton.Alpha);
         if (selectedDrawable.FillColor != null)
         {
             Color c = Misc.ToLgmColor(colorbutton.Color, colorbutton.Alpha);
             selectedDrawable.FillColor = c;
         }
         QueueDraw();
     }
     else
     {
         blackboard.Color = Misc.ToLgmColor(colorbutton.Color, colorbutton.Alpha);
     }
 }
예제 #13
0
 public VideoConversionTool()
 {
     this.Build();
     buttonOk.Sensitive = false;
     Files = new List <MediaFile> ();
     supportedVideoStandards = VideoStandards.Transcode;
     maxHeight = supportedVideoStandards [0].Height;
     mediafilechooser1.FileChooserMode  = FileChooserMode.File;
     mediafilechooser1.ChangedEvent    += HandleFileChanges;
     mediafilechooser1.ProposedFileName = String.Format("{0}-Video-{1}.mp4", Constants.SOFTWARE_NAME,
                                                        DateTime.Now.ToShortDateString().Replace('/', '-'));
     FillStandards();
     FillBitrates();
     addbutton1.Clicked += OnAddbuttonClicked;
     convertimage.Image  = App.Current.ResourcesLocator.LoadIcon("lm-video-converter-big", 64);
     addimage.Image      = App.Current.ResourcesLocator.LoadIcon("vas-add", StyleConf.ButtonNormalSize);
     eventbox1.ModifyBg(StateType.Normal, Misc.ToGdkColor(App.Current.Style.PaletteBackgroundDark));
     addbutton1.CanFocus     = false;
     scrolledwindow1.Visible = false;
     conversionCommand       = new LimitationCommand(LongoMatchFeature.VideoConverter.ToString(), ExecuteConversion);
     // FIXME: port to viewmodel this view and do the proper bindings
     buttonOk.BindManually(conversionCommand);
 }
예제 #14
0
        void HandleBackgroundColorSet(object sender, EventArgs e)
        {
            Color c;

            if (ignoreChanges)
            {
                return;
            }


            c = Misc.ToLgmColor(backgroundcolorbutton.Color,
                                backgroundcolorbutton.Alpha);
            if (selectedDrawable is Text)
            {
                Text t = (selectedDrawable as Text);
                t.FillColor = t.StrokeColor = c;
                QueueDraw();
            }
            else
            {
                blackboard.TextBackgroundColor = c;
            }
        }
예제 #15
0
        public DrawingTool()
        {
            this.Build();
            blackboard = new Blackboard(new WidgetWrapper(drawingarea));
            blackboard.ConfigureObjectEvent    += HandleConfigureObjectEvent;
            blackboard.ShowMenuEvent           += HandleShowMenuEvent;
            blackboard.DrawableChangedEvent    += HandleDrawableChangedEvent;
            blackboard.DrawToolChanged         += HandleDrawToolChangedEvent;
            blackboard.RegionOfInterestChanged += HandleRegionOfInterestChanged;

            selectbutton.Active = true;

            buttonToDrawTool = new Dictionary <RadioButton, DrawTool> ()
            {
                { selectbutton, DrawTool.Selection },
                { eraserbutton, DrawTool.Eraser },
                { penbutton, DrawTool.Pen },
                { textbutton, DrawTool.Text },
                { linebutton, DrawTool.Line },
                { crossbutton, DrawTool.Cross },
                { rectanglebutton, DrawTool.Rectangle },
                { ellipsebutton, DrawTool.Ellipse },
                { rectanglefilledbutton, DrawTool.RectangleArea },
                { ellipsefilledbutton, DrawTool.CircleArea },
                { numberbutton, DrawTool.Counter },
                { anglebutton, DrawTool.Angle },
                { playerbutton, DrawTool.Player },
                { zoombutton, DrawTool.Zoom },
            };

            foreach (var button in buttonToDrawTool.Keys)
            {
                button.Name     = "DrawingToolButton-" + button.Name;
                button.Toggled += HandleToolClicked;
            }

            CreateToolSettings();
            UpdateSettingsVisibility(DrawTool.Selection);

            selectbuttonimage.Image          = App.Current.ResourcesLocator.LoadIcon("vas-select", 20);
            eraserbuttonimage.Image          = App.Current.ResourcesLocator.LoadIcon("vas-eraser", 20);
            penbuttonimage.Image             = App.Current.ResourcesLocator.LoadIcon("vas-pencil", 20);
            textbuttonimage.Image            = App.Current.ResourcesLocator.LoadIcon("vas-text", 20);
            linebuttonimage.Image            = App.Current.ResourcesLocator.LoadIcon("vas-arrow", 20);
            crossbuttonimage.Image           = App.Current.ResourcesLocator.LoadIcon("vas-mark", 20);
            rectanglebuttonimage.Image       = App.Current.ResourcesLocator.LoadIcon("vas-square", 20);
            ellipsebuttonimage.Image         = App.Current.ResourcesLocator.LoadIcon("vas-circle", 20);
            rectanglefilledbuttonimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-square-fill", 20);
            ellipsefilledbuttonimage.Image   = App.Current.ResourcesLocator.LoadIcon("vas-circle-fill", 20);
            playerbuttonimage.Image          = App.Current.ResourcesLocator.LoadIcon("vas-person", 20);
            numberbuttonimage.Image          = App.Current.ResourcesLocator.LoadIcon("vas-counter", 20);
            anglebuttonimage.Image           = App.Current.ResourcesLocator.LoadIcon("vas-angle", 20);
            zoombuttonimage.Image            = App.Current.ResourcesLocator.LoadIcon("vas-search", 20);
            zoomoutimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-zoom-out", 14);
            zoominimage.Image  = App.Current.ResourcesLocator.LoadIcon("vas-zoom-in", 14);

            // Force tooltips to be translatable as there seems to be a bug in stetic
            // code generation for translatable tooltips.
            selectbutton.TooltipMarkup          = Catalog.GetString("Selection tool");
            eraserbutton.TooltipMarkup          = Catalog.GetString("Eraser tool");
            penbutton.TooltipMarkup             = Catalog.GetString("Pencil tool");
            textbutton.TooltipMarkup            = Catalog.GetString("Text tool");
            linebutton.TooltipMarkup            = Catalog.GetString("Line tool");
            crossbutton.TooltipMarkup           = Catalog.GetString("Cross tool");
            rectanglebutton.TooltipMarkup       = Catalog.GetString("Rectangle tool");
            ellipsebutton.TooltipMarkup         = Catalog.GetString("Ellipse tool");
            rectanglefilledbutton.TooltipMarkup = Catalog.GetString("Rectangle area tool");
            ellipsefilledbutton.TooltipMarkup   = Catalog.GetString("Ellipsis area tool");
            playerbutton.TooltipMarkup          = Catalog.GetString("Player tool");
            numberbutton.TooltipMarkup          = Catalog.GetString("Index tool");
            anglebutton.TooltipMarkup           = Catalog.GetString("Angle tool");
            stylecombobox.TooltipMarkup         = Catalog.GetString("Change the line style");
            typecombobox.TooltipMarkup          = Catalog.GetString("Change the line style");
            clearbutton.TooltipMarkup           = Catalog.GetString("Clear all drawings");
            zoombutton.TooltipMarkup            = Catalog.GetString("Zoom tool. Click to zoom in, Alt+Shift to zoom out");

            FillLineStyle();
            FillLineType();

            colorbutton.ColorSet += HandleColorSet;
            colorbutton.Color     = Misc.ToGdkColor(Color.Red1);
            colorbutton.UseAlpha  = true;
            colorbutton.Alpha     = Color.FloatToUShort(0.8f);
            blackboard.Color      = Color.Red1;
            blackboard.Color.SetAlpha(0.8f);
            textcolorbutton.ColorSet       += HandleTextColorSet;
            textcolorbutton.Color           = Misc.ToGdkColor(Color.White);
            blackboard.TextColor            = Color.White;
            backgroundcolorbutton.UseAlpha  = true;
            backgroundcolorbutton.Alpha     = 0;
            backgroundcolorbutton.ColorSet += HandleBackgroundColorSet;
            backgroundcolorbutton.Color     = Misc.ToGdkColor(Color.Green1);
            blackboard.TextBackgroundColor  = Misc.ToLgmColor(backgroundcolorbutton.Color,
                                                              backgroundcolorbutton.Alpha);
            textspinbutton.Value             = 12;
            textspinbutton.ValueChanged     += (sender, e) => UpdateTextSize();
            linesizespinbutton.ValueChanged += (sender, e) => UpdateLineWidth();
            linesizespinbutton.Value         = 2;

            zoomscale.CanFocus       = false;
            hscrollbar.ValueChanged += HandleScrollValueChanged;
            wscrollbar.ValueChanged += HandleScrollValueChanged;
            hscrollbar.Visible       = wscrollbar.Visible = false;


            Misc.SetFocus(this, false);

            var saveToFileCommand = new AsyncCommand(SaveToFile);

            saveToFileCommand.Icon = App.Current.ResourcesLocator.LoadIcon("vas-save", App.Current.Style.IconSmallWidth);
            saveToFileCommand.Text = Catalog.GetString("Save to File");
            savebutton.BindManually(saveToFileCommand);

            var saveToProjectCommand = new AsyncCommand(SaveToProject);

            saveToProjectCommand.Icon = App.Current.ResourcesLocator.LoadIcon("vas-save", App.Current.Style.IconSmallWidth);
            saveToProjectCommand.Text = Catalog.GetString("Save to Project");
            savetoprojectbutton.BindManually(saveToProjectCommand);

            var clearCommand = new Command(Clear);

            clearCommand.Icon = App.Current.ResourcesLocator.LoadIcon("vas-delete", App.Current.Style.IconSmallWidth);
            clearbutton.BindManually(clearCommand);

            Bind();
        }
예제 #16
0
        public CapturerBin()
        {
            this.Build();
            Misc.SetFocus(vbox1, false);
            videowindow.ReadyEvent  += HandleReady;
            videowindow.ExposeEvent += HandleExposeEvent;
            videowindow.CanFocus     = true;
            recbutton.Clicked       += (sender, e) => StartPeriod();
            stopbutton.Clicked      += (sender, e) => StopPeriod();
            pausebutton.Clicked     += (sender, e) => PausePeriod();
            resumebutton.Clicked    += (sender, e) => ResumePeriod();
            savebutton.Clicked      += HandleSaveClicked;
            cancelbutton.Clicked    += HandleCloseClicked;

            // Force tooltips to be translatable as there seems to be a bug in stetic
            // code generation for translatable tooltips.
            recbutton.TooltipMarkup        = Catalog.GetString("Start recording period");
            stopbutton.TooltipMarkup       = Catalog.GetString("Stop recording period");
            pausebutton.TooltipMarkup      = Catalog.GetString("Pause clock");
            resumebutton.TooltipMarkup     = Catalog.GetString("Resume clock");
            savebutton.TooltipMarkup       = Catalog.GetString("Save project");
            cancelbutton.TooltipMarkup     = Catalog.GetString("Cancel capture");
            deletelastbutton.TooltipMarkup = Catalog.GetString("Delete event");
            playlastbutton.TooltipMarkup   = Catalog.GetString("Replay event");

            recimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-control-record",
                                                                   Sizes.PlayerCapturerIconSize);
            stopimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-stop",
                                                                    Sizes.PlayerCapturerIconSize);
            pauseimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-pause-clock",
                                                                     Sizes.PlayerCapturerIconSize);
            resumeimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-resume-clock",
                                                                      Sizes.PlayerCapturerIconSize);
            saveimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-save",
                                                                    Sizes.PlayerCapturerIconSize);
            cancelimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-cancel-rec",
                                                                      Sizes.PlayerCapturerIconSize);
            deletelastimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-delete",
                                                                          Sizes.PlayerCapturerIconSize);
            playlastimage.Image = App.Current.ResourcesLocator.LoadIcon("vas-control-play",
                                                                        Sizes.PlayerCapturerIconSize);

            hourText = new TextView(new WidgetWrapper(hourArea))
            {
                Text = "00"
            };
            minutesText = new TextView(new WidgetWrapper(minutesArea))
            {
                Text = "00"
            };
            secondsText = new TextView(new WidgetWrapper(secondsArea))
            {
                Text = "00"
            };

            lasteventbox.Visible      = false;
            deletelastbutton.Clicked += HandleDeleteLast;
            playlastbutton.Clicked   += HandlePlayLast;
            Periods = new List <Period> ();
            Reset();
            Mode = CapturerType.Live;
            App.Current.EventsBroker.Subscribe <EventCreatedEvent> (HandleEventCreated);
            lastlabel.ModifyFont(Pango.FontDescription.FromString(App.Current.Style.Font + " 8px"));
            ReadyToCapture = false;
        }