예제 #1
0
			public ChangingEvent(TimeSpanEdit e) {
				Edit = e;
				PreviousSeconds = e.m_Seconds;
				ModifierKeys = Control.ModifierKeys;
			}
예제 #2
0
		/// <summary>
		/// Event handler when TimeSpanEdit changes finished
		/// </summary>
		void ChangeFinished(object sender, TimeSpanEdit.ChangingEvent e) {
			Adjust(5);
			if (ChangesFinished != null)
				ChangesFinished(this, this);
		}
예제 #3
0
		/// <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;
			}
		}
예제 #4
0
		/// <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;
			}
		}
예제 #5
0
		/// <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));
				}
			}
		}
예제 #6
0
		/// <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));
				}
			}
		}