Beispiel #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;
            }
        }
 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));
 }