Make 'copy track gains to sends' and 'set sends gains' work with sends from busses. Partially fixes #3637.

git-svn-id: svn://localhost/ardour2/branches/3.0@8369 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-12-29 21:07:22 +00:00
parent 0dd2fb557c
commit d725fc2d1c
2 changed files with 7 additions and 19 deletions

View File

@ -663,7 +663,7 @@ RouteUI::build_sends_menu ()
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(_("Copy track gains to sends"), sigc::mem_fun (*this, &RouteUI::set_sends_gain_from_track)));
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)));

View File

@ -2057,13 +2057,9 @@ Session::globally_set_send_gains_to_zero (boost::shared_ptr<Route> dest)
boost::shared_ptr<RouteList> r = routes.reader ();
boost::shared_ptr<Send> s;
/* only tracks */
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (boost::dynamic_pointer_cast<Track>(*i)) {
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value (0.0);
}
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value (0.0);
}
}
}
@ -2074,13 +2070,9 @@ Session::globally_set_send_gains_to_unity (boost::shared_ptr<Route> dest)
boost::shared_ptr<RouteList> r = routes.reader ();
boost::shared_ptr<Send> s;
/* only tracks */
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (boost::dynamic_pointer_cast<Track>(*i)) {
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value (1.0);
}
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value (1.0);
}
}
}
@ -2091,13 +2083,9 @@ Session::globally_set_send_gains_from_track(boost::shared_ptr<Route> dest)
boost::shared_ptr<RouteList> r = routes.reader ();
boost::shared_ptr<Send> s;
/* only tracks */
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if (boost::dynamic_pointer_cast<Track>(*i)) {
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value ((*i)->gain_control()->get_value());
}
if ((s = (*i)->internal_send_for (dest)) != 0) {
s->amp()->gain_control()->set_value ((*i)->gain_control()->get_value());
}
}
}