Beispiel #1
0
        public void ChangeTrack(Track trk)
        {
            lock (LoadSync)
            {
                using (_tracksync.AcquireWrite())
                {
                    AudioService.Stop();
                    CurrentTools.SelectedTool.Stop();
                    _loadingTrack = true;
                    Stop();
                    _flag  = null;
                    _track = trk;

                    Timeline = new Timeline(trk);
                    Timeline.FrameInvalidated += FrameInvalidated;
                    InitCamera();
                    _refreshtrack = true;
                    _cells.Clear();
                    foreach (var line in trk.LineLookup.Values)
                    {
                        _cells.AddLine(line);
                    }
                    Reset();
                    Camera.SetFrameCenter(Timeline.GetFrame(0).CalculateCenter());
                    _loadingTrack = false;
                    if (CurrentTools.SelectedTool.Active)
                    {
                        CurrentTools.SelectedTool.Stop();
                    }
                    UndoManager = new UndoManager();
                    ResetTrackChangeCounter();
                }
            }
            Invalidate();
            GC.Collect();//this is probably safest place to make the gc work
            MoveStartWarned = false;
        }
Beispiel #2
0
 public void ResetUndo()
 {
     UndoManager = new UndoManager(this);
 }
Beispiel #3
0
 /// <summary>
 /// Disables saving changes to the undo buffer.
 /// </summary>
 public void DisableUndo()
 {
     _undo = null;
 }
Beispiel #4
0
 public Track()
 {
     UndoManager = new UndoManager(this);
 }