Exemple #1
0
 private void StopDetection()
 {
     Bass.ChannelPause(_streamId);
     _isRecording = false;
     _pitchesThisUpdate.Clear();
     _detectedPitches.Clear();
 }
        // Text is inputed into the Code text area.
        // Used to collapse the undo stack so it's (mostly) consistent with a text editor.
        void OnCodeInput(ChangeEvent <string> e)
        {
            if (m_performedUndoRedo)
            {
                m_redoStack.Clear();
                m_undoGroupCount    = 0;
                m_performedUndoRedo = false;
            }

            m_undoStack.Push(m_code);
            m_code = e.newValue;

            float curTime = Time.realtimeSinceStartup;

            // .333 feels right; may need more adjustments
            if ((curTime - lastEditTime) < 0.333f)
            {
                m_undoGroupCount++;
            }
            else
            {
                // collapse undo operations after 0.333 seconds.
                for (int i = 0; i < m_undoGroupCount; i++)
                {
                    m_undoStack.Pop();
                }
                m_undoGroupCount = 0;
            }
            lastEditTime = curTime;
        }
 public void AddToUndoStack(IUndoRedoItem item)
 {
     if (!_isChanging)
     {
         _undoStack.Push(item);
         _redoStack.Clear();
     }
 }
Exemple #4
0
 public override void Delete()
 {
     base.Delete();
     timings?.Clear();
     frames?.Clear();
     if (glqueryStart > 0)
     {
         GL.DeleteQuery(glqueryStart);
         glqueryStart = 0;
     }
 }
Exemple #5
0
 public void Reset()
 {
     UndoStack.Clear();
     RedoStack.Clear();
 }
Exemple #6
0
 public void Update()
 {
     UndoStack.Push(Program.Test.Copy());
     RedoStack.Clear();
 }