bad matching in "Notehead" in note properties

• Apr 4, 2010 - 10:07
Type
Functional
Severity
S4 - Minor
Status
closed
Project

In r2935 (first reported by Forumus )

Select a note
Right click on it -> Note properties
Select Slash notehead type

Expected result : The notehead should change to slash.
Actual result : the notehead is a triangle (s1mi notehead)

Discussion: I don't understand why but apparently the NoteHeadType enum is not in the "natural" order. If you check the notehead palette, you will see that s1mi appears before slash but the enum is :
enum NoteHeadGroup {
HEAD_NORMAL, HEAD_CROSS, HEAD_DIAMOND, HEAD_TRIANGLE,
HEAD_SLASH, HEAD_XCIRCLE, HEAD_DO, HEAD_RE, HEAD_MI, HEAD_FA, HEAD_LA, HEAD_TI,
HEAD_GROUPS
};

I though the order of enum was respected?

A quick and dirty fix could be to change the order in chordproperties.ui but I would like to understand the enum stuff.


Comments

Status (old) active fixed

The note head group is a fixed number. It cannot be changed because it is written into the mscore *.mscx file. The enum NoteHeadGroup has to follow the table noteHeads in note.cpp and was wrong (only HEAD_GROUPS was used so far anyway from this enum). To make the note head group list in chordproperties independend of the enum order i added the enum value to every entry in the noteHeadGroup combobox.
Should be fixed now in r2938.
One task for 1.0 release would be to replace all magic numbers in the *.mscx file with descriptive names.