public void selectGroup(AMTakeData take, int group_id, bool isShiftDown, bool isControlDown, bool softSelect = false) { if (isShiftDown || isControlDown) { contextSelectGroup(take, group_id, isControlDown); // select range if ((selectedTrack != -1 || selectedGroup != 0) && isShiftDown) { List <int> range = take.getTrackIDsForRange((selectedTrack != -1 ? selectedTrack : selectedGroup), group_id); foreach (int track_id in range) { if (!contextSelectionTracks.Contains(track_id)) { contextSelectionTracks.Add(track_id); } } } } else if (!softSelect) { if (contextSelectionTracks.Count == 1) { contextSelectionTracks = new List <int>(); } } selectedGroup = group_id; }
// select a track by index public void selectTrack(AMTakeData take, int index, bool isShiftDown, bool isControlDown) { bool isInContextSelection = contextSelectionTracks.Contains(index); if (!isShiftDown && !isControlDown) { if (selectedTrack != index) { selectedTrack = index; if (!isInContextSelection) { // clear context selection contextSelection = new List <int>(); contextSelectionTracks = new List <int>(); } } if (index > -1) { selectGroup(take, take.getTrackGroup(index), false, false, true); } } if (!isInContextSelection) { contextSelectionTracks.Add(index); } else if (isControlDown && selectedTrack != index && !isShiftDown) { contextSelectionTracks.Remove(index); } // select range if ((selectedTrack != -1 || selectedGroup != 0) && isShiftDown) { List <int> range = take.getTrackIDsForRange((selectedTrack != -1 ? selectedTrack : selectedGroup), index); foreach (int track_id in range) { if (!contextSelectionTracks.Contains(track_id)) { contextSelectionTracks.Add(track_id); } } } }