AlphaTab.Rendering.Utils.AccidentalHelper.RegisterNoteLine C# (CSharp) Method

RegisterNoteLine() private method

private RegisterNoteLine ( Note n ) : int
n AlphaTab.Model.Note
return int
        private int RegisterNoteLine(Note n)
        {
            var value = n.Beat.Voice.Bar.Staff.Track.IsPercussion ? PercussionMapper.MapNoteForDisplay(n) : n.RealValue;
            var ks = n.Beat.Voice.Bar.MasterBar.KeySignature;
            var clef = n.Beat.Voice.Bar.Clef;

            var index = value % 12;
            var octave = (value / 12);

            // Initial Position
            var steps = OctaveSteps[(int)clef];

            // Move to Octave
            steps -= (octave * StepsPerOctave);

            // get the step list for the current keySignature
            var stepList = ModelUtils.KeySignatureIsSharp(ks) || ModelUtils.KeySignatureIsNatural(ks)
                ? SharpNoteSteps
                : FlatNoteSteps;

            //Add offset for note itself
            int offset = 0;
            switch (n.AccidentalMode)
            {
                // TODO: provide line according to accidentalMode
                case NoteAccidentalMode.Default:
                case NoteAccidentalMode.SwapAccidentals:
                case NoteAccidentalMode.ForceNatural:
                case NoteAccidentalMode.ForceFlat:
                case NoteAccidentalMode.ForceSharp:
                default:
                    // normal behavior: simply use the position where
                    // the keysignature defines the position
                    offset = stepList[index];
                    break;
            }
            steps -= stepList[index];

            _appliedScoreLines[GetNoteId(n)] = steps;

            return steps;
        }