public ChangingEvent(TimeSpanEdit e) { Edit = e; PreviousSeconds = e.m_Seconds; ModifierKeys = Control.ModifierKeys; }
/// <summary> /// Event handler when TimeSpanEdit changes finished /// </summary> void ChangeFinished(object sender, TimeSpanEdit.ChangingEvent e) { Adjust(5); if (ChangesFinished != null) ChangesFinished(this, this); }
/// <summary> /// Event handler when Length TimeSpanEdit is changing /// </summary> void LengthChanging(object sender, TimeSpanEdit.ChangingEvent e) { float change = e.Edit.Seconds - e.PreviousSeconds; if (change != 0) { // Save current length float seconds = e.Edit.Seconds; // Update end (to make track longer) End += change; if (e.Locked) { Start += change; if (StartChanged != null) { // Keep following track lengths the same StartChanged(this, new CascadingEvent(this, change)); } } // Restore current length e.Edit.Seconds = seconds; } }
/// <summary> /// Event handler when Gap TimeSpanEdit is changing /// </summary> void GapChanging(object sender, TimeSpanEdit.ChangingEvent e) { float change = e.Edit.Seconds - e.PreviousSeconds; if (change != 0) { // Save current gap float seconds = e.Edit.Seconds; // Move start Start += change; if (e.Locked && StartChanged != null) { // Keep following track lengths the same StartChanged(this, new CascadingEvent(this, change)); } if ((e.ModifierKeys & Keys.Control) != 0 && GapChanged != null) { // Change all the gaps GapChanged(this, new CascadingEvent(this, change)); } // Restore current gap e.Edit.Seconds = seconds; } }
/// <summary> /// Event handler when End TimeSpanEdit is changing /// </summary> void EndChanging(object sender, TimeSpanEdit.ChangingEvent e) { End = e.Edit.Seconds; float change = e.Edit.Seconds - e.PreviousSeconds; if (change != 0 && e.Locked) { // Move start cursor for next track as well Start += change; if (StartChanged != null) { // Keep following track lengths the same StartChanged(this, new CascadingEvent(this, change)); } } }
/// <summary> /// Event handler when Start TimeSpanEdit is changing /// </summary> void StartChanging(object sender, TimeSpanEdit.ChangingEvent e) { Start = e.Edit.Seconds; float change = e.Edit.Seconds - e.PreviousSeconds; if (change != 0 && e.Locked) { if (StartChanged != null) { // Keep following track lengths the same StartChanged(this, new CascadingEvent(this, change)); } } }