Example #1
0
        public void AssignForwardsSearchPasses(AudioFileOptions forwardsPass1, AudioFileOptions forwardsPass2, AudioFileOptions forwardsFinalPass)
        {
            _ForwardsPass1     = forwardsPass1;
            _ForwardsPass2     = forwardsPass2;
            _ForwardsFinalPass = forwardsFinalPass;

            _ForwardsFinalPassCount = forwardsFinalPass.GetAudioFileOptions.Count;
        }
Example #2
0
        public void AssignBackwardsSearchPasses(AudioFileOptions backwardsPass1, AudioFileOptions backwardsPass2, AudioFileOptions backwardsFinalPass)
        {
            _BackwardsPass1     = backwardsPass1;
            _BackwardsPass2     = backwardsPass2;
            _BackwardsFinalPass = backwardsFinalPass;

            _BackwardsFinalPassCount = backwardsFinalPass.GetAudioFileOptions.Count;
        }
Example #3
0
        public void BuildManualOptionsList()
        {
            _ManualOptions = new AudioFileOptions();

            if (_ForwardsFinalPass != null)  //Forwards Passes Assigned
            {
                foreach (AudioFileOption option in _ForwardsPass2.GetAudioFileOptions)
                {
                    if (!_ManualOptions.GetAudioFileOptions.Any(uniqueOption => uniqueOption.LibraryFile.FullPath == option.LibraryFile.FullPath))
                    {
                        _ManualOptions.GetAudioFileOptions.Add(option);  //Uniquely add Forwards Pass 2 options
                    }
                }
            }

            if (_BackwardsFinalPass != null)  //Backwards Passes Assigned
            {
                foreach (AudioFileOption option in _BackwardsPass2.GetAudioFileOptions)
                {
                    if (!_ManualOptions.GetAudioFileOptions.Any(uniqueOption => uniqueOption.LibraryFile.FullPath == option.LibraryFile.FullPath))
                    {
                        _ManualOptions.GetAudioFileOptions.Add(option);  //Uniquely add Backwards Pass 2 options
                    }
                }
            }

            if (_ManualOptions.GetAudioFileOptions.Count < Globals.ManualOptionsListSize)
            {
                if (_ForwardsFinalPass != null)  //Forwards Passes Assigned
                {
                    foreach (AudioFileOption option in _ForwardsPass1.GetAudioFileOptions)
                    {
                        if (!_ManualOptions.GetAudioFileOptions.Any(uniqueOption => uniqueOption.LibraryFile.FullPath == option.LibraryFile.FullPath))
                        {
                            _ManualOptions.GetAudioFileOptions.Add(option);  //If manual options list is still < Globals.ManualOptionsListSize, then uniquely add options from Forwards Pass1
                        }
                    }
                }

                if (_BackwardsFinalPass != null)  //Backwards Passes Assigned
                {
                    foreach (AudioFileOption option in _BackwardsPass1.GetAudioFileOptions)
                    {
                        if (!_ManualOptions.GetAudioFileOptions.Any(uniqueOption => uniqueOption.LibraryFile.FullPath == option.LibraryFile.FullPath))
                        {
                            _ManualOptions.GetAudioFileOptions.Add(option);  //If manual options list is still < Globals.ManualOptionsListSize, then uniquely add options from Backwards Pass1
                        }
                    }
                }
            }

            _ManualOptions.PrepareManualOptionsList(_BestOption);
        }
        private static AudioFileOptions ArtistAlbum_Pass2(AudioFileOptions pass1)
        {
            //Backwards Search
            AudioFileOptions pass2 = new AudioFileOptions();

            foreach (AudioFileOption option in pass1.GetAudioFileOptions)
            {
                option.ScoreArtistAlbumPoints();

                pass2.AddAudioFileOption(option);
            }

            pass2.KeepBetterOptions();

            return(pass2);
        }
        private static AudioFileOptions Track_Pass2(AudioFileOptions pass1)
        {
            //Forwards Search
            AudioFileOptions pass2 = new AudioFileOptions();

            foreach (AudioFileOption option in pass1.GetAudioFileOptions)
            {
                option.ScoreTrackNumberTrackPoints(SearchMethodType.Forwards);

                pass2.AddAudioFileOption(option);
            }

            pass2.KeepBetterOptions();

            return(pass2);
        }
Example #6
0
        public AudioFileSearchCollection(AODLoadSheetRow lsr)
        {
            _AODLoadSheetRow = lsr;

            _ForwardsFinalPass  = null;
            _BackwardsFinalPass = null;

            _ForwardsFinalPassCount  = 0;
            _BackwardsFinalPassCount = 0;
            _ChosenFinalPassCount    = 0;

            _ManualOptions = new AudioFileOptions();

            _IsUsingManualOptions = false;

            _IsCollectionFinished = false;
        }
        private static AudioFileOptions Track_Pass1(AudioLibrary audioLibrary, TokensCollection tokens)
        {
            //Backwards Search
            AudioFileOptions pass1 = new AudioFileOptions();

            foreach (AudioLibraryFile file in audioLibrary.GetAudioLibraryFiles)
            {
                AudioFileOption newOption = new AudioFileOption(file, tokens);

                newOption.ScoreTrackNumberTrackPoints(SearchMethodType.Backwards);

                pass1.AddAudioFileOption(newOption);
            }

            pass1.KeepBetterOptions();

            return(pass1);
        }
        private static AudioFileOptions ArtistAlbum_Pass1(AudioLibrary audioLibrary, TokensCollection tokens)
        {
            //Forwards Search
            AudioFileOptions pass1 = new AudioFileOptions();

            foreach (AudioLibraryFile file in audioLibrary.GetAudioLibraryFiles)
            {
                AudioFileOption newOption = new AudioFileOption(file, tokens);

                newOption.ScoreArtistAlbumPoints();

                pass1.AddAudioFileOption(newOption);
            }

            pass1.KeepBetterOptions();

            return(pass1);
        }
        private static AudioFileSearchCollection BackwardsSearch(AudioFileSearchCollection searchCollection, AudioLibrary audioLibrary, TokensCollection tokens)
        {
            //Backwards Search priority:  Track  --->  Artist/Album

            AudioFileOptions pass1 = Track_Pass1(audioLibrary, tokens);

            AudioFileOptions pass2 = ArtistAlbum_Pass2(pass1);

            pass2.FinishAllOptions();

            AudioFileOptions finalPass = pass2.Clone();

            finalPass.TieBreakAudioFileOptions(SearchMethodType.Backwards);

            searchCollection.AssignBackwardsSearchPasses(pass1, pass2, finalPass);

            return(searchCollection);
        }