GSoC : Week 6
Hello,
As mentioned in the last post, this week I worked on implementing the range annotation box, and also added an option to highlight the range annotation. I also looked around at Spanners, and got a feel of how they are being implemented. For the range annotation, I started with implementing a hard coded rectangle around some measures (different from selection, because this persists, whereas selection doesn't). I then extended the implementation to support multiple range annotations, which key off the selection, thereby putting them in the right place. The implementation can be found in this PR : https://github.com/musescore/MuseScore/pull/2714
You can add a highlight either to a single note, or to a range, or both. To add highlights, you can either select a note or a region, and then go to Add->Annotation->Range Annotation.
Currently the RangeAnnotation class derives from Text, but we've been planning to make it inherit from the Spanner class instead, because we would want to have multiple "segments" of the range annotation in case it spans across multiple systems, similar to spanners. The functionality needed (edit individual segments, etc.) might not be that high end, although we would probably want to be able to click the individual segments and get the whole annotation selected, thereby facilitating delete, color change, start/end change and so on. The "unamanaged spanners" might be relevant here (as used by lyrics, underscores, hyphens which do not need editing) , however it perhaps wouldn't persist for MuseScore 3.0. It is also possible to avoid this need of having multiple segments by having a separate "annotation mode", the possibility of which shall be explored this week. Right now I am assuming we wouldn't have a separate mode, and range annotations would depict some similar behavior as spanners, for eg. containing segments, This shall also change the way layout and draw for the range annotation work. I shall work on this in the coming week. If you have any inputs, feel free to share :)