Esempio n. 1
0
        private List <MatchGroup> DetermineMatchGroups(MatchFilterMode matchFilterMode)
        {
            List <Match> matches = new List <Match>(multiTrackViewer.Matches);

            return(MatchProcessor.DetermineMatchGroups(matchFilterMode, trackList, matches,
                                                       (bool)windowedModeCheckBox.IsChecked, MatchFilterWindowSize));
        }
Esempio n. 2
0
        private void CommandBinding_ViewGroupMatchingTracks(object sender, ExecutedRoutedEventArgs e)
        {
            List <MatchGroup> matchGroups = MatchProcessor.DetermineMatchGroups(
                MatchFilterMode.First, trackList, new List <Match>(multiTrackViewer1.Matches), false, TimeSpan.Zero);
            List <AudioTrack> currentOrder = new List <AudioTrack>(trackList);
            List <AudioTrack> targetOrder  = new List <AudioTrack>();

            foreach (MatchGroup matchGroup in matchGroups)
            {
                /* Extract all tracks belonging to a matching group in the order they're contained
                 * in the current tracklist and add them to the target order list. This groups
                 * tracks by their mathing groups while preserving their relative order inside their
                 * group. E.g., if the tracks have been sorted by offset (start time), their intra group
                 * ordering by offset will be kept after being grouped together. */
                targetOrder.AddRange(currentOrder.FindAll(t => matchGroup.TrackList.Contains(t)));
            }

            OrderTracks(targetOrder);
        }