Configurable toolbar rec/punch & monitoring buttons
authorRobin Gareus <robin@gareus.org>
Mon, 16 Jan 2017 20:58:53 +0000 (21:58 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 16 Jan 2017 20:58:53 +0000 (21:58 +0100)
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/ui_config_vars.h

index c5321574ea41619c2c3be62996831461624136fe..c375bf89e29125af885dc836a2b9cfc18edfa864 100644 (file)
@@ -73,6 +73,7 @@
 #include "add_route_dialog.h"
 #include "ardour_button.h"
 #include "ardour_dialog.h"
+#include "ardour_spacer.h"
 #include "ardour_window.h"
 #include "editing.h"
 #include "enums.h"
@@ -529,6 +530,9 @@ private:
        ArdourButton punch_out_button;
        ArdourButton layered_button;
 
+       ArdourVSpacer recpunch_spacer;
+       ArdourVSpacer monitoring_spacer;
+
        ArdourButton monitor_in_button;
        ArdourButton monitor_disk_button;
        ArdourButton auto_input_button;
@@ -536,6 +540,9 @@ private:
        Gtk::Label   punch_label;
        Gtk::Label   layered_label;
 
+       Gtk::Label   punch_space;
+       Gtk::Label   mon_space;
+
        void toggle_external_sync ();
        void toggle_time_master ();
        void toggle_video_sync ();
index ce3940e762cf7cd68b9ee0ed5a604c9387dd1e36..8dde2b730471a9f1ba326add02ba14bc6c8d3aac 100644 (file)
@@ -44,7 +44,6 @@
 #include "ardour/session.h"
 #include "ardour/types.h"
 
-#include "ardour_spacer.h"
 #include "ardour_ui.h"
 #include "keyboard.h"
 #include "public_editor.h"
@@ -211,6 +210,37 @@ ARDOUR_UI::repack_transport_hbox ()
                        editor_meter_peak_display.show();
                }
        }
+
+       bool show_mon = UIConfiguration::instance().get_show_toolbar_monitoring ();
+       if (show_mon) {
+               monitor_in_button.show ();
+               monitor_disk_button.show ();
+               auto_input_button.show ();
+               monitoring_spacer.show ();
+       } else {
+               monitor_in_button.hide ();
+               monitor_disk_button.hide ();
+               auto_input_button.hide ();
+               monitoring_spacer.hide ();
+       }
+
+       bool show_rec = UIConfiguration::instance().get_show_toolbar_recpunch ();
+       if (show_rec) {
+               punch_label.show ();
+               layered_label.show ();
+               punch_in_button.show ();
+               punch_out_button.show ();
+               layered_button.show ();
+               recpunch_spacer.show ();
+       } else {
+               punch_label.hide ();
+               layered_label.hide ();
+               punch_in_button.hide ();
+               punch_out_button.hide ();
+               layered_button.hide ();
+               recpunch_spacer.hide ();
+       }
+
 }
 
 void
@@ -568,21 +598,21 @@ ARDOUR_UI::setup_transport ()
        ++col;
 
        transport_table.attach (punch_in_button,  col,      col + 1, 0, 1 , FILL, SHRINK, 0, 2);
-       transport_table.attach (*(manage (new Label (""))), col + 1, col + 2, 0, 1 , FILL, SHRINK, 2, 2);
+       transport_table.attach (punch_space,      col + 1,  col + 2, 0, 1 , FILL, SHRINK, 2, 2);
        transport_table.attach (punch_out_button, col + 2,  col + 3, 0, 1 , FILL, SHRINK, 0, 2);
        transport_table.attach (layered_button,   col,      col + 3, 1, 2 , FILL, SHRINK, 0, 2);
        col += 3;
 
-       transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
+       transport_table.attach (recpunch_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
        ++col;
 
-       transport_table.attach (monitor_in_button,  col,      col + 1, 0, 1 , FILL, SHRINK, 0, 2);
-       transport_table.attach (*(manage (new Label (""))),   col + 1, col + 2, 0, 1 , FILL, SHRINK, 2, 2);
+       transport_table.attach (monitor_in_button,   col,     col + 1, 0, 1 , FILL, SHRINK, 0, 2);
+       transport_table.attach (mon_space,           col + 1, col + 2, 0, 1 , FILL, SHRINK, 2, 2);
        transport_table.attach (monitor_disk_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, 0, 2);
-       transport_table.attach (auto_input_button,  col,      col + 3, 1, 2 , FILL, SHRINK, 0, 2);
+       transport_table.attach (auto_input_button,   col,     col + 3, 1, 2 , FILL, SHRINK, 0, 2);
        col += 3;
 
-       transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
+       transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
        ++col;
 
        transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, 2, 0);
index a596ef548da1aeee5a92b859c987bf49485aac83..0c31bf4de1e9d1dbb31105e66b0b6e0032e34b9e 100644 (file)
@@ -477,6 +477,10 @@ ARDOUR_UI::parameter_changed (std::string p)
                ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
        } else if (p == "show-mini-timeline") {
                repack_transport_hbox ();
+       } else if (p == "show-toolbar-recpunch") {
+               repack_transport_hbox ();
+       } else if (p == "show-toolbar-monitoring") {
+               repack_transport_hbox ();
        } else if (p == "show-toolbar-selclock") {
                repack_transport_hbox ();
        } else if (p == "show-editor-meter") {
index 7d5683da587ad4985916064bd00b721b0895814a..316592dc129cb96e6b1d08abab74a69acd0bab14 100644 (file)
@@ -3682,6 +3682,22 @@ RCOptionEditor::RCOptionEditor ()
 
        add_option (_("Appearance/Toolbar"), new OptionEditorHeading (_("Main Transport Toolbar Items")));
 
+       add_option (_("Appearance/Toolbar"),
+            new BoolOption (
+                    "show-toolbar-recpunch",
+                    _("Display Record/Punch Options"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_toolbar_recpunch),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_recpunch)
+                    ));
+
+       add_option (_("Appearance/Toolbar"),
+            new BoolOption (
+                    "show-toolbar-monitoring",
+                    _("Display Monitor Options"),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_show_toolbar_monitoring),
+                    sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_show_toolbar_monitoring)
+                    ));
+
        add_option (_("Appearance/Toolbar"),
             new BoolOption (
                     "show-toolbar-selclock",
index 680e3e1627319822f7d1d155cdb578bb696c62cd..d72bea387459f56c90d314c4e553d6668ac9683c 100644 (file)
@@ -73,6 +73,8 @@ UI_CONFIG_VARIABLE (ARDOUR::LocaleMode, locale_mode, "locale-mode", ARDOUR::SET_
 UI_CONFIG_VARIABLE (float, meter_peak, "meter-peak", 0.0f)
 UI_CONFIG_VARIABLE (bool, meter_style_led, "meter-style-led", false)
 UI_CONFIG_VARIABLE (bool, show_editor_meter, "show-editor-meter", true)
+UI_CONFIG_VARIABLE (bool, show_toolbar_recpunch, "show-toolbar-recpunch", true)
+UI_CONFIG_VARIABLE (bool, show_toolbar_monitoring, "show-toolbar-monitoring", false)
 UI_CONFIG_VARIABLE (bool, show_toolbar_selclock, "show-toolbar-selclock", false)
 UI_CONFIG_VARIABLE (bool, show_mini_timeline, "show-mini-timeline", true)
 UI_CONFIG_VARIABLE (bool, show_secondary_clock, "show-secondary-clock", true)