Add option to display the mixer in fullscreen
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Fri, 21 Mar 2014 12:45:00 +0000 (13:45 +0100)
committerAdrian Knoth <adi@drcomp.erfurt.thur.de>
Fri, 21 Mar 2014 15:08:53 +0000 (16:08 +0100)
This is useful for dual-head setups.

gtk2_ardour/ardour.menus.in
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/mixer_ui.cc
gtk2_ardour/mixer_ui.h

index b6328963bb1437dce2594d897a03b1172303fb7e..6c5e08c8f8dc02c3dd2e19ae05885bb71285a325 100644 (file)
 
     <menu name='View' action = 'View'>
       <menuitem action='ToggleMaximalEditor'/>
+      <menuitem action='ToggleMaximalMixer'/>
       <menuitem action='KeepTearoffs'/>
 
       <separator/>
index 130fc69581918e77cb90232dee32cc4db58249b2..1f90a4cbb679ebaea89c4a09fe950902ba3756f4 100644 (file)
@@ -171,6 +171,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
 
        void new_midi_tracer_window ();
        void toggle_editing_space();
+       void toggle_mixer_space();
        void toggle_keep_tearoffs();
 
        Gtk::Tooltips& tooltips() { return _tooltips; }
index b0ac528b794ace1d5f5b0b9290f85ffbf2443742..6f55f7cc44efe0cade19c7aeb0185bf3ba7ee6ca 100644 (file)
@@ -565,3 +565,18 @@ ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
        }
        return true;
 }
+
+void
+ARDOUR_UI::toggle_mixer_space()
+{
+       Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
+
+       if (act) {
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+               if (tact->get_active()) {
+                       mixer->maximise_mixer_space ();
+               } else {
+                       mixer->restore_mixer_space ();
+               }
+       }
+}
index 0ed7a95df37bb99937e5b37f8d46c7c64f4eccb9..454c657e6e90479f86c7342cc210136e14b7818c 100644 (file)
@@ -191,6 +191,7 @@ ARDOUR_UI::install_actions ()
        /* windows visibility actions */
 
        ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space));
+       ActionManager::register_toggle_action (common_actions, X_("ToggleMaximalMixer"), _("Maximise Mixer Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_space));
        act = ActionManager::register_toggle_action (common_actions, X_("KeepTearoffs"), _("Show Toolbars"), mem_fun (*this, &ARDOUR_UI::toggle_keep_tearoffs));
        ActionManager::session_sensitive_actions.push_back (act);
 
index 12cf87d7931a7f31341b7ea8296bf895e3e74b2f..874f8feddf7ac119cb6bb3c85701cda842b24790 100644 (file)
@@ -240,6 +240,7 @@ Mixer_UI::Mixer_UI ()
        group_display.show();
 
        _in_group_rebuild_or_clear = false;
+       _maximised = false;
 
        MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
 
@@ -1559,6 +1560,19 @@ Mixer_UI::set_state (const XMLNode& node)
                }
        }
 
+       if ((prop = node.property ("maximised"))) {
+               bool yn = string_is_affirmative (prop->value());
+               Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMaximalMixer"));
+               assert (act);
+               Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
+               bool fs = tact && tact->get_active();
+               if (yn ^ fs) {
+                       ActionManager::do_action ("Common",
+                                       "ToggleMaximalMixer");
+               }
+       }
+
+
        return 0;
 }
 
@@ -1601,6 +1615,8 @@ Mixer_UI::get_state (void)
 
        node->add_property ("show-mixer", _visible ? "yes" : "no");
 
+       node->add_property ("maximised", _maximised ? "yes" : "no");
+
        return *node;
 }
 
@@ -1942,3 +1958,26 @@ Mixer_UI::toggle_midi_input_active (bool flip_others)
        _session->set_exclusive_input_active (rl, onoff, flip_others);
 }
 
+void
+Mixer_UI::maximise_mixer_space ()
+{
+       if (_maximised) {
+               return;
+       }
+
+       fullscreen ();
+
+       _maximised = true;
+}
+
+void
+Mixer_UI::restore_mixer_space ()
+{
+       if (!_maximised) {
+               return;
+       }
+
+       unfullscreen();
+
+       _maximised = false;
+}
index db841535b7c10ecd77c741597ccf6d48ff0bf22b..693fd9dfa557b7848e0bc95899bf288d5723fbbf 100644 (file)
@@ -80,6 +80,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
        void show_strip (MixerStrip *);
        void hide_strip (MixerStrip *);
 
+       void maximise_mixer_space();
+       void restore_mixer_space();
+
        void ensure_float (Gtk::Window&);
 
         MonitorSection* monitor_section() const { return _monitor_section; }
@@ -279,6 +282,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
        bool _following_editor_selection;
 
        void monitor_section_going_away ();
+
+       /// true if we are in fullscreen mode
+       bool _maximised;
 };
 
 #endif /* __ardour_mixer_ui_h__ */