-void
-MixerStrip::vca_menu_toggle (Gtk::CheckMenuItem* menuitem, uint32_t n)
-{
- if (!_route) {
- return;
- }
-
- boost::shared_ptr<VCA> vca = _session->vca_manager().vca_by_number (n);
-
- if (!vca) {
- return;
- }
-
- if (!_selected) {
- /* if this strip is not selected, add it before carrying out
- changes to assignment. the user probably didn't notice
- that they were clicking on an unselected track.
- */
- _mixer.select_strip (*this);
- }
-
- if (!menuitem->get_active()) {
- _mixer.do_vca_unassign (vca);
- } else {
- _mixer.do_vca_assign (vca);
- }
-}
-
-void
-MixerStrip::vca_assign (boost::shared_ptr<VCA> vca)
-{
- if (!vca || !_route) {
- return;
- }
-
- _route->assign (vca);
-}
-
-void
-MixerStrip::vca_unassign (boost::shared_ptr<VCA> vca)
-{
- if (!_route) {
- return;
- }
-
- _route->unassign (vca);
-}
-
-bool
-MixerStrip::vca_button_release (GdkEventButton* ev)
-{
- using namespace Gtk::Menu_Helpers;
-
- if (!_session) {
- return false;
- }
-
- /* primary click only */
-
- if (ev->button != 1) {
- return false;
- }
-
- if (!_route) {
- /* no route - nothing to do */
- return false;
- }
-
- VCAList vcas (_session->vca_manager().vcas());
-
- if (vcas.empty()) {
- /* the button should not have been visible under these conditions */
- return true;
- }
-
- Menu* menu = new Menu;
- MenuList& items = menu->items();
-
- items.push_back (MenuElem (_("Unassign"), sigc::bind (sigc::mem_fun (_mixer, &Mixer_UI::do_vca_unassign), boost::shared_ptr<VCA>())));
-
- for (VCAList::iterator v = vcas.begin(); v != vcas.end(); ++v) {
- items.push_back (CheckMenuElem ((*v)->name()));
- Gtk::CheckMenuItem* item = dynamic_cast<Gtk::CheckMenuItem*> (&items.back());
- if (_route->slaved_to (*v)) {
- item->set_active (true);
- }
- item->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &MixerStrip::vca_menu_toggle), item, (*v)->number()));
- }
-
- menu->popup (1, ev->time);
-
- return true;
-}
-