Make send automation work (#4734).
[ardour.git] / gtk2_ardour / processor_box.h
index 364ab7b1165919675953f1d715beb85eb275dd78..67a9e315d505bf8cdee73321a2cec47b7c590fb7 100644 (file)
@@ -101,7 +101,7 @@ private:
 class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
 {
 public:
-       ProcessorEntry (boost::shared_ptr<ARDOUR::Processor>, Width);
+       ProcessorEntry (ProcessorBox *, boost::shared_ptr<ARDOUR::Processor>, Width);
        ~ProcessorEntry ();
 
        Gtk::EventBox& action_widget ();
@@ -128,6 +128,7 @@ public:
        void add_control_state (XMLNode *) const;
        void set_control_state (XMLNode const *);
        std::string state_id () const;
+       Gtk::Menu* build_controls_menu ();
 
        static void setup_slider_pix ();
 
@@ -139,6 +140,7 @@ protected:
        virtual void setup_visuals ();
 
        static Glib::RefPtr<Gdk::Pixbuf> _slider_pixbuf;
+       static Glib::RefPtr<Gdk::Pixbuf> _slider_pixbuf_desensitised;
 
 private:
        void led_clicked();
@@ -147,52 +149,69 @@ private:
        std::string name (Width) const;
        void setup_tooltip ();
 
+       ProcessorBox* _parent;
        boost::shared_ptr<ARDOUR::Processor> _processor;
        Width _width;
        Gtk::StateType _visual_state;
        PBD::ScopedConnection active_connection;
        PBD::ScopedConnection name_connection;
 
-       class Control {
+       class Control : public sigc::trackable {
        public:
-               Control (Glib::RefPtr<Gdk::Pixbuf>, boost::shared_ptr<ARDOUR::AutomationControl>, std::string const &);
+               Control (Glib::RefPtr<Gdk::Pixbuf>, Glib::RefPtr<Gdk::Pixbuf>, boost::shared_ptr<ARDOUR::AutomationControl>, std::string const &);
 
                void set_pixel_width (int);
-               void show ();
-               void hide ();
+               void set_visible (bool);
                void add_state (XMLNode *) const;
                void set_state (XMLNode const *);
                void hide_things ();
+               void hide_label ();
+
+               bool visible () const {
+                       return _visible;
+               }
+
+               std::string name () const {
+                       return _name;
+               }
                
                Gtk::VBox box;
 
        private:
                void slider_adjusted ();
+               void button_clicked ();
                void control_changed ();
                std::string state_id () const;
+               void set_tooltip ();
 
                boost::weak_ptr<ARDOUR::AutomationControl> _control;
+               /* things for a slider */
                Gtk::Adjustment _adjustment;
                Gtkmm2ext::HSliderController _slider;
                Gtk::Label _label;
-               bool _ignore_slider_adjustment;
+               /* things for a button */
+               ArdourButton _button;
+               bool _ignore_ui_adjustment;
                PBD::ScopedConnection _connection;
                bool _visible;
+               std::string _name;
        };
 
        std::list<Control*> _controls;
+
+       void toggle_control_visibility (Control *);
 };
 
 class BlankProcessorEntry : public ProcessorEntry
 {
   public:
-       BlankProcessorEntry (Width w);
+       BlankProcessorEntry (ProcessorBox *, Width w);
 };
 
 class PluginInsertProcessorEntry : public ProcessorEntry
 {
 public:
-       PluginInsertProcessorEntry (boost::shared_ptr<ARDOUR::PluginInsert>, Width);
+       PluginInsertProcessorEntry (ProcessorBox *, boost::shared_ptr<ARDOUR::PluginInsert>, Width);
 
        void hide_things ();
 
@@ -231,8 +250,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        void set_route (boost::shared_ptr<ARDOUR::Route>);
        void set_width (Width);
 
-       void update();
-
        void processor_operation (ProcessorOperation);
 
        void select_all_processors ();
@@ -245,7 +262,10 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
 
        Gtk::Window* get_processor_ui (boost::shared_ptr<ARDOUR::Processor>) const;
        void toggle_edit_processor (boost::shared_ptr<ARDOUR::Processor>);
+       void toggle_edit_generic_processor (boost::shared_ptr<ARDOUR::Processor>);
 
+       void update_gui_object_state (ProcessorEntry *);
+       
        sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorSelected;
        sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorUnselected;
 
@@ -289,9 +309,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        Gtk::Menu * build_processor_menu ();
        void show_processor_menu (int);
        Gtk::Menu* build_possible_aux_menu();
-       Gtk::Menu* build_controls_menu (boost::shared_ptr<ARDOUR::Processor>);
-
-       void show_or_hide_all_controls (boost::weak_ptr<ARDOUR::Processor>, bool);
 
        void choose_aux (boost::weak_ptr<ARDOUR::Route>);
        void choose_send ();
@@ -328,8 +345,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        void delete_processors (const ProcSelection&);
        void paste_processors ();
        void paste_processors (boost::shared_ptr<ARDOUR::Processor> before);
-       void processors_up ();
-       void processors_down ();
 
        void delete_dragged_processors (const std::list<boost::shared_ptr<ARDOUR::Processor> >&);
        void clear_processors ();
@@ -345,11 +360,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        static Glib::RefPtr<Gtk::Action> paste_action;
        static Glib::RefPtr<Gtk::Action> rename_action;
        static Glib::RefPtr<Gtk::Action> edit_action;
-       static Glib::RefPtr<Gtk::Action> controls_action;
+       static Glib::RefPtr<Gtk::Action> edit_generic_action;
        void paste_processor_state (const XMLNodeList&, boost::shared_ptr<ARDOUR::Processor>);
 
-       void activate_processor (boost::shared_ptr<ARDOUR::Processor>);
-       void deactivate_processor (boost::shared_ptr<ARDOUR::Processor>);
        void hide_processor_editor (boost::shared_ptr<ARDOUR::Processor>);
        void rename_processor (boost::shared_ptr<ARDOUR::Processor>);
 
@@ -380,6 +393,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
        static void rb_deactivate_all ();
        static void rb_ab_plugins ();
        static void rb_edit ();
+       static void rb_edit_generic ();
 
        void route_property_changed (const PBD::PropertyChange&);
        std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
@@ -393,7 +407,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
 
        void mixer_strip_delivery_changed (boost::weak_ptr<ARDOUR::Delivery>);
 
-       void update_gui_object_state (ProcessorEntry *);
        XMLNode* entry_gui_object_state (ProcessorEntry *);
 };