13
0

Add option to leave vertical gap below audio regions

This is a backport from Mixbus, to leave are 4 "open" pixels
at the bottom of the track so one can see the grid-lines between tracks.

This is useful with low region-transparency. grid-lines behind
opaque regions are not visible.
This commit is contained in:
Robin Gareus 2019-04-10 21:03:08 +02:00
parent d465a2b012
commit f5bc64d00e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
5 changed files with 37 additions and 0 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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);

View File

@ -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<uint32_t>* gap = new ComboOption<uint32_t> (
"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()) {

View File

@ -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)