GUI options for rec-only metronome
authorRobin Gareus <robin@gareus.org>
Sat, 1 Apr 2017 21:56:27 +0000 (23:56 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 1 Apr 2017 21:56:27 +0000 (23:56 +0200)
gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/rc_option_editor.cc

index 5205354881110c9da9951fbbe5c2a269a83f0c89..f8dab139adab2ed1addfc0d1e048b1e9779bb5e8 100644 (file)
@@ -426,6 +426,13 @@ ARDOUR_UI::parameter_changed (std::string p)
                }
        } else if (p == "clicking") {
                ActionManager::map_some_state ("Transport", "ToggleClick", &RCConfiguration::get_clicking);
+       } else if (p == "click-record-only") {
+               // TODO set a flag, blink or gray-out metronome button while rolling, only
+               if (Config->get_click_record_only()) {
+                       click_button.set_name ("generic button"); // XXX
+               } else {
+                       click_button.set_name ("transport button");
+               }
        } else if (p == "use-video-sync") {
                ActionManager::map_some_state ("Transport",  "ToggleVideoSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_use_video_sync));
        } else if (p == "sync-source") {
index d2bcf3ca57540170330e1890375d00b3a37ea7d9..674ec2c88ab0fd59a5e3e3d4e08f2955140e86ec 100644 (file)
@@ -86,32 +86,38 @@ public:
        {
                // TODO get rid of GTK -> use OptionEditor Widgets
                Table* t = &table;
+               Label* l;
+               int row = 0;
 
-               Label* l = manage (left_aligned_label (_("Emphasis on first beat")));
+               l = manage (left_aligned_label (_("Emphasis on first beat")));
                _use_emphasis_on_click_check_button.add (*l);
-               t->attach (_use_emphasis_on_click_check_button, 1, 3, 0, 1, FILL);
+               t->attach (_use_emphasis_on_click_check_button, 1, 3, row, row + 1, FILL);
                _use_emphasis_on_click_check_button.signal_toggled().connect (
                    sigc::mem_fun (*this, &ClickOptions::use_emphasis_on_click_toggled));
+               ++row;
 
                l = manage (left_aligned_label (_("Use built-in default sounds")));
                _use_default_click_check_button.add (*l);
-               t->attach (_use_default_click_check_button, 1, 3, 1, 2, FILL);
+               t->attach (_use_default_click_check_button, 1, 3, row, row + 1, FILL);
                _use_default_click_check_button.signal_toggled().connect (
                    sigc::mem_fun (*this, &ClickOptions::use_default_click_toggled));
+               ++row;
 
                l = manage (left_aligned_label (_("Audio file:")));
-               t->attach (*l, 1, 2, 2, 3, FILL);
-               t->attach (_click_path_entry, 2, 3, 2, 3, FILL);
+               t->attach (*l, 1, 2, row, row + 1, FILL);
+               t->attach (_click_path_entry, 2, 3, row, row + 1, FILL);
                _click_browse_button.signal_clicked ().connect (
                    sigc::mem_fun (*this, &ClickOptions::click_browse_clicked));
-               t->attach (_click_browse_button, 3, 4, 2, 3, FILL);
+               t->attach (_click_browse_button, 3, 4, row, row + 1, FILL);
+               ++row;
 
                l = manage (left_aligned_label (_("Emphasis audio file:")));
-               t->attach (*l, 1, 2, 3, 4, FILL);
-               t->attach (_click_emphasis_path_entry, 2, 3, 3, 4, FILL);
+               t->attach (*l, 1, 2, row, row + 1, FILL);
+               t->attach (_click_emphasis_path_entry, 2, 3, row, row + 1, FILL);
                _click_emphasis_browse_button.signal_clicked ().connect (
                    sigc::mem_fun (*this, &ClickOptions::click_emphasis_browse_clicked));
-               t->attach (_click_emphasis_browse_button, 3, 4, 3, 4, FILL);
+               t->attach (_click_emphasis_browse_button, 3, 4, row, row + 1, FILL);
+               ++row;
 
                _click_fader = new FaderOption (
                                "click-gain",
@@ -2812,6 +2818,20 @@ RCOptionEditor::RCOptionEditor ()
 
        add_option (_("Metronome"), new OptionEditorHeading (_("Metronome")));
        add_option (_("Metronome"), new ClickOptions (_rc_config));
+       add_option (_("Metronome"), new OptionEditorHeading (_("Options")));
+
+       bo = new BoolOption (
+                       "click-record-only",
+                       _("Enable metronome only while recording"),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::get_click_record_only),
+                       sigc::mem_fun (*_rc_config, &RCConfiguration::set_click_record_only)
+                       );
+
+       Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget(),
+                       string_compose (_("<b>When enabled</b> the metronome will remain silent if %1 is <b>not recording</b>."), PROGRAM_NAME));
+       add_option (_("Metronome"), bo);
+       add_option (_("Metronome"), new OptionEditorBlank ());
+
 
        /* Meters */