PBD::Signal<...>::connect() is already thread safe, so drop intermediate proxy/call_s...
[ardour.git] / gtk2_ardour / monitor_section.h
index 2db5d54c1d5aefa2433812c5980e4ebcc983e87a..b58203f52164148859183564d5ef8947be9ea443 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <gtkmm/box.h>
 #include <gtkmm/table.h>
+#include <gtkmm/eventbox.h>
 
 #include "gtkmm2ext/bindable_button.h"
 #include "gtkmm2ext/bindings.h"
@@ -26,7 +27,6 @@
 #include "ardour_button.h"
 #include "ardour_knob.h"
 #include "ardour_display.h"
-#include "axis_view.h"
 #include "level_meter.h"
 #include "route_ui.h"
 #include "monitor_selector.h"
@@ -39,7 +39,7 @@ namespace Gtkmm2ext {
        class TearOff;
 }
 
-class MonitorSection : public RouteUI
+class MonitorSection : public RouteUI, public Gtk::EventBox
 {
   public:
        MonitorSection (ARDOUR::Session*);
@@ -61,8 +61,8 @@ class MonitorSection : public RouteUI
        Gtk::HBox  channel_table_packer;
        Gtk::HBox  table_hpacker;
        Gtk::HBox  master_packer;
-       Gtk::Table channel_table;
        Gtk::Table channel_table_header;
+       Gtk::Table *channel_table;
        Gtk::ScrolledWindow channel_table_scroller;
        Gtk::Viewport channel_table_viewport;
        Glib::RefPtr<Gtk::SizeGroup> channel_size_group;
@@ -106,9 +106,30 @@ class MonitorSection : public RouteUI
        boost::shared_ptr<ARDOUR::MonitorProcessor> _monitor;
        boost::shared_ptr<ARDOUR::Route> _route;
 
+       enum MonitorActions {
+               MonitorMono,
+               MonitorCutAll,
+               MonitorDimAll,
+               ToggleExclusiveSolo,
+               ToggleMuteOverridesSolo,
+               SoloUseInPlace,
+               SoloUseAFL,
+               SoloUsePFL,
+               ToggleMonitorProcessorBox
+       };
+
+       enum ChannelActions {
+               CutChannel,
+               DimChannel,
+               SoloChannel,
+               InvertChannel
+       };
+
        static Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
-       void register_actions ();
-       void connect_actions ();
+       static void register_actions ();
+
+       static void action_proxy0 (enum MonitorActions);
+       static void action_proxy1 (enum ChannelActions, uint32_t);
 
        void cut_channel (uint32_t);
        void dim_channel (uint32_t);
@@ -157,7 +178,7 @@ class MonitorSection : public RouteUI
 
        PBD::ScopedConnection config_connection;
        PBD::ScopedConnectionList control_connections;
-       PBD::ScopedConnection _output_changed_connection;
+       PBD::ScopedConnectionList output_changed_connections;
 
        bool _inhibit_solo_model_update;
 
@@ -167,6 +188,8 @@ class MonitorSection : public RouteUI
 
        void update_processor_box ();
 
+       void route_property_changed (const PBD::PropertyChange&) {}
+
        ProcessorBox* insert_box;
        PluginSelector* _plugin_selector;
        RouteProcessorSelection _rr_selection;
@@ -174,12 +197,13 @@ class MonitorSection : public RouteUI
        uint32_t count_processors ();
 
        void processors_changed (ARDOUR::RouteProcessorChange);
-       Glib::RefPtr<Gtk::ToggleAction> proctoggle;
+       Glib::RefPtr<Gtk::Action> proctoggle;
        bool _ui_initialized;
 
-  private:
-       Gtkmm2ext::ActionMap myactions;
-       Gtkmm2ext::Bindings* bindings;
+       static Gtkmm2ext::ActionMap myactions;
+       static Gtkmm2ext::Bindings* bindings;
 
-       void load_bindings ();
+       static void load_bindings ();
+       bool enter_handler (GdkEventCrossing*);
+       bool leave_handler (GdkEventCrossing*);
 };