Make sure we don't deactivate un-activated plugins or re-activate already activated...
authorSampo Savolainen <v2@iki.fi>
Tue, 25 Sep 2007 16:31:42 +0000 (16:31 +0000)
committerSampo Savolainen <v2@iki.fi>
Tue, 25 Sep 2007 16:31:42 +0000 (16:31 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2480 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/ladspa_plugin.h

index 63f8f600d34f1b8fe213ff31644c594897f9e247..b7cca2270d3d6c04d1bae83c54d4ddc828338ffd 100644 (file)
@@ -65,12 +65,18 @@ class LadspaPlugin : public ARDOUR::Plugin
        std::set<uint32_t> automatable() const;
        uint32_t nth_parameter (uint32_t port, bool& ok) const;
        void activate () { 
+               if (was_activated)
+                       return;
+
                if (descriptor->activate) {
                        descriptor->activate (handle);
                }
                was_activated = true;
        }
        void deactivate () {
+               if (!was_activated)
+                       return;
+
                if (descriptor->deactivate) 
                        descriptor->deactivate (handle);
        }