replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / gtk2_ardour / mixer_ui.h
index 7dad3559430ed57611aae4f6247f11c42adb5f22..1dd4b8de92cdb61954d1ddf84e91723e6da015b3 100644 (file)
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/eventbox.h>
 #include <gtkmm/label.h>
+#include <gtkmm/comboboxtext.h>
 #include <gtkmm/button.h>
 #include <gtkmm/frame.h>
 #include <gtkmm/menu.h>
 #include <gtkmm/treeview.h>
+#include <gtkmm/treestore.h>
 #include <gtkmm/liststore.h>
 
 #include "pbd/stateful.h"
 
 #include <gtkmm2ext/bindings.h>
 #include "gtkmm2ext/dndtreeview.h"
-#include <gtkmm2ext/pane.h>
-#include "gtkmm2ext/tabbable.h"
 #include "gtkmm2ext/treeutils.h"
 
+#include "widgets/pane.h"
+#include "widgets/tabbable.h"
+
 #include "axis_provider.h"
 #include "enums.h"
+#include "monitor_section.h"
 #include "route_processor_selection.h"
 
 namespace ARDOUR {
@@ -77,9 +81,9 @@ protected:
        virtual bool row_drop_possible_vfunc (const Gtk::TreeModel::Path&, const Gtk::SelectionData&) const;
 };
 
-class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider
+class Mixer_UI : public ArdourWidgets::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider
 {
-  public:
+public:
        static Mixer_UI* instance();
        ~Mixer_UI();
 
@@ -96,8 +100,7 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        XMLNode& get_state ();
        int set_state (const XMLNode&, int /* version */);
 
-       void show_mixer_list (bool yn);
-       void show_monitor_section (bool);
+       void save_plugin_order_file ();
 
        void show_strip (MixerStrip *);
        void hide_strip (MixerStrip *);
@@ -105,12 +108,15 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        void maximise_mixer_space();
        void restore_mixer_space();
 
-       MonitorSection* monitor_section() const { return _monitor_section; }
+       MonitorSection& monitor_section() { return _monitor_section; }
 
        void deselect_all_strip_processors();
        void delete_processors();
        void select_none ();
 
+       void select_next_strip ();
+       void select_prev_strip ();
+
        void do_vca_assign (boost::shared_ptr<ARDOUR::VCA>);
        void do_vca_unassign (boost::shared_ptr<ARDOUR::VCA>);
        void show_spill (boost::shared_ptr<ARDOUR::Stripable>);
@@ -127,10 +133,25 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        void load_bindings ();
        Gtkmm2ext::Bindings*  bindings;
 
-  protected:
+       void toggle_mixer_list ();
+       void showhide_mixer_list (bool yn);
+
+       void toggle_monitor_section ();
+       void showhide_monitor_section (bool);
+
+       void toggle_vcas ();
+       void showhide_vcas (bool on);
+       
+#ifdef MIXBUS
+       void toggle_mixbuses ();
+       void showhide_mixbusses (bool on);
+#endif
+
+protected:
        void set_axis_targets_for_operation ();
+       ARDOUR::AutomationControlSet selected_gaincontrols ();
 
-  private:
+private:
        Mixer_UI ();
        static Mixer_UI*     _instance;
        Gtk::VBox            _content;
@@ -142,7 +163,6 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        Gtk::VBox             mixer_scroller_vpacker;
        Gtk::VBox             list_vpacker;
        Gtk::Label            group_display_button_label;
-       Gtk::Button           group_display_button;
        Gtk::ScrolledWindow   track_display_scroller;
        Gtk::ScrolledWindow   group_display_scroller;
        Gtk::ScrolledWindow   favorite_plugins_scroller;
@@ -150,9 +170,11 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        Gtk::Frame            track_display_frame;
        Gtk::Frame            group_display_frame;
        Gtk::Frame            favorite_plugins_frame;
-       Gtkmm2ext::VPane      rhs_pane1;
-       Gtkmm2ext::VPane      rhs_pane2;
-       Gtkmm2ext::HPane      inner_pane;
+       Gtk::VBox             favorite_plugins_vbox;
+       Gtk::ComboBoxText     favorite_plugins_tag_combo;
+       ArdourWidgets::VPane  rhs_pane1;
+       ArdourWidgets::VPane  rhs_pane2;
+       ArdourWidgets::HPane  inner_pane;
        Gtk::HBox             strip_packer;
        Gtk::ScrolledWindow   vca_scroller;
        Gtk::HBox             vca_hpacker;
@@ -161,7 +183,9 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        Gtk::Label            vca_label;
        Gtk::EventBox         vca_scroller_base;
        Gtk::HBox             out_packer;
-       Gtkmm2ext::HPane      list_hpane;
+       ArdourWidgets::HPane  list_hpane;
+       Gtk::Button           add_button; // should really be an ArdourButton
+       Gtk::Button           add_vca_button;
 
        MixerGroupTabs* _group_tabs;
 
@@ -264,8 +288,8 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        void track_column_click (gint);
        void build_track_menu ();
 
-       MonitorSection* _monitor_section;
-       PluginSelector    *_plugin_selector;
+       MonitorSection   _monitor_section;
+       PluginSelector *_plugin_selector;
 
        void stripable_property_changed (const PBD::PropertyChange& what_changed, boost::weak_ptr<ARDOUR::Stripable> ws);
        void route_group_property_changed (ARDOUR::RouteGroup *, const PBD::PropertyChange &);
@@ -324,8 +348,10 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        void group_display_selection_changed ();
 
        bool strip_button_release_event (GdkEventButton*, MixerStrip*);
+       bool vca_button_release_event (GdkEventButton*, VCAMasterStrip*);
 
        Width _strip_width;
+       double _spill_scroll_position;
 
        void presentation_info_changed (PBD::PropertyChange const &);
        void sync_treeview_from_presentation_info (PBD::PropertyChange const &);
@@ -343,8 +369,8 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        static const int32_t default_height = 765;
 
        /** true if we are rebuilding the route group list, or clearing
-           it during a session teardown.
-       */
+        * it during a session teardown.
+        */
        bool _in_group_rebuild_or_clear;
        bool _route_deletion_in_progress;
 
@@ -354,13 +380,19 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        friend class MixerGroupTabs;
 
        void monitor_section_going_away ();
-
        void monitor_section_attached ();
        void monitor_section_detached ();
 
        void store_current_favorite_order();
        void refiller (ARDOUR::PluginInfoList& result, const ARDOUR::PluginInfoList& plugs);
+
+       void plugin_list_changed ();
+
        void refill_favorite_plugins ();
+       void refill_tag_combo ();
+
+       void tag_combo_changed ();
+
        void sync_treeview_from_favorite_order ();
        void sync_treeview_favorite_ui_state (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&);
        void save_favorite_ui_state (const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path);
@@ -368,14 +400,12 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
        /// true if we are in fullscreen mode
        bool _maximised;
 
-       // true if mixer list is visible
-       bool _show_mixer_list;
+       bool _strip_selection_change_without_scroll;
 
        mutable boost::weak_ptr<ARDOUR::Stripable> spilled_strip;
 
        void escape ();
 
-       Gtkmm2ext::ActionMap myactions;
        RouteProcessorSelection _selection;
        AxisViewSelection _axis_targets;