コード例 #1
0
        public void QuickSearchForSuggestedAudioFile(AudioLibrary audioLibrary, AODLoadSheetRow previousLSR, AODLoadSheet parentLoadsheet)
        {
            //quick search 1st attempt (lookup if any prior row had identical qualities (aka hash) and shortcut to past results)
            foreach (AODLoadSheetRow pastLSR in parentLoadsheet.GetAODLoadSheetRows)
            {
                if (pastLSR.LoadSheetRowNumber >= _LoadSheetRowNumber)
                {
                    if (_QuickSearchNotePastLSR == "None")
                    {
                        _QuickSearchNotePastLSR = "No Hash Matches";
                    }

                    break;
                }

                if (_LoadSheetRowHash == pastLSR.LoadSheetRowHash) //identical past loadsheet row (exact replica repeat row)
                {
                    if (pastLSR.IsSuggestedAudioFileAssigned)
                    {
                        _IsQuickSearchActive = true;

                        _QuickSearchNotePastLSR = "Replica Match";

                        _Tokens = pastLSR.Tokens;

                        _SearchCollection = pastLSR.SearchCollection;

                        AssignSuggestedAudioFile();

                        return;
                    }
                    else
                    {
                        _QuickSearchNotePastLSR = "Past Suggested File Not Assigned";
                    }
                }
            }

            //quick search 2nd attempt (scan previous row's parent directory)
            if (!previousLSR.IsSuggestedAudioFileAssigned)
            {
                AODLoadSheetRow mostRecentAssignedRow = parentLoadsheet.GetMostRecentAssignedRow(this);

                if (mostRecentAssignedRow != null)
                {
                    previousLSR = mostRecentAssignedRow;
                }
            }

            if (previousLSR.IsSuggestedAudioFileAssigned)
            {
                string previousLSRSubDirPath = previousLSR.SuggestedAudioFile.SubDirectoriesPath;

                AudioLibrary quickSearchLibrary = audioLibrary.GetQuickAudioLibrarySubset(previousLSRSubDirPath);

                _SearchCollection = AudioFileSearch.GetBestSearchCollection(quickSearchLibrary, this);

                if (_SearchCollection.IsOptionQuickSearchElligible(_SearchCollection.BestOption, SearchMethodType.Both, Globals.HighAccuracyThreshold))  //high scoring and not too many options in final pool
                {
                    _IsQuickSearchActive = true;

                    _QuickSearchNotePreviousLSR = "Met HighAccuracyThreshold";

                    AssignSuggestedAudioFile();

                    return;
                }
                else
                {
                    if (_SearchCollection.BestOption.AccuracyScore < Globals.HighAccuracyThreshold)
                    {
                        _QuickSearchNotePreviousLSR = "Missed HighAccuracyThreshold";
                    }
                    else if (_SearchCollection.ChosenFinalPassCount > 1)
                    {
                        _QuickSearchNotePreviousLSR = "Missed TooManyFinalOptionsThreshold";
                    }

                    _SearchCollection = null;

                    return;
                }
            }
            else
            {
                _QuickSearchNotePreviousLSR = "Previous Suggested File Not Assigned";
            }
        }
コード例 #2
0
        private void FullSearchForSuggestedAudioFile(AudioLibrary audioLibrary)
        {
            _SearchCollection = AudioFileSearch.GetBestSearchCollection(audioLibrary, this);

            AssignSuggestedAudioFile();
        }