@@ -38,6 +38,7 @@ struct MenuBarImpl : public Menubar {
3838
3939 Item* myFileMenu;
4040 Item* myVisualSyncMenu;
41+ Item* myNotesSelectMenu;
4142 Item* myViewMenu;
4243 Item* myBeatlineMenu;
4344 Item* myPreviewMenu;
@@ -159,8 +160,9 @@ struct MenuBarImpl : public Menubar {
159160 add (hSelectQuant, SELECT_QUANT_192, " 192nd" );
160161
161162 // Notes > Select menu.
162- Item* hSelection = newMenu ();
163+ Item* hSelection = myNotesSelectMenu = newMenu ();
163164 sub (hSelection, hSelectQuant, " Quantization" );
165+ add (hSelection, 0 /* dummy*/ , " Density" );
164166 sep (hSelection);
165167 add (hSelection, SELECT_ALL_STEPS, " Steps" );
166168 add (hSelection, SELECT_ALL_MINES, " Mines" );
@@ -499,6 +501,18 @@ struct MenuBarImpl : public Menubar {
499501 MENU->myViewMenu ->setChecked (TOGGLE_CHART_PREVIEW,
500502 gView ->hasChartPreview ());
501503 };
504+ myUpdateFunctions[SELECT_DENSITY] = [] {
505+ Item* density = newMenu ();
506+ int numCol = gStyle ->getNumCols ();
507+ if (numCol > 0 ) {
508+ for (int i = 0 ; i < numCol; ++i) {
509+ add (density, static_cast <Type>(SELECT_DENSITY_BEGIN + i),
510+ Str::val (i + 1 ).c_str ());
511+ }
512+ }
513+ MENU->myNotesSelectMenu ->replaceSubmenu (1 , density, " Density" ,
514+ (numCol == 0 ));
515+ };
502516 myUpdateFunctions[VIEW_MODE] = [] {
503517 MENU->myViewMenu ->setChecked (USE_ROW_BASED_VIEW,
504518 !gView ->isTimeBased ());
0 commit comments