diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 9e881c97e7..fa30db4cfd 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -99,6 +99,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv) color_handler (); UIConfiguration::instance().ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::color_handler)); + UIConfiguration::instance().ParameterChanged.connect(sigc::mem_fun(*this, &MidiStreamView::parameter_changed)); note_range_adjustment.set_page_size(_highest_note - _lowest_note); note_range_adjustment.set_value(_lowest_note); @@ -111,6 +112,16 @@ MidiStreamView::~MidiStreamView () { } +void +MidiStreamView::parameter_changed (string const & param) +{ + if (param == X_("max-note-height")) { + apply_note_range_to_regions (); + } else { + StreamView::parameter_changed (param); + } +} + RegionView* MidiStreamView::create_region_view (boost::shared_ptr r, bool /*wfd*/, bool recording) { @@ -402,7 +413,8 @@ MidiStreamView::apply_note_range(uint8_t lowest, uint8_t highest, bool to_region float uiscale = UIConfiguration::instance().get_ui_scale(); uiscale = expf (uiscale) / expf (1.f); - int const max_note_height = std::max (20, 20 * uiscale); + const int mnh = UIConfiguration::instance().get_max_note_height(); + int const max_note_height = std::max (mnh, mnh * uiscale); int const range = _highest_note - _lowest_note; int const pixels_per_note = floor (child_height () / range); diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h index 7aae4c2fe8..334c5981d9 100644 --- a/gtk2_ardour/midi_streamview.h +++ b/gtk2_ardour/midi_streamview.h @@ -116,6 +116,8 @@ public: ArdourCanvas::Container* midi_underlay () const { return _midi_underlay; } ArdourCanvas::Container* region_canvas () const { return _region_group; } + void parameter_changed (std::string const &); + protected: void setup_rec_box (); void update_rec_box (); diff --git a/gtk2_ardour/preference-metadata b/gtk2_ardour/preference-metadata index c1f9ea0d47..95d779c825 100644 --- a/gtk2_ardour/preference-metadata +++ b/gtk2_ardour/preference-metadata @@ -87,6 +87,8 @@ [link-region-and-track-selection] [lock-gui-after-seconds] lock +[max-note-height] + maximum note height theme appearance size visible range [max-inline-controls] plugins mixer-strip controls inline [max-plugin-chart] diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index ffe8088cd7..75b0a0c5b3 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -145,6 +145,7 @@ UI_CONFIG_VARIABLE (int, default_lower_midi_note, "default-lower-midi-note", 60) UI_CONFIG_VARIABLE (int, default_upper_midi_note, "default-upper-midi-note", 71) UI_CONFIG_VARIABLE (bool, ask_before_closing_last_window, "ask-before-closing-last-window", true) UI_CONFIG_VARIABLE (std::string, freesound_dir, "freesound-dir", "") +UI_CONFIG_VARIABLE (int, max_note_height, "max-note-height", 20) /* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */ UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)