move VCA assignment up to Route level

This commit is contained in:
Paul Davis 2016-03-07 22:20:37 -05:00
parent c3afeab49c
commit 04e26fe7e6
3 changed files with 25 additions and 12 deletions

View File

@ -2508,10 +2508,8 @@ MixerStrip::vca_menu_toggle (CheckMenuItem* menuitem, uint32_t n)
}
if (!menuitem->get_active()) {
cerr << "Unassign from " << n << endl;
_mixer.do_vca_unassign (vca);
} else {
cerr << "Assign to " << n << endl;
_mixer.do_vca_assign (vca);
}
}
@ -2522,8 +2520,8 @@ MixerStrip::vca_assign (boost::shared_ptr<VCA> vca)
if (!vca || !_route) {
return;
}
_route->gain_control()->add_master (vca);
vca->add_solo_mute_target (_route);
_route->vca_assign (vca);
}
void
@ -2533,14 +2531,7 @@ MixerStrip::vca_unassign (boost::shared_ptr<VCA> vca)
return;
}
if (!vca) {
/* null VCA means drop all VCA assignments */
_route->gain_control()->clear_masters ();
/* XXX Need to remove all solo/mute target entries */
} else {
_route->gain_control()->remove_master (vca);
vca->remove_solo_mute_target (_route);
}
_route->vca_unassign (vca);
}
bool

View File

@ -710,6 +710,8 @@ public:
pframes_t nframes, int declick);
bool slaved_to (boost::shared_ptr<VCA>) const;
void vca_assign (boost::shared_ptr<VCA>);
void vca_unassign (boost::shared_ptr<VCA>);
protected:
friend class Session;

View File

@ -5894,3 +5894,23 @@ Route::slaved_to (boost::shared_ptr<VCA> vca) const
return _gain_control->slaved_to (vca);
}
void
Route::vca_assign (boost::shared_ptr<VCA> vca)
{
_gain_control->add_master (vca);
vca->add_solo_mute_target (shared_from_this());
}
void
Route::vca_unassign (boost::shared_ptr<VCA> vca)
{
if (!vca) {
/* unassign from all */
_gain_control->clear_masters ();
/* XXXX need to remove from solo/mute target lists */
} else {
_gain_control->remove_master (vca);
vca->remove_solo_mute_target (shared_from_this());
}
}