Add option to en/disable showing automation-lane on touch

This commit is contained in:
Robin Gareus 2021-02-08 19:45:37 +01:00
parent bd8c26a059
commit 01bb38d99e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
6 changed files with 50 additions and 3 deletions

View file

@ -276,6 +276,7 @@
<menuitem action='set-tempo-from-edit-range'/>
</menu>
<menuitem action='set-mouse-mode-object-range'/>
<menuitem action='show-touched-automation'/>
<separator/>
<menu action="LuaScripts">
<menuitem action='toggle-script-manager'/>

View file

@ -455,6 +455,7 @@ Editor::Editor ()
, _region_selection_change_updates_region_list (true)
, _cursors (0)
, _following_mixer_selection (false)
, _show_touched_automation (false)
, _control_point_toggled_on_press (false)
, _stepping_axis_view (0)
, quantize_dialog (0)
@ -2471,6 +2472,15 @@ Editor::set_state (const XMLNode& node, int version)
tact->set_active (yn);
}
yn = false;
node.get_property (X_("show-touched-automation"), yn);
{
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("show-touched-automation"));
/* do it twice to force the change */
tact->set_active (!yn);
tact->set_active (yn);
}
XMLNodeList children = node.children ();
for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
selection->set_state (**i, Stateful::current_state_version);
@ -2569,6 +2579,7 @@ Editor::get_state ()
}
node->set_property (X_("show-marker-lines"), _show_marker_lines);
node->set_property (X_("show-touched-automation"), _show_touched_automation);
node->add_child_nocopy (selection->get_state ());
node->add_child_nocopy (_regions->get_state ());
@ -4027,6 +4038,32 @@ Editor::set_stationary_playhead (bool yn)
}
}
bool
Editor::show_touched_automation () const
{
if (!contents().is_mapped()) {
return false;
}
return _show_touched_automation;
}
void
Editor::toggle_show_touched_automation ()
{
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("show-touched-automation"));
set_show_touched_automation (tact->get_active());
}
void
Editor::set_show_touched_automation (bool yn)
{
if (_show_touched_automation == yn) {
return;
}
_show_touched_automation = yn;
instant_save ();
}
PlaylistSelector&
Editor::playlist_selector () const
{

View file

@ -386,6 +386,9 @@ public:
/* returns the left-most and right-most time that the gui should allow the user to scroll to */
std::pair <samplepos_t,samplepos_t> session_gui_extents (bool use_extra = true) const;
/* RTAV Automation display option */
bool show_touched_automation () const;
/* fades */
void toggle_region_fades (int dir);
@ -2309,6 +2312,11 @@ private:
void follow_mixer_selection ();
bool _following_mixer_selection;
/* RTAV Automation display option */
void toggle_show_touched_automation ();
void set_show_touched_automation (bool);
bool _show_touched_automation;
int time_fx (ARDOUR::RegionList&, float val, bool pitching);
void note_edit_done (int, EditNoteDialog*);
void toggle_sound_midi_notes ();

View file

@ -446,6 +446,8 @@ Editor::register_actions ()
ActionManager::register_toggle_action (editor_actions, "toggle-stationary-playhead", _("Stationary Playhead"), (mem_fun(*this, &Editor::toggle_stationary_playhead)));
ActionManager::register_toggle_action (editor_actions, "show-touched-automation", _("Show Automation Lane on Touch"), (mem_fun(*this, &Editor::toggle_show_touched_automation)));
act = reg_sens (editor_actions, "insert-time", _("Insert Time"), (sigc::mem_fun(*this, &Editor::do_insert_time)));
ActionManager::track_selection_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, "remove-time", _("Remove Time"), (mem_fun(*this, &Editor::do_remove_time)));

View file

@ -365,6 +365,7 @@ public:
virtual void embed_audio_from_video (std::string, samplepos_t n = 0, bool lock_position_to_video = true) = 0;
virtual bool track_selection_change_without_scroll () const = 0;
virtual bool show_touched_automation () const = 0;
virtual StripableTimeAxisView* get_stripable_time_axis_by_id (const PBD::ID& id) const = 0;

View file

@ -1602,11 +1602,9 @@ RouteTimeAxisView::show_touched_automation (boost::weak_ptr<PBD::Controllable> w
return;
}
#if 0
if (!_editor.show_touched_automation_lane ()) {
if (!_editor.show_touched_automation ()) {
return;
}
#endif
ProcessorAutomationNode* pan = find_processor_automation_node (ac);
if (!pan) {