Skip to content

Commit

Permalink
feat: selective match flipping
Browse files Browse the repository at this point in the history
The "Flip tracks" button in the matching window flipped the tracks of all matches. With this change, it only flips the selected matches when matches are selected, or all matches if none are selected.
  • Loading branch information
protyposis committed Jan 30, 2024
1 parent 54c8b94 commit 3017816
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions AudioAlign/MatchingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,10 +1108,19 @@ out CrossCorrelation.Result ccr

private void FlipTracksButton_Click(object sender, RoutedEventArgs e)
{
foreach (Match match in multiTrackViewer.Matches)
List<Match> matchesToFlip = new();

if (matchGrid.SelectedItems.Count > 0)
{
matchesToFlip.AddRange(matchGrid.SelectedItems.Cast<Match>());
}
else
{
match.SwapTracks();
matchesToFlip.AddRange(multiTrackViewer.Matches);
}

matchesToFlip.ForEach(m => m.SwapTracks());

matchGrid.Items.Refresh();
}
}
Expand Down

0 comments on commit 3017816

Please sign in to comment.