예제 #1
0
        public async Task DrawConnection(IRootElementRenderer rootRenderer, NoteConnection connection, Beat from,
                                         Beat to, int stringIndex, Core.Style.VerticalDirection tiePosition)
        {
            var bounds = await
                         NoteConnectionRenderer.DrawConnection(rootRenderer, connection, from, to, stringIndex, tiePosition);

            var instructionPosition = (bounds.Left + bounds.Right) / 2;

            switch (connection)
            {
            case NoteConnection.Slide:
                this.AddConnectionInstruction(stringIndex, instructionPosition, "sl.");
                break;

            case NoteConnection.SlideInFromHigher:
            case NoteConnection.SlideInFromLower:
            case NoteConnection.SlideOutToHigher:
            case NoteConnection.SlideOutToLower:
                this.AddConnectionInstruction(stringIndex, instructionPosition, "gl.");
                break;

            case NoteConnection.Hammer:
                this.AddConnectionInstruction(stringIndex, instructionPosition, "h.");
                break;

            case NoteConnection.Pull:
                this.AddConnectionInstruction(stringIndex, instructionPosition, "p.");
                break;
            }
        }
예제 #2
0
        public static async Task <Rect> DrawConnection(IRootElementRenderer rootRenderer, NoteConnection connection, Beat from, Beat to, IEnumerable <int> stringIndices, Core.Style.VerticalDirection tiePosition)
        {
            switch (connection)
            {
            case NoteConnection.Slide:
            case NoteConnection.Hammer:
            case NoteConnection.Pull:
                return(await NoteConnectionRenderer.DrawTie(rootRenderer, @from, to, stringIndices, tiePosition));

            case NoteConnection.SlideInFromHigher:
            case NoteConnection.SlideInFromLower:
                return(await NoteConnectionRenderer.DrawGliss(rootRenderer, to, stringIndices, (GlissDirection)connection));

            case NoteConnection.SlideOutToHigher:
            case NoteConnection.SlideOutToLower:
                return(await NoteConnectionRenderer.DrawGliss(rootRenderer, from, stringIndices, (GlissDirection)connection));
            }

            return(default(Rect));
        }
예제 #3
0
 public static Task <Rect> DrawConnection(IRootElementRenderer rootRenderer, NoteConnection connection, Beat from,
                                          Beat to, int stringIndex, Core.Style.VerticalDirection tiePosition)
 {
     return(NoteConnectionRenderer.DrawConnection(rootRenderer, connection, from, to, new[] { stringIndex }, tiePosition));
 }