Make activate/deactivate all only operate on visible
authorCarl Hetherington <carl@carlh.net>
Wed, 16 Nov 2011 17:40:16 +0000 (17:40 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 16 Nov 2011 17:40:16 +0000 (17:40 +0000)
processors (and also exclude the fader) (#4475).

git-svn-id: svn://localhost/ardour2/branches/3.0@10649 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/processor_box.cc
gtk2_ardour/processor_box.h
libs/ardour/ardour/route.h
libs/ardour/route.cc

index 47d8a5601697136c734779e194512501b639ae2e..d5699c3651f61d4cbe3a392b06cca376f34f3179 100644 (file)
@@ -1666,10 +1666,9 @@ ProcessorBox::for_selected_processors (void (ProcessorBox::*method)(boost::share
 }
 
 void
-ProcessorBox::all_processors_active (bool state)
+ProcessorBox::all_visible_processors_active (bool state)
 {
-       _route->all_processors_active (PreFader, state);
-       _route->all_processors_active (PostFader, state);
+       _route->all_visible_processors_active (state);
 }
 
 void
@@ -1946,9 +1945,9 @@ ProcessorBox::register_actions ()
 
        /* activation etc. */
 
-       ActionManager::register_action (popup_act_grp, X_("activate_all"), _("Activate all"),
+       ActionManager::register_action (popup_act_grp, X_("activate_all"), _("Activate All"),
                        sigc::ptr_fun (ProcessorBox::rb_activate_all));
-       ActionManager::register_action (popup_act_grp, X_("deactivate_all"), _("Deactivate all"),
+       ActionManager::register_action (popup_act_grp, X_("deactivate_all"), _("Deactivate All"),
                        sigc::ptr_fun (ProcessorBox::rb_deactivate_all));
        ActionManager::register_action (popup_act_grp, X_("ab_plugins"), _("A/B Plugins"),
                        sigc::ptr_fun (ProcessorBox::rb_ab_plugins));
@@ -2120,7 +2119,7 @@ ProcessorBox::rb_activate_all ()
                return;
        }
 
-       _current_processor_box->all_processors_active (true);
+       _current_processor_box->all_visible_processors_active (true);
 }
 
 void
@@ -2129,7 +2128,7 @@ ProcessorBox::rb_deactivate_all ()
        if (_current_processor_box == 0) {
                return;
        }
-       _current_processor_box->all_processors_active (false);
+       _current_processor_box->all_visible_processors_active (false);
 }
 
 void
index 9bc45d716df3f12c18a3fbd7858908e7330ad18e..bbbcf8ceb901bda022e9f354239394860d97270e 100644 (file)
@@ -301,8 +301,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        void processors_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);
        void compute_processor_sort_keys ();
 
-       void all_processors_active(bool state);
-       void all_plugins_active(bool state);
+       void all_visible_processors_active(bool state);
        void ab_plugins ();
 
        typedef std::vector<boost::shared_ptr<ARDOUR::Processor> > ProcSelection;
index b0a9ce12c93e9114f5b8e3f6ceb59554771913bc..7f485c18c3fb5183fce20b5b67e97eb6704a0ffc 100644 (file)
@@ -246,7 +246,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
        void disable_plugins ();
        void ab_plugins (bool forward);
        void clear_processors (Placement);
-       void all_processors_active (Placement, bool state);
+       void all_visible_processors_active (bool);
 
        framecnt_t set_private_port_latencies (bool playback) const;
        void       set_public_port_latencies (framecnt_t, bool playback) const;
index 070c6b61b91d247df6ac1940ceb14be7835881cb..8aebaf26646b96722be0bacb47dd36aa5a26e6f0 100644 (file)
@@ -1625,12 +1625,11 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
        return 0;
 }
 
-/** Set all processors with a given placement to a given active state.
- * @param p Placement of processors to change.
- * @param state New active state for those processors.
+/** Set all visible processors to a given active state (except Fader, whose state is not changed)
+ *  @param state New active state for those processors.
  */
 void
-Route::all_processors_active (Placement p, bool state)
+Route::all_visible_processors_active (bool state)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock);
 
@@ -1638,10 +1637,11 @@ Route::all_processors_active (Placement p, bool state)
                return;
        }
        
-       ProcessorList::iterator start, end;
-       placement_range(p, start, end);
-
-       for (ProcessorList::iterator i = start; i != end; ++i) {
+       for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+               if (!(*i)->display_to_user() || boost::dynamic_pointer_cast<Amp> (*i)) {
+                       continue;
+               }
+               
                if (state) {
                        (*i)->activate ();
                } else {