mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Add a "select topmost" track editor action
This commit is contained in:
parent
de45ac0e76
commit
dc3ae8d196
4 changed files with 20 additions and 0 deletions
|
|
@ -394,6 +394,8 @@ public:
|
||||||
void scroll_left_half_page ();
|
void scroll_left_half_page ();
|
||||||
void scroll_right_half_page ();
|
void scroll_right_half_page ();
|
||||||
|
|
||||||
|
void select_topmost_track ();
|
||||||
|
|
||||||
void prepare_for_cleanup ();
|
void prepare_for_cleanup ();
|
||||||
void finish_cleanup ();
|
void finish_cleanup ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,7 @@ Editor::register_actions ()
|
||||||
act = reg_sens (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), sigc::mem_fun(*this, &Editor::scroll_tracks_down));
|
act = reg_sens (editor_actions, "scroll-tracks-down", _("Scroll Tracks Down"), sigc::mem_fun(*this, &Editor::scroll_tracks_down));
|
||||||
act = reg_sens (editor_actions, "step-tracks-up", _("Step Tracks Up"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_up_one_track), true)));
|
act = reg_sens (editor_actions, "step-tracks-up", _("Step Tracks Up"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_up_one_track), true)));
|
||||||
act = reg_sens (editor_actions, "step-tracks-down", _("Step Tracks Down"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_down_one_track), true)));
|
act = reg_sens (editor_actions, "step-tracks-down", _("Step Tracks Down"), sigc::hide_return (sigc::bind (sigc::mem_fun(*this, &Editor::scroll_down_one_track), true)));
|
||||||
|
act = reg_sens (editor_actions, "select-topmost", _("Select Topmost Track"), (sigc::mem_fun(*this, &Editor::select_topmost_track)));
|
||||||
|
|
||||||
reg_sens (editor_actions, "scroll-backward", _("Scroll Backward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_backward), 0.8f));
|
reg_sens (editor_actions, "scroll-backward", _("Scroll Backward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_backward), 0.8f));
|
||||||
reg_sens (editor_actions, "scroll-forward", _("Scroll Forward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_forward), 0.8f));
|
reg_sens (editor_actions, "scroll-forward", _("Scroll Forward"), sigc::bind (sigc::mem_fun(*this, &Editor::scroll_forward), 0.8f));
|
||||||
|
|
|
||||||
|
|
@ -1451,6 +1451,22 @@ Editor::scroll_tracks_up_line ()
|
||||||
reset_y_origin (vertical_adjustment.get_value() - 60);
|
reset_y_origin (vertical_adjustment.get_value() - 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::select_topmost_track ()
|
||||||
|
{
|
||||||
|
const double top_of_trackviews = vertical_adjustment.get_value();
|
||||||
|
for (TrackViewList::iterator t = track_views.begin(); t != track_views.end(); ++t) {
|
||||||
|
if ((*t)->hidden()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
std::pair<TimeAxisView*,double> res = (*t)->covers_y_position (top_of_trackviews);
|
||||||
|
if (res.first) {
|
||||||
|
selection->set (*t);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::scroll_down_one_track (bool skip_child_views)
|
Editor::scroll_down_one_track (bool skip_child_views)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -316,6 +316,7 @@ public:
|
||||||
virtual void scroll_tracks_up_line () = 0;
|
virtual void scroll_tracks_up_line () = 0;
|
||||||
virtual bool scroll_down_one_track (bool skip_child_views = false) = 0;
|
virtual bool scroll_down_one_track (bool skip_child_views = false) = 0;
|
||||||
virtual bool scroll_up_one_track (bool skip_child_views = false) = 0;
|
virtual bool scroll_up_one_track (bool skip_child_views = false) = 0;
|
||||||
|
virtual void select_topmost_track () = 0;
|
||||||
virtual void prepare_for_cleanup () = 0;
|
virtual void prepare_for_cleanup () = 0;
|
||||||
virtual void finish_cleanup () = 0;
|
virtual void finish_cleanup () = 0;
|
||||||
virtual void reset_x_origin (framepos_t frame) = 0;
|
virtual void reset_x_origin (framepos_t frame) = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue