vca: make Remove context menu option work
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 19 May 2016 02:02:14 +0000 (22:02 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:43 +0000 (15:30 -0400)
Also cancel spill view if relevant, during VCA Master Strip deletion

gtk2_ardour/vca_master_strip.cc
gtk2_ardour/vca_master_strip.h

index e40dd96ba3d0b8e9fa14655bdd804c7d10bc448e..f0e7cfac90abdb9f66b59065d9389b82cdea2a14 100644 (file)
@@ -168,6 +168,11 @@ VCAMasterStrip::VCAMasterStrip (Session* s, boost::shared_ptr<VCA> v)
 
 VCAMasterStrip::~VCAMasterStrip ()
 {
+       if ((_session && !_session->deletion_in_progress()) && Mixer_UI::instance()->showing_vca_slaves_for (_vca)) {
+               /* cancel spill for this VCA */
+               Mixer_UI::instance()->show_vca_slaves (boost::shared_ptr<VCA>());
+       }
+
        delete delete_dialog;
        delete context_menu;
 
@@ -476,7 +481,7 @@ VCAMasterStrip::build_context_menu ()
        context_menu = new Menu;
        MenuList& items = context_menu->items();
        items.push_back (MenuElem (_("Rename"), sigc::mem_fun (*this, &VCAMasterStrip::start_name_edit)));
-       items.push_back (MenuElem (_("Remove")));
+       items.push_back (MenuElem (_("Remove"), sigc::mem_fun (*this, &VCAMasterStrip::remove)));
 }
 
 void
@@ -498,3 +503,13 @@ VCAMasterStrip::spill_change (boost::shared_ptr<VCA> vca)
                vertical_button.set_active_state (Gtkmm2ext::ExplicitActive);
        }
 }
+
+void
+VCAMasterStrip::remove ()
+{
+       if (!_session) {
+               return;
+       }
+
+       _session->vca_manager().remove_vca (_vca);
+}
index 473406198770787d93100b2a99fc5c4c46fb54c8..a9636dfe693325477b6e232d81d78a6034a241cb 100644 (file)
@@ -94,6 +94,7 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
        void build_context_menu ();
        void hide_confirmation (int);
        void self_delete ();
+       void remove ();
 };