13
0

Add preference to keep spilled automation-lanes visible

This commit is contained in:
Robin Gareus 2021-03-02 19:00:23 +01:00
parent 3722b8a94f
commit e81794d878
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
7 changed files with 31 additions and 7 deletions

View File

@ -210,6 +210,9 @@ AutomationRegionView::add_automation_event (GdkEvent *, samplepos_t when, double
if (ac->automation_state () == ARDOUR::Off) {
ac->set_automation_state (ARDOUR::Play);
}
if (UIConfiguration::instance().get_automation_edit_cancels_auto_hide () && ac == view->session()->recently_touched_controllable ()) {
RouteTimeAxisView::signal_ctrl_touched (false);
}
view->editor().begin_reversible_command (_("add automation event"));

View File

@ -794,6 +794,9 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, samplepos_t sampl
if (_control->automation_state () == ARDOUR::Off) {
_control->set_automation_state (ARDOUR::Play);
}
if (UIConfiguration::instance().get_automation_edit_cancels_auto_hide () && _control == _session->recently_touched_controllable ()) {
RouteTimeAxisView::signal_ctrl_touched (false);
}
XMLNode& after = list->get_state();
_editor.begin_reversible_command (_("add automation event"));

View File

@ -4066,7 +4066,7 @@ Editor::set_show_touched_automation (bool yn)
}
_show_touched_automation = yn;
if (!yn) {
RouteTimeAxisView::signal_ctrl_touched ();
RouteTimeAxisView::signal_ctrl_touched (true);
}
instant_save ();
}

View File

@ -3041,6 +3041,19 @@ These settings will only take effect after %1 is restarted.\n\
Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
_("<b>When enabled</b> new points drawn in any automation lane will be placed on the existing line, regardless of mouse y-axis position."));
bo = new BoolOption (
"automation-edit-cancels-auto-hide",
_("Automation edit_cancels_auto_hide"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_automation_edit_cancels_auto_hide),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_automation_edit_cancels_auto_hide)
);
add_option (_("Editor"), bo);
Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
_("<b>When enabled</b> automatically displayed automation lanes remain visible if events are added to the lane.\n"
"<b>When disabled</b>, spilled automation lanes are unconditionally hidden when a different control is touched.\n"
"This setting only has effect if 'Show Automation Lane on Touch' is used.")
);
ComboOption<FadeShape>* fadeshape = new ComboOption<FadeShape> (
"default-fade-shape",
_("Default fade shape"),

View File

@ -105,7 +105,7 @@ using namespace Editing;
using namespace std;
using std::list;
sigc::signal<void> RouteTimeAxisView::signal_ctrl_touched;
sigc::signal<void, bool> RouteTimeAxisView::signal_ctrl_touched;
RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session* sess, ArdourCanvas::Canvas& canvas)
: RouteUI(sess)
@ -1581,9 +1581,13 @@ RouteTimeAxisView::show_existing_automation (bool apply_to_selection)
}
void
RouteTimeAxisView::maybe_hide_automation (boost::weak_ptr<PBD::Controllable> wctrl)
RouteTimeAxisView::maybe_hide_automation (bool hide, boost::weak_ptr<PBD::Controllable> wctrl)
{
ctrl_autohide_connection.disconnect ();
if (!hide) {
/* disconnect only, leave lane visible */
return;
}
boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl> (wctrl.lock ());
if (!ac) {
return;
@ -1604,7 +1608,7 @@ RouteTimeAxisView::show_touched_automation (boost::weak_ptr<PBD::Controllable> w
if (!_editor.show_touched_automation ()) {
if (ctrl_autohide_connection.connected ()) {
signal_ctrl_touched ();
signal_ctrl_touched (true);
}
return;
}
@ -1615,7 +1619,7 @@ RouteTimeAxisView::show_touched_automation (boost::weak_ptr<PBD::Controllable> w
}
/* hide any lanes */
signal_ctrl_touched ();
signal_ctrl_touched (true);
if (!pan->menu_item->get_active ()) {
pan->menu_item->set_active (true);

View File

@ -141,7 +141,7 @@ public:
void meter_changed ();
void effective_gain_display () { gm.effective_gain_display(); }
static sigc::signal<void> signal_ctrl_touched;
static sigc::signal<void, bool> signal_ctrl_touched;
std::string state_id() const;
@ -307,7 +307,7 @@ private:
void parameter_changed (std::string const & p);
void update_track_number_visibility();
void show_touched_automation (boost::weak_ptr<PBD::Controllable>);
void maybe_hide_automation (boost::weak_ptr<PBD::Controllable>);
void maybe_hide_automation (bool, boost::weak_ptr<PBD::Controllable>);
void drop_instrument_ref ();
void reread_midnam ();

View File

@ -42,6 +42,7 @@ UI_CONFIG_VARIABLE (bool, draggable_playhead, "draggable-playhead", true)
UI_CONFIG_VARIABLE (float, draggable_playhead_speed, "draggable-playhead-speed", 0.5)
UI_CONFIG_VARIABLE (float, extra_ui_extents_time, "extra-ui-extents-time", 1.0)
UI_CONFIG_VARIABLE (bool, new_automation_points_on_lane, "new-automation-points-on-lane", false)
UI_CONFIG_VARIABLE (bool, automation_edit_cancels_auto_hide, "automation-edit-cancels-auto-hide", false)
UI_CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
UI_CONFIG_VARIABLE (std::string, keyboard_layout_name, "keyboard-layout-name", "ansi")
UI_CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")