Remove internal edit mode and add "content" tool.
[ardour.git] / gtk2_ardour / plugin_ui.h
index fefa9996183b42fa71cd99564c61dcc527e32eae..14bfbe3ecadf99bc07e6be96cfb3ae604839a313 100644 (file)
@@ -47,6 +47,7 @@
 
 #include "ardour/types.h"
 #include "ardour/plugin.h"
+#include "ardour/variant.h"
 
 #include "automation_controller.h"
 #include "ardour_button.h"
@@ -134,6 +135,14 @@ class PlugUIBase : public virtual sigc::trackable, public PBD::ScopedConnectionL
        Gtk::Label latency_label;
        /** a button which, when clicked, opens the latency GUI */
        Gtk::Button latency_button;
+       /** a button which sets all controls' automation setting to Manual */
+       ArdourButton automation_manual_all_button;
+       /** a button which sets all controls' automation setting to Play */
+       ArdourButton automation_play_all_button;
+    /** a button which sets all controls' automation setting to Write */
+       ArdourButton automation_write_all_button;
+       /** a button which sets all controls' automation setting to Touch */
+       ArdourButton automation_touch_all_button;
        
        void set_latency_label ();
 
@@ -207,7 +216,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
                bool            max_unbound;
                bool packed;
 
-               MeterInfo (int /*i*/) {
+               MeterInfo () {
                        meter = 0;
                        packed = false;
                        min = 1.0e10;
@@ -225,15 +234,15 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
        /* FIXME: Unify with AutomationController */
        struct ControlUI : public Gtk::HBox {
 
-               uint32_t port_index;
-               boost::shared_ptr<ARDOUR::AutomationControl> control;
+               const Evoral::Parameter parameter() const { return param; }
 
-               Evoral::Parameter parameter() { return control->parameter(); }
+               Evoral::Parameter                            param;
+               boost::shared_ptr<ARDOUR::AutomationControl> control;
 
                /* input */
 
                Gtk::ComboBoxText*                      combo;
-               boost::shared_ptr<ARDOUR::Plugin::ScalePoints> scale_points;
+               boost::shared_ptr<ARDOUR::ScalePoints>  scale_points;
                Gtk::ToggleButton*                      button;
                boost::shared_ptr<AutomationController> controller;
                Gtkmm2ext::ClickBox*                    clickbox;
@@ -241,6 +250,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
                bool                                    update_pending;
                char                                    ignore_change;
                Gtk::Button                             automate_button;
+               Gtk::FileChooserButton*                 file_button;
 
                /* output */
 
@@ -251,33 +261,45 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
                Gtk::VBox*     vbox;
                MeterInfo*     meterinfo;
 
-               ControlUI ();
+               ControlUI (const Evoral::Parameter& param);
                ~ControlUI ();
        };
 
        std::vector<ControlUI*>   input_controls;
+       std::vector<ControlUI*>   input_controls_with_automation;
        std::vector<ControlUI*>   output_controls;
        sigc::connection screen_update_connection;
        void output_update();
 
        void build ();
-       ControlUI* build_control_ui (guint32 port_index, boost::shared_ptr<ARDOUR::AutomationControl>);
+       ControlUI* build_control_ui (const Evoral::Parameter&                     param,
+                                    const ARDOUR::ParameterDescriptor&           desc,
+                                    boost::shared_ptr<ARDOUR::AutomationControl> mcontrol,
+                                    float                                        value,
+                                    bool                                         is_input);
+
        void ui_parameter_changed (ControlUI* cui);
        void toggle_parameter_changed (ControlUI* cui);
        void update_control_display (ControlUI* cui);
        void control_port_toggled (ControlUI* cui);
        void control_combo_changed (ControlUI* cui);
 
-       void astate_clicked (ControlUI*, uint32_t parameter);
+       void astate_clicked (ControlUI*);
        void automation_state_changed (ControlUI*);
        void set_automation_state (ARDOUR::AutoState state, ControlUI* cui);
-       void start_touch (ControlUI*);
-       void stop_touch (ControlUI*);
+       void set_all_automation (ARDOUR::AutoState state);
 
        /* XXX: remove */
        void print_parameter (char *buf, uint32_t len, uint32_t param);
        bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
        bool midinote_printer(char* buf, Gtk::Adjustment &, ControlUI *);
+
+       void set_property (const ARDOUR::ParameterDescriptor& desc,
+                          Gtk::FileChooserButton*            widget);
+       void property_changed (uint32_t key, const ARDOUR::Variant& value);
+
+       typedef std::map<uint32_t, Gtk::FileChooserButton*> PropertyControls;
+       PropertyControls _property_controls;
 };
 
 class PluginUIWindow : public ArdourWindow