How selections work in MuseScore.
In the past week I’ve been looking at how the selection system works in MuseScore.
There are a few ways of selecting something, you can click on an element, or Shift drag to select many elements. You can extend a selection by Shift + Clicking on an element. You can also add a single element to the existing selection by Ctrl + Click. These actions create different types of selections. For single elements, the type is Single Selection. If more elements are selected and the elements are continuos, the selection is a Range Selection. Otherwise, it’s a Multiple Selection.
I will be focusing on the Range selection, since most actions involve either Single or Range selections. Before adding new selection functionality, I want to fix issues with the highlighting.
When a user wants to accomplish somethng he performs actions on a selection. He needs to see which elements will the action be performed on. MuseScore colors the selected elements in the color of the part that they belong too. When dealing with a Range Selection, the range is additionally surrounded by a blue rectangle as seen in the picture below.
Tasks in the upcoming week
My goal is that at the end of the week a range selection of the above bar will highlight stems, beams, articulation, accidentals as well as other elements that are linked to the notes.
If time allows, I will start changing the selection code to include all elements in a given range. As of now, the selection shown below removes everything except the forte dynamic mark and the tempo system text.
Since the goal of this project is to implement a way to select only some elements in a selection range, I will remove the restriction of the delete to work on all elements in the selection.