Similar in range and clone
This week I have focused on adding a new feature, the similar in range, as well as fixing the tuplet issue caused by the clone range approach.
Similar in range
I have added a new option in the element menu which appears on right click of an element. The option allows to list select all elements of the same type in the current range selection. This PR has already been merged.
You can try it out by creating a range selection, right clicking an element (for example an articulation or a notehead) and clicking on select similar in range. This allows us to easily delete all elements of a certain type from a selection. The inspector is also affected by this new functionality. We can easily change all elements of the same type from the inspector widget.
The PR can be found here.
This is another change to the select similar functionality. If we right click an element and click More, we will see the select menu. From here we can fine-tune the options of selecting.
This works really well, but the subtype has not been implemented. I have added 2 new methods to the
Element class ->
subtypeText that are overloaded in individual classes.
This allowed me to filter out elements not only by their type, but also the subtype.
Later on the
"elementName"subType functions can be removed completely as a part of a refactor.
I wanted to keep this PR simple, so in most cases,
subtype calls the
My recent fix to the 2-note tremolo copy-paste has <a href=”http://musescore.org/en/node/27831”broken</a> tuplet copy-paste. It turned out that the copy constructor of a DurationElement did not create a new tuplet.
I have fixed this in the following PR.
The fix works by changing the copy constructor to create a new tuplet, and later on by assigning the other chords the new tuplet.
The approach is similar to the one found in
I have also added delete code for the segment list, because they were never freed. I will be discussing tommorow this approach, so it might change in the future.
There is a recent issue that notices the fact that slurs are not properly pasted on the second paste of a repeat action (shortcut R). Looking at the code I have found that the problem setting the spanner ids.
I am not completely sure how it should work, but the problem lies in the fact after the first paste, 2 spanners have the same id: the old spanner that had the id set when writing it to the clipboard, and the new spanner that has just been assigned the id from the xml. Due to this fact, the startElement and endElement are incorrectly set. I have added a qAssert call in the findSpanner(int id) function to check for spanners with the same id, and it indeed failed that assert.
I will talk tommorow about this issue as well. My solution would be to add spanners with new ids, and have a map of old_id->new_id that would be used in the
Crash on repeat when score needs to be extended
This issue talks about a crash when repeating 2 measures in a score with an odd number of measures. The last repeat causes an exception. This was caused by calling nextMM1 on a segment with a null value. I have made a short fix here, and verified that the problem no longer exists.
Tasks in the upcoming week
I will add the select similar in range to the select window. On Monday morning I will be discussing my approach of clone segments, so depending on the outcome, I will either work on a different approach, or refine the existing one. I will then look into voice filtering.