bpm_spinner.set_digits (2);
bpm_spinner.set_wrap (true);
bpm_spinner.set_value (bpm);
bpm_spinner.set_digits (2);
bpm_spinner.set_wrap (true);
bpm_spinner.set_value (bpm);
note_types.insert (make_pair (_("whole"), 1.0));
strings.push_back (_("whole"));
note_types.insert (make_pair (_("whole"), 1.0));
strings.push_back (_("whole"));
table = manage (new Table (5, 5));
} else {
table = manage (new Table (5, 4));
table = manage (new Table (5, 5));
} else {
table = manage (new Table (5, 4));
table->attach (*bpm_label, 0, 1, 0, 1);
table->attach (bpm_spinner, 1, 5, 0, 1);
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);
row = 2;
table->attach (pulse_selector_label, 0, 1, 1, 2);
table->attach (pulse_selector, 1, 5, 1, 2);
row = 2;
- snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
- when_bar_entry.set_text (buf);
- snprintf (buf, sizeof (buf), "%" PRIu32, when.beats);
- when_beat_entry.set_text (buf);
+ snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
+ when_bar_entry.set_text (buf);
+ snprintf (buf, sizeof (buf), "%" PRIu32, when.beats);
+ when_beat_entry.set_text (buf);
when_beat_entry.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
when_beat_entry.signal_key_release_event().connect (sigc::mem_fun (*this, &TempoDialog::entry_key_release), false);
pulse_selector.signal_changed().connect (sigc::mem_fun (*this, &TempoDialog::pulse_change));
when_beat_entry.signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &TempoDialog::response), RESPONSE_ACCEPT));
when_beat_entry.signal_key_release_event().connect (sigc::mem_fun (*this, &TempoDialog::entry_key_release), false);
pulse_selector.signal_changed().connect (sigc::mem_fun (*this, &TempoDialog::pulse_change));
- tap_tempo_button.signal_clicked().connect (sigc::mem_fun (*this, &TempoDialog::tap_tempo));
+ tap_tempo_button.signal_button_press_event().connect (sigc::mem_fun (*this, &TempoDialog::tap_tempo_button_press), false);
+ tap_tempo_button.signal_focus_out_event().connect (sigc::mem_fun (*this, &TempoDialog::tap_tempo_focus_out));
+
+ tapped = false;
- bpm = 60.0 / average_interval;
- bpm_spinner.set_value (bpm);
+ if (average_interval > 0) {
+ bpm = 60.0 / average_interval;
+ bpm_spinner.set_value (bpm);
+ }
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Meter"))
{
MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
: ArdourDialog (_("New Meter"))
{
snprintf (buf, sizeof (buf), "%.2f", bpb);
bpb_entry.set_text (buf);
bpb_entry.select_region (0, -1);
snprintf (buf, sizeof (buf), "%.2f", bpb);
bpb_entry.set_text (buf);
bpb_entry.select_region (0, -1);
note_types.insert (make_pair (_("whole"), 1.0));
strings.push_back (_("whole"));
note_types.insert (make_pair (_("whole"), 1.0));
strings.push_back (_("whole"));
table->attach (*note_label, 0, 1, 1, 2, FILL|EXPAND, FILL|EXPAND);
table->attach (note_type, 1, 2, 1, 2, FILL|EXPAND, SHRINK);
table->attach (*note_label, 0, 1, 1, 2, FILL|EXPAND, FILL|EXPAND);
table->attach (note_type, 1, 2, 1, 2, FILL|EXPAND, SHRINK);
- if (movable) {
- char buf[64];
-
- snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
- when_bar_entry.set_text (buf);
+ snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
+ when_bar_entry.set_text (buf);
+ when_bar_entry.set_alignment (1.0);
Label* when_label = manage (new Label(_("Meter begins at bar:"), ALIGN_LEFT, ALIGN_CENTER));
table->attach (*when_label, 0, 1, 2, 3, FILL | EXPAND, FILL | EXPAND);
table->attach (when_bar_entry, 1, 2, 2, 3, FILL | EXPAND, FILL | EXPAND);
Label* when_label = manage (new Label(_("Meter begins at bar:"), ALIGN_LEFT, ALIGN_CENTER));
table->attach (*when_label, 0, 1, 2, 3, FILL | EXPAND, FILL | EXPAND);
table->attach (when_bar_entry, 1, 2, 2, 3, FILL | EXPAND, FILL | EXPAND);