add Editor-level action to toggle track layer display
This commit is contained in:
parent
c2b026831c
commit
0ecf1e40ea
|
@ -432,6 +432,8 @@
|
|||
|
||||
<separator/>
|
||||
|
||||
<menuitem action="toggle-layer-display"/>
|
||||
|
||||
<menu action="PrimaryClockMenu">
|
||||
<menuitem action='focus-on-clock'/>
|
||||
<menuitem action="primary-clock-timecode"/>
|
||||
|
|
|
@ -1509,6 +1509,7 @@ private:
|
|||
bool select_new_marker;
|
||||
|
||||
void toggle_all_existing_automation ();
|
||||
void toggle_layer_display ();
|
||||
|
||||
void reverse_selection ();
|
||||
void edit_envelope ();
|
||||
|
|
|
@ -257,6 +257,7 @@ Editor::register_actions ()
|
|||
reg_sens (editor_actions, "select-prev-stripable", _("Select Previous Strip"), sigc::bind (sigc::mem_fun(*this, &Editor::select_prev_stripable), false));
|
||||
|
||||
reg_sens (editor_actions, "toggle-all-existing-automation", _("Toggle All Existing Automation"), sigc::mem_fun (*this, &Editor::toggle_all_existing_automation));
|
||||
reg_sens (editor_actions, "toggle-layer-display", _("Toggle Layer Display"), sigc::mem_fun (*this, &Editor::toggle_layer_display));
|
||||
|
||||
act = reg_sens (editor_actions, "track-record-enable-toggle", _("Toggle Record Enable"), sigc::mem_fun(*this, &Editor::toggle_record_enable));
|
||||
ActionManager::track_selection_sensitive_actions.push_back (act);
|
||||
|
|
|
@ -8531,3 +8531,34 @@ Editor::toggle_all_existing_automation ()
|
|||
tvl.foreach_stripable_time_axis (boost::bind (&StripableTimeAxisView::hide_all_automation, _1, false));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_layer_display ()
|
||||
{
|
||||
TrackViewList & tvl (selection->tracks.empty() ? track_views : selection->tracks);
|
||||
bool seen_stacked = false;
|
||||
bool seen_overlaid = false;
|
||||
|
||||
for (TrackViewList::const_iterator t = tvl.begin(); t != tvl.end(); ++t) {
|
||||
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*t);
|
||||
|
||||
if (!rtav || !rtav->is_track()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rtav->layer_display () == Stacked) {
|
||||
seen_stacked = true;
|
||||
} else if (rtav->layer_display() == Overlaid) {
|
||||
seen_overlaid = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (seen_stacked && seen_overlaid) {
|
||||
/* inconsistent current display - go to overlaid */
|
||||
tvl.foreach_route_time_axis (boost::bind (&RouteTimeAxisView::set_layer_display, _1, Overlaid));
|
||||
|
||||
} else {
|
||||
tvl.foreach_route_time_axis (boost::bind (&RouteTimeAxisView::toggle_layer_display, _1));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user