make VCA delete button work
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 29 Apr 2016 15:07:57 +0000 (11:07 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:42 +0000 (15:30 -0400)
gtk2_ardour/vca_master_strip.cc
gtk2_ardour/vca_master_strip.h

index 34bebc9be91b0200c04be96531ac927eb629262c..ba1b58d3bcbbd2bd5645d487f8c7d109e5eda6bd 100644 (file)
@@ -23,6 +23,7 @@
 #include "ardour/vca.h"
 #include "ardour/vca_manager.h"
 
+#include "gtkmm2ext/doi.h"
 #include "gtkmm2ext/keyboard.h"
 
 #include "gui_thread.h"
@@ -155,7 +156,7 @@ VCAMasterStrip::~VCAMasterStrip ()
 void
 VCAMasterStrip::self_delete ()
 {
-       delete this;
+       delete_when_idle (this);
 }
 
 void
@@ -192,6 +193,10 @@ VCAMasterStrip::name() const
 void
 VCAMasterStrip::hide_clicked ()
 {
+       /* get everything to deassign. This will also delete ourselves (when
+        * idle) and that in turn will remove us from the Mixer GUI
+        */
+       _session->vca_manager().remove_vca (_vca);
 }
 
 bool
index d8ef778ee181d8bee52c6bad985cea8e5f7077da..b3fdc5d31003e955d41e503bdb408af4d7ba8329 100644 (file)
@@ -39,6 +39,7 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
 {
       public:
        VCAMasterStrip (ARDOUR::Session*, boost::shared_ptr<ARDOUR::VCA>);
+       ~VCAMasterStrip ();
 
        std::string name() const;
        std::string state_id() const { return "VCAMasterStrip"; }
@@ -47,8 +48,6 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
        static PBD::Signal1<void,VCAMasterStrip*> CatchDeletion;
 
      private:
-       ~VCAMasterStrip ();
-
        boost::shared_ptr<ARDOUR::VCA> _vca;
        Gtk::HBox    vertical_padding;
        ArdourButton name_button;