From 38b499a8f08f488889967d536dd1e341f9b3da3d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Jul 2018 15:39:28 -0400 Subject: [PATCH] permit editing velocity bars option --- gtk2_ardour/editor.cc | 4 ++++ gtk2_ardour/editor_actions.cc | 2 -- gtk2_ardour/rc_option_editor.cc | 22 ++++++++++++++++++++-- gtk2_ardour/ui_config_vars.h | 3 ++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4860cdacec..9acda77b4c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -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()); } } diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index b1ed4365b1..a225a2978a 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -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()); } } diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 31e8103f82..aee28a3ee7 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -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 ( "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"))); diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index da568e38c8..3e2c6715ea 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -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) -- 2.30.2