X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fprocessor_box.h;h=d300f70d5adbd70f90eb63a2482bd7b214608882;hb=04416e2d1df3cc8d9f014765e5ca5ce818b7b4d7;hp=3caa2925c95ac7a884b6b164e471368481b13d18;hpb=cc5e8d41da336535d04169550d09cfe02e9cb065;p=ardour.git diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 3caa2925c9..d300f70d5a 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -34,6 +34,7 @@ #include "gtkmm2ext/click_box.h" #include "gtkmm2ext/dndvbox.h" #include "gtkmm2ext/pixfader.h" +#include "gtkmm2ext/persistent_tooltip.h" #include "pbd/stateful.h" #include "pbd/signals.h" @@ -69,7 +70,6 @@ namespace ARDOUR { class PluginInsert; class PortInsert; class Route; - class Send; class Session; } @@ -102,7 +102,8 @@ private: class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable { public: - ProcessorEntry (boost::shared_ptr, Width); + ProcessorEntry (ProcessorBox *, boost::shared_ptr, Width); + ~ProcessorEntry (); Gtk::EventBox& action_widget (); Gtk::Widget& widget (); @@ -118,10 +119,19 @@ public: void set_position (Position); boost::shared_ptr processor () const; void set_enum_width (Width); - virtual void set_pixel_width (int) {} + virtual void set_pixel_width (int); /** Hide any widgets that should be hidden */ - virtual void hide_things () {} + virtual void hide_things (); + + void show_all_controls (); + void hide_all_controls (); + 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 (); protected: ArdourButton _button; @@ -130,6 +140,9 @@ protected: virtual void setup_visuals (); + static Glib::RefPtr _slider_pixbuf; + static Glib::RefPtr _slider_pixbuf_desensitised; + private: void led_clicked(); void processor_active_changed (); @@ -137,48 +150,70 @@ private: std::string name (Width) const; void setup_tooltip (); + ProcessorBox* _parent; boost::shared_ptr _processor; Width _width; Gtk::StateType _visual_state; PBD::ScopedConnection active_connection; PBD::ScopedConnection name_connection; -}; -class BlankProcessorEntry : public ProcessorEntry -{ - public: - BlankProcessorEntry (Width w); -}; + class Control : public sigc::trackable { + public: + Control (Glib::RefPtr, Glib::RefPtr, boost::shared_ptr, std::string const &); -class SendProcessorEntry : public ProcessorEntry -{ -public: - SendProcessorEntry (boost::shared_ptr, Width); + void set_pixel_width (int); + void set_visible (bool); + void add_state (XMLNode *) const; + void set_state (XMLNode const *); + void hide_things (); + void hide_label (); - static void setup_slider_pix (); + bool visible () const { + return _visible; + } - void set_enum_width (Width, int); - void set_pixel_width (int); + std::string name () const { + return _name; + } + + Gtk::VBox box; -private: - void show_gain (); - void gain_adjusted (); - void setup_gain_adjustment (); - - boost::shared_ptr _send; - Gtk::Adjustment _adjustment; - Gtkmm2ext::HSliderController _fader; - bool _ignore_gain_change; - PBD::ScopedConnectionList _send_connections; - ARDOUR::DataType _data_type; - - static Glib::RefPtr _slider; + private: + void slider_adjusted (); + void button_clicked (); + void control_changed (); + std::string state_id () const; + void set_tooltip (); + + boost::weak_ptr _control; + /* things for a slider */ + Gtk::Adjustment _adjustment; + Gtkmm2ext::HSliderController _slider; + Gtk::Label _label; + Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip; + /* things for a button */ + ArdourButton _button; + bool _ignore_ui_adjustment; + PBD::ScopedConnection _connection; + bool _visible; + std::string _name; + }; + + std::list _controls; + + void toggle_control_visibility (Control *); +}; + +class BlankProcessorEntry : public ProcessorEntry +{ + public: + BlankProcessorEntry (ProcessorBox *, Width w); }; class PluginInsertProcessorEntry : public ProcessorEntry { public: - PluginInsertProcessorEntry (boost::shared_ptr, Width); + PluginInsertProcessorEntry (ProcessorBox *, boost::shared_ptr, Width); void hide_things (); @@ -217,8 +252,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void set_route (boost::shared_ptr); void set_width (Width); - void update(); - void processor_operation (ProcessorOperation); void select_all_processors (); @@ -231,8 +264,10 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD Gtk::Window* get_processor_ui (boost::shared_ptr) const; void toggle_edit_processor (boost::shared_ptr); - void toggle_processor_controls (boost::shared_ptr); + void toggle_edit_generic_processor (boost::shared_ptr); + void update_gui_object_state (ProcessorEntry *); + sigc::signal > ProcessorSelected; sigc::signal > ProcessorUnselected; @@ -312,8 +347,6 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void delete_processors (const ProcSelection&); void paste_processors (); void paste_processors (boost::shared_ptr before); - void processors_up (); - void processors_down (); void delete_dragged_processors (const std::list >&); void clear_processors (); @@ -329,11 +362,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD static Glib::RefPtr paste_action; static Glib::RefPtr rename_action; static Glib::RefPtr edit_action; - static Glib::RefPtr controls_action; + static Glib::RefPtr edit_generic_action; void paste_processor_state (const XMLNodeList&, boost::shared_ptr); - void activate_processor (boost::shared_ptr); - void deactivate_processor (boost::shared_ptr); void hide_processor_editor (boost::shared_ptr); void rename_processor (boost::shared_ptr); @@ -364,7 +395,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_controls (); + static void rb_edit_generic (); void route_property_changed (const PBD::PropertyChange&); std::string generate_processor_title (boost::shared_ptr pi); @@ -377,6 +408,8 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD bool processor_can_be_edited (boost::shared_ptr); void mixer_strip_delivery_changed (boost::weak_ptr); + + XMLNode* entry_gui_object_state (ProcessorEntry *); }; #endif /* __ardour_gtk_processor_box__ */