Ejemplo n.º 1
0
        public SpecialNotePointer AddSpecialNote(ScoreBar scoreBar, ScoreBarHitTestInfo info, bool isFromPrevBar, NoteType type)
        {
            if (!info.IsInNextBar)
            {
                var row = info.Row;
                if (isFromPrevBar && row < 0)
                {
                    row = 0;
                }
                return(AddSpecialNote(scoreBar, row, type));
            }
            if (isFromPrevBar)
            {
                return(null);
            }
            var nextBar = ScoreBars.FirstOrDefault(b => b.Bar.Index > scoreBar.Bar.Index);

            if (nextBar == null)
            {
                return(null);
            }
            var point = scoreBar.TranslatePoint(info.HitPoint, nextBar);

            return(AddSpecialNote(nextBar, nextBar.HitTest(point), true, type));
        }
Ejemplo n.º 2
0
        private ScoreNote AddScoreNote(ScoreBar scoreBar, ScoreBarHitTestInfo info, bool isFromPrevBar, Note dataTemplate)
        {
            if (info.IsInNextBar)
            {
                if (isFromPrevBar)
                {
                    return(null);
                }
                var nextBar = ScoreBars.FirstOrDefault(b => b.Bar.Index > scoreBar.Bar.Index);
                if (nextBar == null)
                {
                    return(null);
                }
                var point = scoreBar.TranslatePoint(info.HitPoint, nextBar);
                return(AddScoreNote(nextBar, nextBar.HitTest(point), true, dataTemplate));
            }
            var row = info.Row;

            if (isFromPrevBar && row < 0)
            {
                row = 0;
            }
            if (!info.IsValid || row < 0 || info.Column < 0)
            {
                return(null);
            }
            return(AddScoreNote(scoreBar, row, info.Column, dataTemplate));
        }
Ejemplo n.º 3
0
        public SpecialNotePointer AddSpecialNote(ScoreBar scoreBar, ScoreBarHitTestInfo info, NoteType type)
        {
            if (!info.IsInNextBar)
            {
                return(AddSpecialNote(scoreBar, info.Row, type));
            }
            var nextBar = ScoreBars.FirstOrDefault(b => b.Bar.Index > scoreBar.Bar.Index);

            if (nextBar == null)
            {
                return(null);
            }
            var point = scoreBar.TranslatePoint(info.HitPoint, nextBar);

            return(AddSpecialNote(nextBar, nextBar.HitTest(point), type));
        }