// create a SoundEvent and initialize it protected EventOrientedKeyView CreateEvent(EventOrientedKey key) { EventOrientedKeyView view = CreateNewEvent(key); view.ContextMenu = OrientedKeyViewContextMenu.Instance; this.Controls.Add(view); this._Events.Add(view); return(view); }
private void AddKey(float time) { SoundKey newKey = ScriptableObject.CreateInstance <SoundKey>(); newKey.Clip = null; newKey.FireTime = time; EventOrientedKeyView e = CreateEvent(newKey); RebuildTrackKeys(); InspectorProperties.Select(e); }
/// <summary> /// add key at position /// </summary> /// <param name="x">position inside track</param> private void AddKeyAt(float x, EventKey newKey) { TimeLine timeLine = FindInParents <TimeLine>(); if (timeLine != null) { // convert to local position of TimeBar - because of zooming x -= timeLine.View.ScrollPosition.x; newKey.FireTime = (float)timeLine.TimeBar.GetTime(x); EventOrientedKeyView e = CreateEvent(newKey); InspectorProperties.Select(e); RebuildTrackKeys(); } }
/// <summary> /// Delete SoundEvent /// </summary> /// <param name="soundEvent">SoundEvent to delete</param> public override void Delete(KeyView keyView) { EventOrientedKeyView ev = keyView as EventOrientedKeyView; if (ev != null) { if (_Events.Remove(ev)) { if (InspectorProperties.IsSelected(ev)) { InspectorProperties.Select(null); } this.Controls.Remove(keyView); RebuildTrackKeys(); } } }
void deleteItem_Click(object sender, System.EventArgs e) { EventOrientedKeyView view = (EventOrientedKeyView)Owner; ((EventOrientedTrackBar)view.TrackBar).Delete(view); }
public OrientedKeyViewProperties(EventOrientedKeyView view) : base(view.Key) { _View = view; }