diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 419d885c51..0d744874e9 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -538,6 +538,14 @@ AudioRegionView::setup_fade_handle_positions() void AudioRegionView::set_height (gdouble height) { + uint32_t gap = UIConfiguration::instance().get_vertical_region_gap (); + float ui_scale = UIConfiguration::instance().get_ui_scale (); + if (gap > 0 && ui_scale > 0) { + gap = ceil (gap * ui_scale); + } + + height = std::max (3.0, height - gap); + if (height == _height) { return; } diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 72af2f846c..d67edd7aea 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -51,6 +51,7 @@ #include "public_editor.h" #include "audio_region_view.h" #include "audio_streamview.h" +#include "ui_config.h" #include "utils.h" #include "pbd/i18n.h" @@ -67,6 +68,7 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session* sess, ArdourCan : SessionHandlePtr (sess) , RouteTimeAxisView(ed, sess, canvas) { + UIConfiguration::instance().ParameterChanged.connect (sigc::mem_fun (*this, &AudioTimeAxisView::parameter_changed)); } void @@ -278,6 +280,14 @@ AudioTimeAxisView::route_active_changed () update_control_names (); } +void +AudioTimeAxisView::parameter_changed (string const & p) +{ + if (p == "vertical-region-gap") { + _view->update_contents_height (); + } +} + /** * Set up the names of the controls so that they are coloured diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h index 52c1a3d151..58139eb3b0 100644 --- a/gtk2_ardour/audio_time_axis.h +++ b/gtk2_ardour/audio_time_axis.h @@ -84,6 +84,7 @@ private: friend class AudioRegionView; void route_active_changed (); + void parameter_changed (std::string const &); Gtk::Menu* build_mode_menu(); void build_automation_action_menu (bool); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 6552b65077..c906e96c66 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -3666,6 +3666,19 @@ RCOptionEditor::RCOptionEditor () sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_color_regions_using_track_color) )); +#ifndef MIXBUS // hide this setting in Mixbus. Always on, 4px + ComboOption* gap = new ComboOption ( + "vertical-region-gap", + _("Add a visual gap below Audio Regions"), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_vertical_region_gap), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_vertical_region_gap) + ); + gap->add (0, _("None")); + gap->add (2, _("Small")); + gap->add (4, _("Large")); + add_option (_("Appearance/Editor"), gap); +#endif + add_option (_("Appearance/Editor"), new OptionEditorHeading (_("Waveforms"))); if (!Profile->get_mixbus()) { diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index ede770b8be..44033cf1d8 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -30,6 +30,11 @@ UI_CONFIG_VARIABLE (bool, all_floating_windows_are_dialogs, "all-floating-window UI_CONFIG_VARIABLE (bool, floating_monitor_section, "floating-monitor-section", false) UI_CONFIG_VARIABLE (bool, transients_follow_front, "transients-follow-front", false) UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false) +#ifdef MIXBUS +UI_CONFIG_VARIABLE (uint32_t, vertical_region_gap, "vertical-region-gap", 4) +#else +UI_CONFIG_VARIABLE (uint32_t, vertical_region_gap, "vertical-region-gap", 0) +#endif UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true) UI_CONFIG_VARIABLE (uint32_t, lock_gui_after_seconds, "lock-gui-after-seconds", 0) UI_CONFIG_VARIABLE (bool, draggable_playhead, "draggable-playhead", true)