public void GetProperties(out int[] frets, out int[] channels, out ChordStrum chordStrum, out bool isSlide, out bool isSlideReverse, out bool isHammeron, out GuitarChordRootNoteConfig rootNoteConfig) { rootNoteConfig = this.RootNoteConfig.Clone(); frets = Utility.Null6.ToArray(); channels = Utility.Null6.ToArray(); foreach (var n in Notes) { frets[n.String] = n.Fret; channels[n.String] = n.Channel; } var ct = Modifiers.Select(x => (ChordModifierType)x.Type).ToArray(); chordStrum = ChordStrum.Normal; if (ct.Any(x => x == ChordModifierType.ChordStrumHigh)) { chordStrum |= ChordStrum.High; } if (ct.Any(x => x == ChordModifierType.ChordStrumMed)) { chordStrum |= ChordStrum.Mid; } if (ct.Any(x => x == ChordModifierType.ChordStrumLow)) { chordStrum |= ChordStrum.Low; } isSlide = ct.Any(x => x == ChordModifierType.SlideReverse || x == ChordModifierType.Slide); isSlideReverse = ct.Any(x => x == ChordModifierType.SlideReverse); isHammeron = ct.Any(x => x == ChordModifierType.Hammeron); }
public SerializedChord() { Notes = new List <SerializedChordNote>(); Modifiers = new List <SerializedChordModifier>(); RootNoteConfig = new GuitarChordRootNoteConfig(); Names = new List <ChordNameMeta>(); }
public SerializedChord() { Notes = new List<SerializedChordNote>(); Modifiers = new List<SerializedChordModifier>(); RootNoteConfig = new GuitarChordRootNoteConfig(); Names = new List<ChordNameMeta>(); }
public GuitarChordConfig() { Frets = Utility.Null6.ToArray(); Channels = Utility.Null6.ToArray(); IsSlide = false; IsSlideReverse = false; IsHammeron = false; StrumMode = ChordStrum.Normal; RootNoteConfig = null; }
public GuitarChordConfig(int[] frets, int[] channels, bool isSlide, bool isSlideReverse, bool isHammeron, ChordStrum strumMode, GuitarChordRootNoteConfig rootNoteConfig) : this() { this.RootNoteConfig = rootNoteConfig; if (frets != null) { Frets = frets.ToArray(); } if (channels != null) { Channels = channels.ToArray(); if (Frets != null) { for (int x = 0; x < Frets.Count(); x++) { if (Frets[x].IsNotNull() && Channels[x].IsNull()) { Channels[x] = Utility.ChannelDefault; } else if (Frets[x].IsNull() && Channels[x].IsNotNull()) { Channels[x] = Int32.MinValue; } } } if (Channels.Any(x => x == Utility.ChannelX)) { for (int x = 0; x < Channels.Count(); x++) { if (Channels[x].IsNotNull()) { Channels[x] = Utility.ChannelX; } } } } IsSlide = isSlide | isSlideReverse; IsSlideReverse = isSlideReverse; IsHammeron = isHammeron; StrumMode = strumMode; }
public GuitarChordConfig(int[] frets, int[] channels, bool isSlide, bool isSlideReverse, bool isHammeron, ChordStrum strumMode, GuitarChordRootNoteConfig rootNoteConfig) : this() { this.RootNoteConfig = rootNoteConfig; if (frets != null) { Frets = frets.ToArray(); } if (channels != null) { Channels = channels.ToArray(); if (Frets != null) { for (int x = 0; x < Frets.Count(); x++) { if (Frets[x].IsNotNull() && Channels[x].IsNull()) { Channels[x] = Utility.ChannelDefault; } else if (Frets[x].IsNull() && Channels[x].IsNotNull()) { Channels[x] = Int32.MinValue; } } } if (Channels.Any(x => x == Utility.ChannelX)) { for (int x = 0; x < Channels.Count(); x++) { if (Channels[x].IsNotNull()) { Channels[x] = Utility.ChannelX; } } } } IsSlide = isSlide | isSlideReverse; IsSlideReverse = isSlideReverse; IsHammeron = isHammeron; StrumMode = strumMode; }
public void GetProperties(out int[] frets, out int[] channels, out ChordStrum chordStrum, out bool isSlide, out bool isSlideReverse, out bool isHammeron, out GuitarChordRootNoteConfig rootNoteConfig) { rootNoteConfig = this.RootNoteConfig.Clone(); frets = Utility.Null6.ToArray(); channels = Utility.Null6.ToArray(); foreach (var n in Notes) { frets[n.String] = n.Fret; channels[n.String] = n.Channel; } var ct = Modifiers.Select(x => (ChordModifierType)x.Type).ToArray(); chordStrum = ChordStrum.Normal; if (ct.Any(x => x == ChordModifierType.ChordStrumHigh)) { chordStrum |= ChordStrum.High; } if (ct.Any(x => x == ChordModifierType.ChordStrumMed)) { chordStrum |= ChordStrum.Mid; } if (ct.Any(x => x == ChordModifierType.ChordStrumLow)) { chordStrum |= ChordStrum.Low; } isSlide = ct.Any(x => x == ChordModifierType.SlideReverse || x == ChordModifierType.Slide); isSlideReverse = ct.Any(x => x == ChordModifierType.SlideReverse); isHammeron = ct.Any(x => x == ChordModifierType.Hammeron); }
public GuitarChordRootNoteConfig GetChordRootNoteConfigFromScreen() { var ret = new GuitarChordRootNoteConfig(); comboBoxNoteEditorChordName.SelectedItem.IfNotNull(x => ret.ChordNameMeta = x as ChordNameMeta); ret.UserChordName = comboBoxNoteEditorChordName.Text; ret.UseUserChordName = ret.UserChordName.IsNotEmpty(); var check = ChordScaleBoxes.FirstOrDefault(x=> x.Checked); if(check != null) { ret.RootNoteData1 = ChordScaleBoxData1.ElementAt(ChordScaleBoxes.IndexOf(check)).ToInt(); } ret.HideNoteName = checkChordNameHide.Checked; return ret; }