示例#1
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The timeline control that we are permanently attached to</param>
 public SelectionManipulator(TimelineControl owner)
 {
     Owner = owner;
     Owner.MouseDownPicked += Owner_MouseDownPicked;
     Owner.KeyDown         += Owner_KeyDown;
     Owner.MouseUp         += Owner_MouseUp;
 }
示例#2
0
        public Form_ToolPalette(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon            = Resources.Icon_Vixen3;

            toolStripButtonEditColor.DisplayStyle   = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditColor.Image          = Resources.pencil;
            toolStripButtonNewColor.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewColor.Image           = Resources.add;
            toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteColor.Image        = Resources.delete;

            toolStripButtonEditCurve.DisplayStyle   = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditCurve.Image          = Resources.pencil;
            toolStripButtonNewCurve.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewCurve.Image           = Resources.add;
            toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteCurve.Image        = Resources.delete;

            toolStripButtonEditGradient.DisplayStyle   = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditGradient.Image          = Resources.pencil;
            toolStripButtonNewGradient.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewGradient.Image           = Resources.add;
            toolStripButtonDeleteGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteGradient.Image        = Resources.delete;

            ListViewItem_SetSpacing(this.listViewColors, 48 + 5, 48 + 5);
            ListViewItem_SetSpacing(this.listViewCurves, 48 + 5, 48 + 30);
            ListViewItem_SetSpacing(this.listViewGradients, 48 + 5, 48 + 30);
        }
示例#3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //Hide until the timeline has loaded
            this.Visible = false;

            //Init settings
            Settings.Load();

            //Create model view
            modelView      = new ModelViewControl();
            modelView.Dock = DockStyle.Fill;
            this.splitContainerTimeline.Panel1.Controls.Add(modelView);

            //Create timeline
            timelineDockPanel.Content.Controls.Add(timeline = new TimelineControl()
            {
                Dock  = DockStyle.Fill,
                Model = modelView.Scene.Model
            });
            timeline.BeginPlayback += timeline_BeginPlayback;
            timeline.KeyCommand    += timeline_KeyCommand;
            timeline.ModelUpdated  += timeline_ModelUpdated;
            timeline.PausePlayback += timeline_PausePlayback;
            timeline.Ready         += timeline_Ready;
            timeline.StopPlayback  += timeline_StopPlayback;

            //Set settings
            modelView.Scene.RenderGrid  = Settings.GetSetting("display/renderGrid", true);
            modelView.Scene.RenderAxies = Settings.GetSetting("display/renderAxies", true);
            modelView.FrameRate         = Settings.GetSetting("playback/frameRate", 32);
            timeline.DebugMode          = Settings.GetSetting("timeline/debugMode", false);
        }
        public PlayerWindow()
        {
            InitializeComponent();

            MainWindow.GameSelectBox.SelectionChanged += GameSelectBox_SelectionChanged;
            timelineControl = MainWindow.TimeLine;
        }
示例#5
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public SplitManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.MouseDownPicked += owner_MouseDownPicked;
     m_owner.MouseMovePicked += owner_MouseMovePicked;
     m_owner.KeyDown         += owner_KeyDown;
 }
示例#6
0
        public Form_ToolPalette(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon = Resources.Icon_Vixen3;

            toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditColor.Image = Resources.pencil;
            toolStripButtonNewColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewColor.Image = Resources.add;
            toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteColor.Image = Resources.delete;

            toolStripButtonEditCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditCurve.Image = Resources.pencil;
            toolStripButtonNewCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewCurve.Image = Resources.add;
            toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteCurve.Image = Resources.delete;

            toolStripButtonEditGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditGradient.Image = Resources.pencil;
            toolStripButtonNewGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewGradient.Image = Resources.add;
            toolStripButtonDeleteGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteGradient.Image = Resources.delete;

            ListViewItem_SetSpacing(this.listViewColors, 48 + 5, 48 + 5);
            ListViewItem_SetSpacing(this.listViewCurves, 48 + 5, 48 + 30);
            ListViewItem_SetSpacing(this.listViewGradients, 48 + 5, 48 + 30);
        }
示例#7
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public SplitManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.MouseDownPicked += owner_MouseDownPicked;
     m_owner.MouseMovePicked += owner_MouseMovePicked;
     m_owner.KeyDown += owner_KeyDown;
 }
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The timeline control that we are permanently attached to</param>
 public SelectionManipulator(TimelineControl owner)
 {
     Owner = owner;
     Owner.MouseDownPicked += Owner_MouseDownPicked;
     Owner.KeyDown += Owner_KeyDown;
     Owner.MouseUp += Owner_MouseUp;
 }
示例#9
0
		public Form_Effects(TimelineControl timelineControl)
		{
			InitializeComponent();
			TimelineControl = timelineControl;
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
		}
示例#10
0
        /// <summary>
        ///   Calculate the bounding rectangle for a track in screen-space.
        /// </summary>
        /// <param name="track">
        ///   The track for which to calculate the bounding rectangle.
        /// </param>
        /// <param name="timeline">The timeline the track lives on.</param>
        /// <returns>The bounding rectangle for the given track.</returns>
        internal static RectangleF GetTrackExtents(ITimelineTrack track, TimelineControl timeline)
        {
            int       trackIndex = timeline.TrackIndexForTrack(track);
            IKeyFrame firstKF    = track.KeyFrames.First();
            IKeyFrame lastKF     = track.KeyFrames.Last();

            return(RectangleToTrackExtents(new RectangleF(firstKF.T, 0, lastKF.T - firstKF.T, 0), timeline, trackIndex));
        }
示例#11
0
 public Form_Effects(TimelineControl timelineControl)
 {
     InitializeComponent();
     TimelineControl = timelineControl;
     ForeColor       = ThemeColorTable.ForeColor;
     BackColor       = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
 }
示例#12
0
 public Form_Effects(TimelineControl timelineControl)
 {
     Font = SystemFonts.MessageBoxFont;
     InitializeComponent();
     TimelineControl = timelineControl;
     ForeColor = ThemeColorTable.ForeColor;
     BackColor = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
 }
示例#13
0
        public static void ApplyTimelineControlBackgroundColor(UIStyle style, Color background)
        {
            TimelineControl timelineControl = style.GetComponent <TimelineControl>();

            if (timelineControl != null)
            {
                timelineControl.BackgroundColor = background;
            }
        }
示例#14
0
		public Form_Marks(TimelineControl timelineControl)
		{
			InitializeComponent();
			TimelineControl = timelineControl;
			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
			listViewMarkCollections.BackColor = ThemeColorTable.BackgroundColor; //Over-rides the default Listview background
		}
示例#15
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public ScaleManipulator(TimelineControl owner)
 {
     Owner = owner;
     Owner.MouseDownPicked += owner_MouseDownPicked;
     Owner.MouseMovePicked += owner_MouseMovePicked;
     Owner.Picking         += owner_Picking;
     Owner.MouseUp         += owner_MouseUp;
     Owner.Paint           += owner_Paint;
 }
示例#16
0
 public Form_Effects(TimelineControl timelineControl)
 {
     Font = SystemFonts.MessageBoxFont;
     InitializeComponent();
     TimelineControl = timelineControl;
     ForeColor       = ThemeColorTable.ForeColor;
     BackColor       = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
 }
示例#17
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public SnapManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.GetSnapOffset = GetSnapOffset;
     m_owner.Paint        += owner_paint;
     m_owner.MouseUp      += owner_MouseUp;
     m_owner.MouseDown    += owner_MouseDown;
     m_owner.KeyDown      += owner_KeyDown;
 }
示例#18
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public SnapManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.GetSnapOffset = new TimelineControl.SnapOffsetFinder(GetSnapOffset);
     m_owner.Paint += owner_paint;
     m_owner.MouseUp += owner_MouseUp;
     m_owner.MouseDown += owner_MouseDown;
     m_owner.KeyDown += owner_KeyDown;
 }
示例#19
0
 public Form_Marks(TimelineControl timelineControl)
 {
     InitializeComponent();
     TimelineControl = timelineControl;
     ForeColor       = ThemeColorTable.ForeColor;
     BackColor       = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
     listViewMarkCollections.BackColor = ThemeColorTable.BackgroundColor;             //Over-rides the default Listview background
 }
示例#20
0
        public void ShouldReturnTheDurationIfMarkOutWasNotSetWhenGettingTheMarkOut()
        {
            var duration = TimeCode.FromSeconds(800d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetDuration(duration);

            Assert.AreEqual(duration, timelineControl.OutPosition);
        }
示例#21
0
        public void ShouldSetMarkIn()
        {
            var markIn = TimeCode.FromSeconds(600d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetMarkIn(markIn);

            Assert.AreEqual(markIn, timelineControl.InPosition);
        }
示例#22
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events.</summary>
 /// <param name="owner">The timeline control that we are permanently attached to</param>
 public MoveManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.MouseDownPicked += owner_MouseDownPicked;
     m_owner.MouseMovePicked += owner_MouseMovePicked;
     m_owner.MouseMove       += owner_MouseMove;
     m_owner.MouseUp         += owner_MouseUp;
     m_owner.Paint           += owner_Paint;
     m_owner.KeyDown         += owner_KeyDown;
 }
示例#23
0
        public void ShouldSetStartOffsetWhenCallingToSetStartTimeCode()
        {
            var timeCode = TimeCode.FromSeconds(450d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetStartTimeCode(timeCode);

            Assert.AreEqual(timeCode, timelineControl.StartOffset);
        }
示例#24
0
        public void ShouldReturnTrueIfMarkOutWasSet()
        {
            var markOut = TimeCode.FromSeconds(600d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetMarkOut(markOut);

            Assert.IsTrue(timelineControl.HasMarkOut);
        }
示例#25
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events.</summary>
 /// <param name="owner">The timeline control that we are permanently attached to</param>
 public MoveManipulator(TimelineControl owner)
 {
     m_owner = owner;
     m_owner.MouseDownPicked += owner_MouseDownPicked;
     m_owner.MouseMovePicked += owner_MouseMovePicked;
     m_owner.MouseMove += owner_MouseMove;
     m_owner.MouseUp += owner_MouseUp;
     m_owner.Paint += owner_Paint;
     m_owner.KeyDown += owner_KeyDown;
 }
示例#26
0
        /// <summary>
        /// Returns whether the context can insert the data object</summary>
        /// <param name="insertingObject">Data to insert; e.g., System.Windows.Forms.IDataObject</param>
        /// <returns>True iff the context can insert the data object</returns>
        public bool CanInsert(object insertingObject)
        {
            IDataObject dataObject = (IDataObject)insertingObject;

            object[] items = dataObject.GetData(typeof(object[])) as object[];
            return
                (items != null &&
                 AreTimelineItems(items) &&
                 (TimelineControl.TargetGroup == null ||
                  TimelineControl.IsEditable(TimelineControl.TargetGroup)));
        }
示例#27
0
 /// <summary>
 /// Returns whether the context can delete the selection</summary>
 /// <returns>True iff the context can delete</returns>
 public bool CanDelete()
 {
     foreach (TimelinePath timelineObject in Selection.AsIEnumerable <TimelinePath>())
     {
         if (!TimelineControl.IsEditable(timelineObject))
         {
             return(false);
         }
     }
     return(Selection.Count > 0);
 }
示例#28
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events.</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public ScrubberManipulator(TimelineControl owner)
 {
     Owner = owner;
     Owner.MouseDownPicked      += owner_MouseDownPicked;
     Owner.MouseMovePicked      += owner_MouseMovePicked;
     Owner.Picking              += owner_Picking;
     Owner.MouseMove            += MouseMoveHandler;
     Owner.MouseUp              += owner_MouseUp;
     Owner.Paint                += owner_Paint;
     Owner.BoundingRectUpdating += owner_BoundingRectUpdating;
 }
示例#29
0
 /// <summary>
 /// Constructor that permanently attaches to the given TimelineControl by subscribing to its
 /// events.</summary>
 /// <param name="owner">The TimelineControl whose events we permanently listen to</param>
 public ScrubberManipulator(TimelineControl owner)
 {
     Owner = owner;
     Owner.MouseDownPicked += owner_MouseDownPicked;
     Owner.MouseMovePicked += owner_MouseMovePicked;
     Owner.Picking += owner_Picking;
     Owner.MouseMove += MouseMoveHandler;
     Owner.MouseUp += owner_MouseUp;
     Owner.Paint += owner_Paint;
     Owner.BoundingRectUpdating += owner_BoundingRectUpdating;
 }
示例#30
0
        public void ShouldReturnStartOffsetIfMarkInWasNotSetWhenGettingTheMarkIn()
        {
            var timelineControl = new TimelineControl();

            timelineControl.SetStartTimeCode(TimeCode.FromSeconds(0d, SmpteFrameRate.Smpte2997NonDrop));

            Assert.AreEqual(timelineControl.StartOffset, timelineControl.InPosition);

            timelineControl.SetStartTimeCode(TimeCode.FromSeconds(100d, SmpteFrameRate.Smpte2997NonDrop));

            Assert.AreEqual(timelineControl.StartOffset, timelineControl.InPosition);
        }
示例#31
0
        public void ShouldGetPositionWithoutOffset()
        {
            var position    = TimeCode.FromSeconds(800d, SmpteFrameRate.Smpte2997NonDrop);
            var startOffset = TimeCode.FromSeconds(450d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetStartTimeCode(startOffset);

            var result = timelineControl.GetPositionWithoutStartOffset(position);

            Assert.AreEqual(350, result.TotalSeconds);
        }
示例#32
0
        public void ShouldReturnFalseIfTheMarkOutIsInvalid()
        {
            var markIn  = TimeCode.FromSeconds(800d, SmpteFrameRate.Smpte2997NonDrop);
            var markOut = TimeCode.FromSeconds(600d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            var resultMarkIn  = timelineControl.SetMarkIn(markIn);
            var resultMarkOut = timelineControl.SetMarkOut(markOut);

            Assert.IsTrue(resultMarkIn);
            Assert.IsFalse(resultMarkOut);
        }
示例#33
0
        public void ShouldNotSetMarkInAfterMarkOut()
        {
            var markOut = TimeCode.FromSeconds(600d, SmpteFrameRate.Smpte2997NonDrop);
            var markIn  = TimeCode.FromSeconds(800d, SmpteFrameRate.Smpte2997NonDrop);

            var timelineControl = new TimelineControl();

            timelineControl.SetMarkOut(markOut);
            timelineControl.SetMarkIn(markIn);

            Assert.AreEqual(0, timelineControl.InPosition.TotalSeconds);
            Assert.AreEqual(markOut, timelineControl.OutPosition);
        }
        public void OnDisable()
        {
            ClearController();

            if (m_Timeline != null)
            {
                m_Timeline = null;
            }

            if (m_AvatarPreview != null)
            {
                m_AvatarPreview.OnDisable();
                m_AvatarPreview = null;
            }
        }
示例#35
0
        public Form_CurveLibrary(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon            = Resources.Icon_Vixen3;
            ThemeUpdateControls.UpdateControls(this);
            toolStripCurves.Renderer = new ThemeToolStripRenderer();
            int iconSize = (int)(16 * ScalingTools.GetScaleFactor());

            toolStripCurves.ImageScalingSize = new Size(iconSize, iconSize);

            toolStripButtonEditCurve.DisplayStyle    = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditCurve.Image           = Tools.GetIcon(Resources.configuration, iconSize);
            toolStripButtonNewCurve.DisplayStyle     = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewCurve.Image            = Tools.GetIcon(Resources.addItem, iconSize);
            toolStripButtonDeleteCurve.DisplayStyle  = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteCurve.Image         = Tools.GetIcon(Resources.delete_32, iconSize);
            toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportCurves.Image        = Tools.GetIcon(Resources.folder_go, iconSize);
            toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportCurves.Image        = Tools.GetIcon(Resources.folder_open, iconSize);

            listViewCurves.AllowDrop = true;

            var xml = new XMLProfileSettings();

            _curveLibraryImageScale = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CurveLibraryImageScale", Name), "1"), CultureInfo.InvariantCulture);
            _curveLibraryTextScale  = Convert.ToDouble(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CurveLibraryTextScale", Name), "1"), CultureInfo.InvariantCulture);

            if (_curveLibraryImageScale < 0.1)
            {
                _curveLibraryImageScale = 0.1;
            }
            if (_curveLibraryTextScale < 0.2)
            {
                _curveLibraryTextScale = 0.2;
            }
            ImageSetup();

            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            //Over-ride the auto theme listview back color
            listViewCurves.BackColor = ThemeColorTable.BackgroundColor;

            listViewCurves.Alignment = ListViewAlignment.Top;
            _curveLibrary            = ApplicationServices.Get <IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary;
        }
示例#36
0
        private void owner_MouseMovePicked(object sender, HitEventArgs e)
        {
            string toolTipText = null;

            if (m_active)
            {
                e.Handled = true;

                if (e.HitRecord.Type == HitType.Interval &&
                    e.MouseEvent.Button == MouseButtons.None &&
                    !m_owner.IsUsingMouse &&
                    m_owner.IsEditable(e.HitRecord.HitPath))
                {
                    SetCursor();
                    TimelinePath hitPath   = e.HitRecord.HitPath;
                    IInterval    hitObject = (IInterval)e.HitRecord.HitTimelineObject;
                    float        worldX    = GdiUtil.InverseTransform(m_owner.Transform, e.MouseEvent.Location.X);

                    //Make sure the snap-to indicator line is drawn.
                    float delta = m_owner.GetSnapOffset(new[] { worldX }, s_snapOptions);

                    worldX += delta;
                    worldX  = m_owner.ConstrainFrameOffset(worldX);

                    Matrix localToWorld = TimelineControl.CalculateLocalToWorld(hitPath);

                    if (worldX <= GdiUtil.Transform(localToWorld, hitObject.Start) ||
                        worldX >= GdiUtil.Transform(localToWorld, hitObject.Start + hitObject.Length))
                    {
                        // Clear the results since a split is impossible.
                        m_owner.GetSnapOffset(new float[] { }, s_snapOptions);
                    }
                    else
                    {
                        toolTipText = worldX.ToString();
                    }
                }
            }

            if (toolTipText != null)
            {
                m_toolTip.Show(toolTipText, m_owner, e.MouseEvent.Location);
            }
            else
            {
                m_toolTip.Hide(m_owner);
            }
        }
示例#37
0
        public FindEffectForm(TimelineControl timelineControl, SequenceLayers layerManager)
        {
            InitializeComponent();
            _layerManager = layerManager;
            contextMenuStrip1.Renderer = new ThemeToolStripRenderer();
            Icon            = Resources.Icon_Vixen3;
            TimelineControl = timelineControl;

            comboBoxFind.SelectedIndex = 0;

            listViewEffectStartTime.BeginUpdate();
            listViewEffectStartTime.ColumnAutoSize();
            listViewEffectStartTime.SetLastColumnWidth();
            listViewEffectStartTime.EndUpdate();
            ThemeUpdateControls.UpdateControls(this);
        }
示例#38
0
        /// <summary>
        ///   Calculate the bounding rectangle in screen-space that would hold a track of the same extents as the given rectangle.
        /// </summary>
        /// <param name="rect">A rectangle which left and right edge represent the start and end of a track item. The top and bottom edge are ignored.</param>
        /// <param name="timeline">The timeline the assumed track would live on. Used to determine the top and bottom edge of the bounding rectangle.</param>
        /// <param name="assumedTrackIndex">The assumed index of the track. Used to determine the top edge of the bounding rectangle.</param>
        /// <returns>A bounding rectangle that would hold a track of the same extents as the given rectangle.</returns>
        internal static RectangleF RectangleToTrackExtents(RectangleF rect, TimelineControl timeline, int assumedTrackIndex)
        {
            Rectangle trackAreaBounds = timeline.GetTrackAreaBounds();

            int actualRowHeight = (int)((timeline.TrackHeight) * timeline.RenderingScale.Y + timeline.TrackSpacing);
            // Calculate the Y offset for the track.
            int trackOffsetY = (int)(trackAreaBounds.Y + (actualRowHeight * assumedTrackIndex) + timeline.RenderingOffset.Y);

            // Calculate the X offset for track.
            int trackOffsetX = (int)(trackAreaBounds.X + (rect.X * timeline.RenderingScale.X) + timeline.RenderingOffset.X);

            // The extent of the track, including the border
            RectangleF trackExtent = new RectangleF(trackOffsetX, trackOffsetY, rect.Width * timeline.RenderingScale.X, timeline.TrackHeight * timeline.RenderingScale.Y);

            return(trackExtent);
        }
示例#39
0
        private bool IsTrackVisible(ITrack track)
        {
            TimelineLayout layout = TimelineControl.GetLayout();
            RectangleF     trackBounds;

            if (layout.TryGetBounds(new TimelinePath(track), out trackBounds))
            {
                RectangleF clientRectF = m_timelineControl.VisibleClientRectangle;
                if (clientRectF.Top <= trackBounds.Bottom &&
                    clientRectF.Bottom >= trackBounds.Top)
                {
                    return(true);
                }
            }
            return(false);
        }
示例#40
0
 public Form_Marks(TimelineControl timelineControl)
 {
     InitializeComponent();
     int iconSize = (int)(20 * ScalingTools.GetScaleFactor());
     toolStripButtonAddMarkCollection.Image = Tools.GetIcon(Resources.add, iconSize);
     toolStripButtonAddMarkCollection.DisplayStyle = ToolStripItemDisplayStyle.Image;
     toolStripButtonDeleteMarkCollection.Image = Tools.GetIcon(Resources.delete, iconSize);
     toolStripButtonDeleteMarkCollection.DisplayStyle = ToolStripItemDisplayStyle.Image;
     toolStripButtonEditMarkCollection.Image = Tools.GetIcon(Resources.pencil, iconSize);
     toolStripButtonEditMarkCollection.DisplayStyle = ToolStripItemDisplayStyle.Image;
     toolStrip1.ImageScalingSize = new Size(iconSize, iconSize);
     TimelineControl = timelineControl;
     ForeColor = ThemeColorTable.ForeColor;
     BackColor = ThemeColorTable.BackgroundColor;
     ThemeUpdateControls.UpdateControls(this);
     contextMenuStrip1.Renderer = new ThemeToolStripRenderer();
     listViewMarkCollections.BackColor = ThemeColorTable.BackgroundColor; //Over-rides the default Listview background
     toolStripButtonDeleteMarkCollection.Enabled = false;
 }
 public void OnTimelineEventChanged(object sender, TimelineControl.Timeline.EventChangedArgs arg)
 {
     if (arg.kind == TimelineControl.Timeline.EventChangedKind.Add)
     {
         var addData = TimelineModelConverter.ConvertAsNew(arg.model);
         ModelsComposite.TimelineEventModelManager.AddModel(addData);
         arg.model.SourceObject = addData;
     }
     else if (arg.kind == TimelineControl.Timeline.EventChangedKind.Modify)
     {
         TimelineModelConverter.ConvertAsModify(arg.model, arg.model.SourceObject as TimelineEventModel);
         EventAggregator.OnModelDataChanged(this, new ModelValueChangedEventArgs());
     }
     else
     {
         ModelsComposite.TimelineEventModelManager.RemoveModel(arg.model.SourceObject as TimelineEventModel);
     }
 }
 public TimelineViewModel(TimelineControl.Timeline control)
 {
     _view = control;
 }
示例#43
0
        /// <summary>
        /// Gets the offset from one of the world snap points to the closest non-selected object's edge</summary>
        /// <param name="movingPoints">The x-coordinates to snap "from", in world coordinates</param>
        /// <param name="options">The options to control the behavior. If null, the defaults are used.</param>
        /// <returns>The value to be added, to GetDragOffset().X, for example. Is in world coordinates.</returns>
        private float GetSnapOffset(IEnumerable<float> movingPoints, TimelineControl.SnapOptions options)
        {
            //we want to recalculate m_snapInfo and reflect changes to the snap-to lines
            m_snapInfo.Clear();
            m_owner.Invalidate();

            if (options == null)
                options = new TimelineControl.SnapOptions();

            // Check for user-forced snapping and no-snapping.
            if (options.CheckModifierKeys)
            {
                Keys modKeys = Control.ModifierKeys;
                if (s_deactivatorKeys != Keys.None &&
                    (modKeys & s_deactivatorKeys) == s_deactivatorKeys)
                    return 0.0f;
                if (s_activatorKeys != Keys.None &&
                    (modKeys & s_activatorKeys) != s_activatorKeys)
                    return 0.0f;
            }

            // Prepare helper object on each moving point.
            foreach (float snapping in movingPoints)
            {
                m_snapInfo.Add(new SnapOffsetInfo(snapping));
            }
            if (m_snapInfo.Count == 0)
                return 0.0f;
            
            // Find the closest IEvent.
            float worldSnapTolerance = GdiUtil.InverseTransformVector(m_owner.Transform, s_snapTolerance);

            List<TimelinePath> events = new List<TimelinePath>(
                TimelineControl.GetObjects<IEvent>(m_owner.Timeline));

            // Allow for snapping to a scrubber manipulator.
            if (m_scrubber != null && options.IncludeScrubber)
                events.Add(new TimelinePath(m_scrubber));

            foreach (TimelinePath path in events)
            {
                if (options.IncludeSelected ||
                    !m_owner.Selection.SelectionContains(path))
                {
                    IEvent snapToEvent = (IEvent)path.Last;

                    if (options.Filter == null ||
                        options.Filter(snapToEvent, options))
                    {
                        Matrix localToWorld = TimelineControl.CalculateLocalToWorld(path);
                        float start, length;
                        GetEventDimensions(snapToEvent, localToWorld, out start, out length);

                        foreach (SnapOffsetInfo info in m_snapInfo)
                        {
                            info.Update(start, snapToEvent, worldSnapTolerance);
                            if (length > 0)
                                info.Update(start + length, snapToEvent, worldSnapTolerance);
                        }
                    }
                }
            }

            // Keep only the shortest distance snap-to points. Could be multiple in case of tie.
            SnapOffsetInfo.RemoveInvalid(m_snapInfo);
            if (m_snapInfo.Count == 0)
                return 0.0f;

            SnapOffsetInfo topInfo = m_snapInfo[0];
            return topInfo.Offset;
        }
示例#44
0
 public Form_Effects(TimelineControl timelineControl)
 {
     InitializeComponent();
     TimelineControl = timelineControl;
 }
示例#45
0
 private void owner_BoundingRectUpdating(object sender, TimelineControl.BoundingRectEventArgs e)
 {
     e.NewClientRect = m_handleRect;
 }
        void timelineControl_SelectionChanged(object sender, TimelineControl.SelectionChangedEventArgs e)
        {
            isNotified = true;
            if (timelineControl.selectedEntry != null)
                {
                trafficLightNameEdit.Text = timelineControl.selectedEntry.name;
                groupComboBox.SelectedItem = timelineControl.selectedEntry.parentGroup;
                }

            if (timelineControl.selectedGroup != null)
                {
                groupTitleEdit.Text = timelineControl.selectedGroup.title;
                if (timelineControl.selectedEntry == null)
                    {
                    groupComboBox.SelectedItem = timelineControl.selectedGroup;
                    }
                }
            OnSelectedEntryChanged(new SelectedEntryChangedEventArgs());
            isNotified = false;
        }
 private void timelineControl_EventChanged(object sender, TimelineControl.EventChangedEventArgs e)
 {
     switch (e.dragAction)
         {
         case TimelineControl.DragNDrop.MOVE_EVENT:
             statusLabel.Text = "verschiebe Event, Start: " + e.handeledEvent.eventTime + "s, Ende: " + (e.handeledEvent.eventTime + e.handeledEvent.eventLength) + "s";
             changedEvent = true;
             break;
         case TimelineControl.DragNDrop.MOVE_EVENT_START:
             statusLabel.Text = "verschiebe Event-Start: " + e.handeledEvent.eventTime + "s";
             changedEvent = true;
             break;
         case TimelineControl.DragNDrop.MOVE_EVENT_END:
             statusLabel.Text = "verschiebe Event-Ende: " + (e.handeledEvent.eventTime + e.handeledEvent.eventLength) + "s";
             changedEvent = true;
             break;
         default:
             break;
         }
 }
示例#48
0
        private bool MoveSnapFilter(IEvent testEvent, TimelineControl.SnapOptions options)
        {
            ITimelineReference movingReference = options.FilterContext as ITimelineReference;
            if (movingReference == null)
                return true;

            IHierarchicalTimeline movingTimeline = movingReference.Target;
            if (movingTimeline == null)
                return true;

            ITimeline owningTimeline = null;
            if (testEvent is ITimelineReference)
                owningTimeline = ((ITimelineReference)testEvent).Parent;
            else if (testEvent is IInterval)
                owningTimeline = ((IInterval)testEvent).Track.Group.Timeline;
            else if (testEvent is IKey)
                owningTimeline = ((IKey)testEvent).Track.Group.Timeline;
            else if (testEvent is IMarker)
                owningTimeline = ((IMarker)testEvent).Timeline;

            // Is the reference being compared to an object that it owns? Never snap!
            if (owningTimeline == movingTimeline)
                return false;

            // Is the reference being compared against a sibling object? Snap away.
            if (owningTimeline == movingReference.Parent)
                return true;

            // to-do: support a true hierarchy. We can't support directed acyclic graphs because
            //  the Layout implementation uses a Dictionary of ITimelineObjects and the same object
            //  can't have multiple layout rectangles. We could support a tree hierarchy, though.
            //// The test object may be a grandchild of the moving reference. Look for a parent.
            //owningTimeline = owningTimeline.Parent;

            return true;
        }
示例#49
0
		public Form_ToolPalette(TimelineControl timelineControl)
		{
			InitializeComponent();
			TimelineControl = timelineControl;
			Icon = Resources.Icon_Vixen3;
			toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonEditColor.Image = Resources.pencil;
			toolStripButtonNewColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonNewColor.Image = Resources.add;
			toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonDeleteColor.Image = Resources.delete;
			toolStripButtonExportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonExportColors.Image = Resources.disk;
			toolStripButtonImportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonImportColors.Image = Resources.folder_open;

			toolStripButtonEditCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonEditCurve.Image = Resources.pencil;
			toolStripButtonNewCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonNewCurve.Image = Resources.add;
			toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonDeleteCurve.Image = Resources.delete;
			toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonExportCurves.Image = Resources.disk;
			toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonImportCurves.Image = Resources.folder_open;

			toolStripButtonEditGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonEditGradient.Image = Resources.pencil;
			toolStripButtonNewGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonNewGradient.Image = Resources.add;
			toolStripButtonDeleteGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonDeleteGradient.Image = Resources.delete;
			toolStripButtonExportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonExportGradients.Image = Resources.disk;
			toolStripButtonImportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
			toolStripButtonImportGradients.Image = Resources.folder_open;

			ListViewItem_SetSpacing(listViewColors, 48 + 5, 48 + 5);
			ListViewItem_SetSpacing(listViewCurves, 48 + 5, 48 + 30);
			ListViewItem_SetSpacing(listViewGradients, 48 + 5, 48 + 30);

			listViewColors.AllowDrop = true;
			listViewCurves.AllowDrop = true;
			listViewGradients.AllowDrop = true;

			ForeColor = ThemeColorTable.ForeColor;
			BackColor = ThemeColorTable.BackgroundColor;
			ThemeUpdateControls.UpdateControls(this);
			foreach (Control tab in tabControlEX1.TabPages)
			{
				tab.BackColor = ThemeColorTable.BackgroundColor;
				tab.ForeColor = ThemeColorTable.ForeColor;
			}
			tabControlEX1.SelectedTabColor = ThemeColorTable.BackgroundColor;
			tabControlEX1.TabColor = ThemeColorTable.BackgroundColor;
			tabControlEX1.SelectedTab = tabPageEX1;
			//Over-ride the auto theme listview back color
			listViewColors.BackColor = ThemeColorTable.BackgroundColor;
			listViewCurves.BackColor = ThemeColorTable.BackgroundColor;
			listViewGradients.BackColor = ThemeColorTable.BackgroundColor;
		}
示例#50
0
        public Form_ToolPalette(TimelineControl timelineControl)
        {
            InitializeComponent();
            TimelineControl = timelineControl;
            Icon = Resources.Icon_Vixen3;
            ThemeUpdateControls.UpdateControls(this);
            var t = (int)(48*ScalingTools.GetScaleFactor());
            _imageSize = new Size(t,t);
            int iconSize = (int)(16 * ScalingTools.GetScaleFactor());
            toolStripCurves.ImageScalingSize = new Size(iconSize, iconSize);
            toolStripGradients.ImageScalingSize = new Size(iconSize, iconSize);
            toolStripColors.ImageScalingSize = new Size(iconSize, iconSize);
            toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditColor.Image = Tools.GetIcon(Resources.pencil, iconSize);

            toolStripButtonNewColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewColor.Image = Tools.GetIcon(Resources.add, iconSize);
            toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteColor.Image = Tools.GetIcon(Resources.delete, iconSize);
            toolStripButtonExportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportColors.Image = Tools.GetIcon(Resources.disk, iconSize);
            toolStripButtonImportColors.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportColors.Image = Tools.GetIcon(Resources.folder_open, iconSize);

            toolStripButtonEditCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditCurve.Image = Tools.GetIcon(Resources.pencil, iconSize);
            toolStripButtonNewCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewCurve.Image = Tools.GetIcon(Resources.add, iconSize);
            toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteCurve.Image = Tools.GetIcon(Resources.delete, iconSize);
            toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportCurves.Image = Tools.GetIcon(Resources.disk, iconSize);
            toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportCurves.Image = Tools.GetIcon(Resources.folder_open, iconSize);

            toolStripButtonEditGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonEditGradient.Image = Tools.GetIcon(Resources.pencil, iconSize);
            toolStripButtonNewGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonNewGradient.Image = Tools.GetIcon(Resources.add, iconSize);
            toolStripButtonDeleteGradient.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonDeleteGradient.Image = Tools.GetIcon(Resources.delete, iconSize);
            toolStripButtonExportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonExportGradients.Image = Tools.GetIcon(Resources.disk, iconSize);
            toolStripButtonImportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image;
            toolStripButtonImportGradients.Image = Tools.GetIcon(Resources.folder_open, iconSize);

            short sideGap = (short)(_imageSize.Width + (5*ScalingTools.GetScaleFactor()));

            short topGap = (short)(_imageSize.Width + ScalingTools.MeasureHeight(Font, "Test")* 2);

            ListViewItem_SetSpacing(listViewColors, sideGap, sideGap);
            ListViewItem_SetSpacing(listViewCurves, sideGap, topGap);
            ListViewItem_SetSpacing(listViewGradients, sideGap, topGap);

            listViewColors.AllowDrop = true;
            listViewCurves.AllowDrop = true;
            listViewGradients.AllowDrop = true;

            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this);
            foreach (Control tab in tabControlEX1.TabPages)
            {
                tab.BackColor = ThemeColorTable.BackgroundColor;
                tab.ForeColor = ThemeColorTable.ForeColor;
            }
            tabControlEX1.SelectedTabColor = ThemeColorTable.BackgroundColor;
            tabControlEX1.TabColor = ThemeColorTable.BackgroundColor;
            tabControlEX1.SelectedTab = tabPageEX1;
            tabControlEX1.SizeMode = TabSizeMode.Fixed;
            SizeF size = ScalingTools.MeasureString(Font, "Gradientsss");
            tabControlEX1.ItemSize = size.ToSize();
            //Over-ride the auto theme listview back color
            listViewColors.BackColor = ThemeColorTable.BackgroundColor;
            listViewCurves.BackColor = ThemeColorTable.BackgroundColor;
            listViewGradients.BackColor = ThemeColorTable.BackgroundColor;
        }