diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-21 02:33:38 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-21 02:33:38 +0000 |
commit | 24a29f61d9554d4924521d0967037cacd47545ca (patch) | |
tree | f34fad7f0e3962cead5bfa6780fdfde55fdea7a9 /gtk2_ardour | |
parent | a9adbd9404257f5eefac27c579f6c3b890b81969 (diff) |
provide config parameter to allow non-quarter note pulses; off by default; no GUI to reset it at this point
git-svn-id: svn://localhost/ardour2/branches/3.0@11046 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/tempo_dialog.cc | 34 |
2 files changed, 30 insertions, 10 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 563d28d5ac..5f9293d4e2 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -88,7 +88,11 @@ Editor::draw_metric_marks (const Metrics& metrics) metric_marks.push_back (new MeterMarker (*this, *meter_group, ARDOUR_UI::config()->canvasvar_MeterMarker.get(), buf, *(const_cast<MeterSection*>(ms)))); } else if ((ts = dynamic_cast<const TempoSection*>(*i)) != 0) { - snprintf (buf, sizeof (buf), "%.2f/%.0f", ts->beats_per_minute(), ts->note_type()); + if (Config->get_allow_non_quarter_pulse()) { + snprintf (buf, sizeof (buf), "%.2f/%.0f", ts->beats_per_minute(), ts->note_type()); + } else { + snprintf (buf, sizeof (buf), "%.2f", ts->beats_per_minute()); + } metric_marks.push_back (new TempoMarker (*this, *tempo_group, ARDOUR_UI::config()->canvasvar_TempoMarker.get(), buf, *(const_cast<TempoSection*>(ts)))); } diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index a5717c5110..0edc098c86 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -20,7 +20,10 @@ #include <cstdio> // for snprintf, grrr #include <gtkmm/stock.h> -#include <gtkmm2ext/utils.h> + +#include "gtkmm2ext/utils.h" + +#include "ardour/rc_configuration.h" #include "tempo_dialog.h" #include "utils.h" @@ -100,16 +103,29 @@ TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, pulse_selector.set_active_text (strings[3]); // "quarter" } - Table* table = manage (new Table (5, 5)); + Table* table; + + if (Config->get_allow_non_quarter_pulse()) { + table = manage (new Table (5, 5)); + } else { + table = manage (new Table (5, 4)); + } + table->set_spacings (6); table->set_homogeneous (false); + int row; Label* bpm_label = manage (new Label(_("Beats per minute:"), ALIGN_LEFT, ALIGN_CENTER)); table->attach (*bpm_label, 0, 1, 0, 1); table->attach (bpm_spinner, 1, 5, 0, 1); - table->attach (pulse_selector_label, 0, 1, 1, 2); - table->attach (pulse_selector, 1, 5, 1, 2); + if (Config->get_allow_non_quarter_pulse()) { + table->attach (pulse_selector_label, 0, 1, 1, 2); + table->attach (pulse_selector, 1, 5, 1, 2); + row = 2; + } else { + row = 1; + } if (movable) { char buf[64]; @@ -128,14 +144,14 @@ TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, when_bar_label.set_name ("MetricLabel"); when_beat_label.set_name ("MetricLabel"); - table->attach (when_bar_label, 1, 2, 2, 3, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); - table->attach (when_bar_entry, 2, 3, 2, 3, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); + table->attach (when_bar_label, 1, 2, row, row+1, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); + table->attach (when_bar_entry, 2, 3, row, row+1, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); - table->attach (when_beat_label, 3, 4, 2, 3, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); - table->attach (when_beat_entry, 4, 5, 2, 3, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); + table->attach (when_beat_label, 3, 4, row, row+1, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); + table->attach (when_beat_entry, 4, 5, row, row+1, Gtk::AttachOptions(0), Gtk::AttachOptions(0)); Label* when_label = manage (new Label(_("Tempo begins at"), ALIGN_LEFT, ALIGN_CENTER)); - table->attach (*when_label, 0, 1, 2, 3); + table->attach (*when_label, 0, 1, row, row+1); } get_vbox()->set_border_width (12); |