Update GPL boilerplate and (C)
[ardour.git] / gtk2_ardour / monitor_section.h
index a61f5a2fa5b3373b56c680888a2ff2da0feb2098..e42063b38fc5d206b31ef0f151e2fd5c1ca8f0bc 100644 (file)
@@ -1,27 +1,33 @@
 /*
-    Copyright (C) 2010 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2010-2018 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2011 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2014-2015 Ben Loftis <ben@harrisonconsoles.com>
+ * Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __gtk2_ardour_monitor_section_h__
+#define __gtk2_ardour_monitor_section_h__
 
 #include <gtkmm/box.h>
-#include <gtkmm/table.h>
 #include <gtkmm/eventbox.h>
+#include <gtkmm/sizegroup.h>
+#include <gtkmm/table.h>
+#include <gtkmm/viewport.h>
 
-#include "gtkmm2ext/bindable_button.h"
 #include "gtkmm2ext/bindings.h"
 
 #include "widgets/ardour_button.h"
 #include "route_ui.h"
 #include "monitor_selector.h"
 
-#include "plugin_selector.h"
 #include "processor_box.h"
 #include "processor_selection.h"
 
-namespace Gtkmm2ext {
+namespace ArdourWidgets {
        class TearOff;
 }
 
+class PluginSelector;
+
 class MonitorSection : public RouteUI, public Gtk::EventBox
 {
 public:
-       MonitorSection (ARDOUR::Session*);
+       MonitorSection ();
        ~MonitorSection ();
 
        void set_session (ARDOUR::Session*);
 
-       Gtkmm2ext::TearOff& tearoff() const { return *_tearoff; }
+       ArdourWidgets::TearOff& tearoff() const { return *_tearoff; }
 
        std::string state_id() const;
 
-       PluginSelector* plugin_selector() { return _plugin_selector; }
+       PluginSelector* plugin_selector();
+
+       void use_others_actions ();
 
 private:
        Gtk::HBox hpacker;
        Gtk::VBox vpacker;
-       Gtkmm2ext::TearOff* _tearoff;
+       ArdourWidgets::TearOff* _tearoff;
 
        Gtk::HBox  channel_table_packer;
        Gtk::HBox  table_hpacker;
@@ -105,32 +114,10 @@ private:
        void map_state ();
 
        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;
-       static void register_actions ();
-
-       static void action_proxy0 (enum MonitorActions);
-       static void action_proxy1 (enum ChannelActions, uint32_t);
+       Glib::RefPtr<Gtk::ActionGroup> monitor_actions;
+       Glib::RefPtr<Gtk::ActionGroup> solo_actions;
+       void register_actions ();
 
        void cut_channel (uint32_t);
        void dim_channel (uint32_t);
@@ -178,12 +165,13 @@ private:
        void isolated_changed ();
 
        PBD::ScopedConnection config_connection;
-       PBD::ScopedConnectionList control_connections;
-       PBD::ScopedConnectionList output_changed_connections;
+       PBD::ScopedConnectionList connections;
+       PBD::ScopedConnectionList route_connections;
 
        bool _inhibit_solo_model_update;
 
        void assign_controllables ();
+       void unassign_controllables ();
 
        void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
 
@@ -192,19 +180,22 @@ private:
        void route_property_changed (const PBD::PropertyChange&) {}
 
        ProcessorBox* insert_box;
-       PluginSelector* _plugin_selector;
        ProcessorSelection _rr_selection;
        void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
        uint32_t count_processors ();
 
        void processors_changed (ARDOUR::RouteProcessorChange);
-       Glib::RefPtr<Gtk::Action> proctoggle;
+       Glib::RefPtr<Gtk::ToggleAction> proctoggle;
        bool _ui_initialized;
 
-       static Gtkmm2ext::ActionMap myactions;
-       static Gtkmm2ext::Bindings* bindings;
+       Gtkmm2ext::Bindings* bindings;
 
-       static void load_bindings ();
+       void load_bindings ();
        bool enter_handler (GdkEventCrossing*);
        bool leave_handler (GdkEventCrossing*);
+
+       void toggle_use_monitor_section ();
+       void drop_route ();
 };
+
+#endif /* __gtk2_ardour_monitor_section_h__ */