Add options to add sends from buses as well as tracks; remainder of #3637.

git-svn-id: svn://localhost/ardour2/branches/3.0@8372 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-12-29 22:07:34 +00:00
parent d367d94c7f
commit 6f306c9821
4 changed files with 41 additions and 15 deletions

View File

@ -659,10 +659,37 @@ RouteUI::build_sends_menu ()
sends_menu->set_name ("ArdourContextMenu");
MenuList& items = sends_menu->items();
items.push_back (MenuElem(_("Assign all tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader)));
items.push_back (MenuElem(_("Assign all tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader)));
items.push_back (MenuElem(_("Assign selected tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader)));
items.push_back (MenuElem(_("Assign selected tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader)));
items.push_back (
MenuElem(_("Assign all tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, false))
);
items.push_back (
MenuElem(_("Assign all tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PreFader, true))
);
items.push_back (
MenuElem(_("Assign all tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, false))
);
items.push_back (
MenuElem(_("Assign all tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_sends), PostFader, true))
);
items.push_back (
MenuElem(_("Assign selected tracks (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, false))
);
items.push_back (
MenuElem(_("Assign selected tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PreFader, true)));
items.push_back (
MenuElem(_("Assign selected tracks (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, false))
);
items.push_back (
MenuElem(_("Assign selected tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &RouteUI::create_selected_sends), PostFader, true))
);
items.push_back (MenuElem(_("Copy track/bus gains to sends"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_from_track)));
items.push_back (MenuElem(_("Set sends gain to -inf"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_to_zero)));
items.push_back (MenuElem(_("Set sends gain to 0dB"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_to_unity)));
@ -670,13 +697,13 @@ RouteUI::build_sends_menu ()
}
void
RouteUI::create_sends (Placement p)
RouteUI::create_sends (Placement p, bool include_buses)
{
_session->globally_add_internal_sends (_route, p);
_session->globally_add_internal_sends (_route, p, include_buses);
}
void
RouteUI::create_selected_sends (Placement p)
RouteUI::create_selected_sends (Placement p, bool include_buses)
{
boost::shared_ptr<RouteList> rlist (new RouteList);
TrackSelection& selected_tracks (ARDOUR_UI::instance()->the_editor().get_selection().tracks);
@ -686,7 +713,7 @@ RouteUI::create_selected_sends (Placement p)
RouteUI* rui;
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
if ((rui = dynamic_cast<RouteUI*>(rtv)) != 0) {
if (boost::dynamic_pointer_cast<AudioTrack>(rui->route())) {
if (include_buses || boost::dynamic_pointer_cast<AudioTrack>(rui->route())) {
rlist->push_back (rui->route());
}
}

View File

@ -131,8 +131,8 @@ class RouteUI : public virtual AxisView
void set_sends_gain_from_track ();
void set_sends_gain_to_zero ();
void set_sends_gain_to_unity ();
void create_sends (ARDOUR::Placement);
void create_selected_sends (ARDOUR::Placement);
void create_sends (ARDOUR::Placement, bool);
void create_selected_sends (ARDOUR::Placement, bool);
void solo_changed(bool, void*);
void solo_changed_so_update_mute ();

View File

@ -602,7 +602,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
boost::shared_ptr<Route> monitor_out() const { return _monitor_out; }
boost::shared_ptr<Route> master_out() const { return _master_out; }
void globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p);
void globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p, bool);
void globally_set_send_gains_from_track (boost::shared_ptr<Route> dest);
void globally_set_send_gains_to_zero (boost::shared_ptr<Route> dest);
void globally_set_send_gains_to_unity (boost::shared_ptr<Route> dest);

View File

@ -2090,16 +2090,15 @@ Session::globally_set_send_gains_from_track(boost::shared_ptr<Route> dest)
}
}
/** @param include_buses true to add sends to buses and tracks, false for just tracks */
void
Session::globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p)
Session::globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p, bool include_buses)
{
boost::shared_ptr<RouteList> r = routes.reader ();
boost::shared_ptr<RouteList> t (new RouteList);
/* only send tracks */
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (boost::dynamic_pointer_cast<Track>(*i)) {
if (include_buses || boost::dynamic_pointer_cast<Track>(*i)) {
t->push_back (*i);
}
}