Ejemplo n.º 1
0
        /// <inheritdoc />
        public override void OnMouseMove(Vector2 location)
        {
            if (_isMoving)
            {
                var moveLocation      = Root.MousePosition;
                var moveLocationDelta = moveLocation - _startMoveLocation;
                var moveDelta         = (int)(moveLocationDelta.X / Timeline.UnitsPerSecond * _timeline.FramesPerSecond);
                var durationFrames    = _timeline.DurationFrames;

                if (_isStart)
                {
                    // TODO: editing timeline start frame?
                }
                else
                {
                    _timeline.DurationFrames = _startMoveDuration + moveDelta;
                }

                if (_timeline.DurationFrames != durationFrames)
                {
                    _timeline.MarkAsEdited();
                }
            }
            else
            {
                base.OnMouseMove(location);
            }
        }
Ejemplo n.º 2
0
            /// <inheritdoc />
            public override void Hide()
            {
                if (!Visible)
                {
                    return;
                }

                Focus(null);

                if (_isDirty)
                {
                    if (_beforeData != null)
                    {
                        if (_undoContext is Track track)
                        {
                            var after = EditTrackAction.CaptureData(track);
                            if (!Utils.ArraysEqual(_beforeData, after))
                            {
                                _timeline.Undo.AddAction(new EditTrackAction(_timeline, track, _beforeData, after));
                            }
                        }
                        else if (_undoContext is Timeline)
                        {
                            var after = EditTimelineAction.CaptureData(_timeline);
                            if (!Utils.ArraysEqual(_beforeData, after))
                            {
                                _timeline.Undo.AddAction(new EditTimelineAction(_timeline, _beforeData, after));
                            }
                        }
                    }
                    _timeline.MarkAsEdited();
                }

                base.Hide();
            }
Ejemplo n.º 3
0
 private void OnColorChanged(Color color, bool sliding)
 {
     IconColor = color;
     Timeline.MarkAsEdited();
 }
Ejemplo n.º 4
0
 private void OnMuteButtonStateChanged(CheckBox checkBox)
 {
     Mute = !checkBox.Checked;
     Timeline.MarkAsEdited();
 }