Make track context menu height option work for all selected tracks.
git-svn-id: svn://localhost/ardour2/branches/3.0@8935 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -428,9 +428,13 @@ TimeAxisView::set_heights (uint32_t h)
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisView::set_height_enum (Height h)
|
||||
TimeAxisView::set_height_enum (Height h, bool apply_to_selection)
|
||||
{
|
||||
set_height (preset_height (h));
|
||||
if (apply_to_selection) {
|
||||
_editor.get_selection().tracks.foreach_time_axis (boost::bind (&TimeAxisView::set_height_enum, _1, h, false));
|
||||
} else {
|
||||
set_height (preset_height (h));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1362,10 +1366,10 @@ TimeAxisView::build_size_menu ()
|
||||
_size_menu->set_name ("ArdourContextMenu");
|
||||
MenuList& items = _size_menu->items();
|
||||
|
||||
items.push_back (MenuElem (_("Largest"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLargest)));
|
||||
items.push_back (MenuElem (_("Larger"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger)));
|
||||
items.push_back (MenuElem (_("Large"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge)));
|
||||
items.push_back (MenuElem (_("Normal"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal)));
|
||||
items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller)));
|
||||
items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall)));
|
||||
items.push_back (MenuElem (_("Largest"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLargest, true)));
|
||||
items.push_back (MenuElem (_("Larger"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger, true)));
|
||||
items.push_back (MenuElem (_("Large"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge, true)));
|
||||
items.push_back (MenuElem (_("Normal"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal, true)));
|
||||
items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller, true)));
|
||||
items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall, true)));
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
||||
virtual void exited () {}
|
||||
|
||||
virtual void set_height (uint32_t h);
|
||||
void set_height_enum (Height);
|
||||
void set_height_enum (Height, bool apply_to_selection = false);
|
||||
void reset_height();
|
||||
|
||||
std::pair<TimeAxisView*, ARDOUR::layer_t> covers_y_position (double);
|
||||
|
||||
@@ -35,6 +35,13 @@ public:
|
||||
|
||||
TrackViewList add (TrackViewList const &);
|
||||
|
||||
template <typename Function>
|
||||
void foreach_time_axis (Function f) {
|
||||
for (iterator i = begin(); i != end(); ++i) {
|
||||
f (*i);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Function>
|
||||
void foreach_route_ui (Function f) {
|
||||
for (iterator i = begin(); i != end(); ++i) {
|
||||
|
||||
Reference in New Issue
Block a user