permit editing velocity bars option
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jul 2018 19:39:28 +0000 (15:39 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 3 Jul 2018 19:39:28 +0000 (15:39 -0400)
gtk2_ardour/editor.cc
gtk2_ardour/editor_actions.cc
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/ui_config_vars.h

index 4860cdacec62d67a4bee19cdc10580d6898fe281..9acda77b4c40b8ad388f748b002501b63d07d1e3 100644 (file)
@@ -79,6 +79,7 @@
 #include "ardour/vca.h"
 
 #include "canvas/debug.h"
+#include "canvas/note.h"
 #include "canvas/text.h"
 
 #include "widgets/ardour_spacer.h"
@@ -6165,6 +6166,9 @@ Editor::ui_parameter_changed (string parameter)
                if (_verbose_cursor) {
                        playhead_cursor->set_sensitive (UIConfiguration::instance().get_draggable_playhead());
                }
+       } else if (parameter == "use-note-bars-for-velocity") {
+               ArdourCanvas::Note::set_show_velocity_bars (UIConfiguration::instance().get_use_note_bars_for_velocity());
+               _track_canvas->request_redraw (_track_canvas->visible_area());
        }
 }
 
index b1ed4365b1e67315027e72408744008ad3fbaec1..a225a2978a6f005971a4d00347c29d7376ccd1dc 100644 (file)
@@ -1489,8 +1489,6 @@ Editor::parameter_changed (std::string p)
                                tact->set_active (s);
                        }
                }
-       } else if (p == "velocity-display") {
-               _track_canvas->request_redraw (_track_canvas->visible_area());
        }
 }
 
index 31e8103f822fc9fbb1f645305758d3f13ab2c695..aee28a3ee7b4c89ecafa4ec6149253697b075fff 100644 (file)
@@ -2483,7 +2483,7 @@ RCOptionEditor::RCOptionEditor ()
        add_option (_("Editor"), rsas);
 
        add_option (_("Editor/Snap"), new OptionEditorHeading (_("General Snap options:")));
-       
+
        add_option (_("Editor/Snap"),
                    new SpinOption<uint32_t> (
                            "snap-threshold",
@@ -2501,7 +2501,7 @@ RCOptionEditor::RCOptionEditor ()
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_snapped_cursor),
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_snapped_cursor)
                     ));
-       
+
        add_option (_("Editor/Snap"),
             new BoolOption (
                     "rubberbanding-snaps-to-grid",
@@ -2903,6 +2903,24 @@ RCOptionEditor::RCOptionEditor ()
 
        add_option (_("MIDI"), audition_synth);
 
+       add_option (_("MIDI"), new OptionEditorHeading (_("Velocity Display")));
+
+       add_option (_("MIDI"),
+                   new BoolOption (
+                           "use-note-bars-for-velocity",
+                           _("Show velocity horizontally inside notes"),
+                           sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_note_bars_for_velocity),
+                           sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_note_bars_for_velocity)
+                           ));
+
+       add_option (_("MIDI"),
+                   new BoolOption (
+                           "use-note-color-for-velocity",
+                           _("Use colors to show note velocity"),
+                           sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_use_note_color_for_velocity),
+                           sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_use_note_color_for_velocity)
+                           ));
+
        /* Click */
 
        add_option (_("Metronome"), new OptionEditorHeading (_("Metronome")));
index da568e38c836a7442eec67943bcb6875853f82d6..3e2c6715ea9a35ba58b3fb0d907f4ba6e008eb8b 100644 (file)
@@ -98,7 +98,8 @@ UI_CONFIG_VARIABLE (bool, prefer_inline_over_gui, "prefer-inline-over-gui", true
 UI_CONFIG_VARIABLE (uint32_t, action_table_columns, "action-table-columns", 0)
 UI_CONFIG_VARIABLE (bool, use_wm_visibility, "use-wm-visibility", true)
 UI_CONFIG_VARIABLE (std::string, stripable_color_palette, "stripable-color-palette", "#AA3939:#FFAAAA:#D46A6A:#801515:#550000:#AA8E39:#FFEAAA:#D4BA6A:#806515:#554000:#343477:#8080B3:#565695:#1A1A59:#09093B:#2D882D:#88CC88:#55AA55:#116611:#004400")  /* Gtk::ColorSelection::palette_to_string */
-UI_CONFIG_VARIABLE (ARDOUR::VelocityDisplayOption, velocity_display, "velocity-display", ARDOUR::NoteBars)
+UI_CONFIG_VARIABLE (bool, use_note_bars_for_velocity, "use-note-bars-for-velocity", true)
+UI_CONFIG_VARIABLE (bool, use_note_color_for_velocity, "use-note-color-for-velocity", true)
 UI_CONFIG_VARIABLE (bool, show_snapped_cursor, "show-snapped-cursor", true)
 UI_CONFIG_VARIABLE (uint32_t, snap_threshold, "snap-threshold", 25)
 UI_CONFIG_VARIABLE (bool, snap_to_marks, "snap-to-marks", true)