summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-04-01 23:56:27 +0200
committerRobin Gareus <robin@gareus.org>2017-04-01 23:56:27 +0200
commit77e8c0c4df82314a9958469dfffedaa19cedaab3 (patch)
tree2c4f14e467f71391783763a5d385318a19a596e5
parent5ebe6fcde89d5f4696c3b0af156e2f2ba70c1489 (diff)
GUI options for rec-only metronome
-rw-r--r--gtk2_ardour/ardour_ui_options.cc7
-rw-r--r--gtk2_ardour/rc_option_editor.cc38
2 files changed, 36 insertions, 9 deletions
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 5205354881..f8dab139ad 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -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") {
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index d2bcf3ca57..674ec2c88a 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -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 */