provide config parameter to allow non-quarter note pulses; off by default; no GUI...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Dec 2011 02:33:38 +0000 (02:33 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Dec 2011 02:33:38 +0000 (02:33 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11046 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_tempodisplay.cc
gtk2_ardour/tempo_dialog.cc
libs/ardour/ardour/rc_configuration_vars.h

index 563d28d5ac657e9f7d39ba20dc56cb2c58301bea..5f9293d4e249078bc95b52ebd2604b38a2a9f603 100644 (file)
@@ -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))));
                }
index a5717c5110768f383c20266ca53a5157572986f0..0edc098c86ba1f6bec2a9f797c88f60adfee804e 100644 (file)
 #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);
index e621225171a5e9b99a92d9655f46dfa8c668483b..8fb500013a5617fdae708bf7f63af71c76da7a75 100644 (file)
@@ -182,3 +182,4 @@ CONFIG_VARIABLE (DenormalModel, denormal_model, "denormal-model", DenormalNone)
 CONFIG_VARIABLE (bool, show_zoom_tools, "show-zoom-tools", true)
 CONFIG_VARIABLE (bool, widget_prelight, "widget-prelight", true)
 CONFIG_VARIABLE (std::string, mixer_strip_visibility, "mixer-strip-visibility", "PhaseInvert,SoloSafe,SoloIsolated,Group,MeterPoint")
+CONFIG_VARIABLE (bool, allow_non_quarter_pulse, "allow-non-quarter-pulse", false)