Esempio n. 1
0
        protected bool FinishImport()
        {
            foreach (var s in project.Samples)
            {
                s.Process();
            }

            foreach (var s in project.Songs)
            {
                foreach (var c in s.Channels)
                {
                    c.ColorizePatterns();

                    for (int p = 0; p < s.Length; p++)
                    {
                        var pattern = c.PatternInstances[p];
                        if (pattern != null && patternLengths.TryGetValue(pattern, out var instLength))
                        {
                            if (instLength < s.GetPatternLength(p))
                            {
                                s.SetPatternCustomSettings(p, instLength, s.BeatLength);
                            }
                        }
                    }
                }

                // FamiTracker always assumes 4 rows per beat for BPM calculation, but let's assume
                // the artists properly set first row highlight to that.
                if (barLength == -1)
                {
                    s.SetSensibleBeatLength();
                }
                else
                {
                    s.SetBeatLength(barLength);
                }

                ApplyHaltEffect(s, patternFxData);

                s.DeleteNotesPastMaxInstanceLength();
                s.UpdatePatternStartNotes();

                CreateArpeggios(s, patternFxData);
                CreateSlideNotes(s, patternFxData);

                s.DeleteEmptyPatterns();
            }

            project.ConvertToCompoundNotes();
            project.InvalidateCumulativePatternCache();
            project.SortEverything(false);
            project.Validate();

            PrintAdditionalWarnings();

            return(true);
        }