private void allTempoButton_Click(object sender, EventArgs e) { IIntEffect effect = m_Element.Effects.Tempo; Actions.Actions.Instance.AddNew(new Actions.AllFileElementsTempoChangeAction(m_Container, pitchBox.Checked, effect.Random, effect.FixValue, effect.MinRandomValue, effect.MaxRandomValue), m_Project); }
private void tempoBox_CheckedChanged(object sender, EventArgs e) { if (!listen) { return; } IIntEffect effect = m_Element.Effects.Tempo; List <IIntEffect> effects = new List <IIntEffect>(); effects.Add(effect); Actions.Actions.Instance.AddNew(new Actions.IntEffectChangeAction(m_ElementList, effects, tempoBox.Checked, effect.Random, effect.FixValue, effect.MinRandomValue, effect.MaxRandomValue), m_Project); }
public override void Undo(Ares.Data.IProject project) { for (int i = 0; i < m_FileElements.Count; ++i) { IIntEffect effect = GetEffect(m_FileElements[i]); effect.Active = m_OldActives[i]; effect.FixValue = m_OldFixValues[i]; effect.Random = m_OldRandoms[i]; effect.MinRandomValue = m_OldMinRandoms[i]; effect.MinRandomValue = m_OldMaxRandoms[i]; ElementChanges.Instance.ElementChanged(m_FileElements[i].Id); } }
public override void Do(Ares.Data.IProject project) { foreach (IFileElement element in m_FileElements) { IIntEffect effect = GetEffect(element); effect.Active = m_NewActive; effect.FixValue = m_NewFixValue; effect.Random = m_NewRandom; effect.MinRandomValue = m_NewMinRandom; effect.MaxRandomValue = m_NewMaxRandom; ElementChanges.Instance.ElementChanged(element.Id); } }
public TempoDialog(IList <IFileElement> elements, IProject project) { InitializeComponent(); Element = elements[0]; m_Project = project; IIntEffect effect = Element.Effects.Tempo; List <IIntEffect> effects = new List <IIntEffect>(); for (int i = 0; i < elements.Count; ++i) { effects.Add(elements[i].Effects.Tempo); } Action = new IntEffectChangeAction(elements, effects, true, effect.Random, effect.FixValue, effect.MinRandomValue, effect.MaxRandomValue); fixedButton.Checked = !effect.Random; randomButton.Checked = effect.Random; fixedValueUpDown.Value = effect.FixValue; minRandomUpDown.Value = effect.MinRandomValue; maxRandomUpDown.Value = effect.MaxRandomValue; }
protected void SetValues(IGeneralElementContainer container, bool active, bool random, int fixValue, int minRandomValue, int maxRandomValue) { m_FileElements = container.GetFileElements(); m_OldActives = new List <bool>(); m_OldFixValues = new List <int>(); m_OldRandoms = new List <bool>(); m_OldMinRandoms = new List <int>(); m_OldMaxRandoms = new List <int>(); foreach (IFileElement element in m_FileElements) { IIntEffect effect = GetEffect(element); m_OldActives.Add(effect.Active); m_OldFixValues.Add(effect.FixValue); m_OldRandoms.Add(effect.Random); m_OldMinRandoms.Add(effect.MinRandomValue); m_OldMaxRandoms.Add(effect.MaxRandomValue); } m_NewActive = active; m_NewFixValue = fixValue; m_NewRandom = random; m_NewMinRandom = minRandomValue; m_NewMaxRandom = maxRandomValue; }