private void HandleSelectNext(SelectNextEnum selectNextEnum = SelectNextEnum.ForceKeepSelection, int lastTick = Int32.MinValue) { if (selectNextEnum == SelectNextEnum.ForceSelectNext || (selectNextEnum == SelectNextEnum.UseConfiguration && checkBoxAutoSelectNext.Checked)) { if (lastTick.IsNull()) lastTick = GetChordTicksFromScreen().Up; if (lastTick.IsNull() == false) { SelectNextChord(lastTick); } } if (checkScrollToSelection.Checked && selectNextEnum != SelectNextEnum.ForceKeepSelection) { ScrollToSelection(); } if (checkBoxClearAfterNote.Checked) { ClearHoldBoxes(); } CheckQuickEditFocus(); }
public bool ReloadTracks(SelectNextEnum selectNextEnum = SelectNextEnum.ForceKeepSelection) { return ReloadTrack(selectNextEnum, true); }
public bool ReloadTrack(SelectNextEnum selectNextEnum = SelectNextEnum.ForceKeepSelection, bool reloadG5 = false) { bool ret = true; if (reloading) { Thread.Sleep(5); } if (!reloading) { reloading = true; bool selectNext = false; if (selectNextEnum == SelectNextEnum.UseConfiguration) { selectNext = checkBoxAutoSelectNext.Checked; } else if (selectNextEnum == SelectNextEnum.ForceSelectNext) { selectNext = true; } try { var ticks = TickPair.NullValue; if (EditorPro.SelectedChords.Any()) { ticks = EditorPro.SelectedChords.GetTickPair(); } if (ProGuitarTrack != null) { EditorPro.ReloadTrack(); EditorG5.ReloadTrack(); RefreshModifierListBoxes(); Refresh108EventList(); } if (!ticks.HasNull) { if (selectNext) { EditorPro.ClearSelection(); var nextChord = EditorPro.Messages.Chords.FirstOrDefault(x => x.DownTick >= ticks.Up); if (selectNextEnum == SelectNextEnum.UseConfiguration && checkKeepSelection.Checked) { var currentItem = GetChordFromScreen(); SetSelectedChord(nextChord, true); SetChordToScreen(currentItem, false); } else { SetSelectedChord(nextChord, true); } } else { EditorPro.ClearSelection(); EditorPro.Messages.Chords.GetBetweenTick(ticks).ToList().ForEach(x => x.Selected = true); } } } catch { ret = false; } reloading = false; } RefreshTracks(); CheckQuickEditFocus(); return ret; }
public bool ReloadTrackPro(SelectNextEnum selectNextEnum = SelectNextEnum.ForceKeepSelection) { return ReloadTrack(selectNextEnum, false); }
public IEnumerable<GuitarChord> PlaceNote(SelectNextEnum selectNextEnum) { var ret = new List<GuitarChord>(); if (placingNote) { return ret; } placingNote = true; try { EditorPro.BackupSequence(); foreach (var sc in EditorPro.SelectedChords.ToList()) { var gc = GetChordFromScreen(); if (gc != null) { var chord = gc.CloneAtTime(EditorPro.Messages, sc.TickPair); if (chord != null) { ret.Add(chord); } } else { sc.DeleteAll(); } } HandleSelectNext(selectNextEnum); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } placingNote = false; return ret; }