X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftempo_dialog.cc;h=6d073e12c7d0bdeb3cf49fb6a03ef7d4dc3b203b;hb=f76e8868ef8d801b6e114e54f172c4a69ad83967;hp=b4951f35ca272df27249729933e856d1767d29b2;hpb=baf8f379677d6fea53d665aaff1945ccd896a6fe;p=ardour.git diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index b4951f35ca..6d073e12c7 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -26,7 +26,7 @@ #include "tempo_dialog.h" #include "ui_config.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace Gtk; @@ -45,11 +45,10 @@ TempoDialog::TempoDialog (TempoMap& map, framepos_t frame, const string&) , pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER) , tap_tempo_button (_("Tap tempo")) { - Timecode::BBT_Time when; Tempo tempo (map.tempo_at_frame (frame)); - map.bbt_time (frame, when); + Timecode::BBT_Time when (map.bbt_at_frame (frame)); - init (when, tempo.beats_per_minute(), tempo.note_type(), TempoSection::Constant, true, MusicTime); + init (when, tempo.note_types_per_minute(), tempo.note_type(), TempoSection::Constant, true, MusicTime); } TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&) @@ -63,13 +62,12 @@ TempoDialog::TempoDialog (TempoMap& map, TempoSection& section, const string&) , pulse_selector_label (_("Pulse note"), ALIGN_LEFT, ALIGN_CENTER) , tap_tempo_button (_("Tap tempo")) { - Timecode::BBT_Time when; - map.bbt_time (section.frame(), when); - init (when, section.beats_per_minute(), section.note_type(), section.type(), section.movable(), section.position_lock_style()); + Timecode::BBT_Time when (map.bbt_at_frame (section.frame())); + init (when, section.note_types_per_minute(), section.note_type(), section.type(), section.initial(), section.position_lock_style()); } void -TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, TempoSection::Type type, bool movable, PositionLockStyle style) +TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, TempoSection::Type type, bool initial, PositionLockStyle style) { vector strings; NoteTypes::iterator x; @@ -179,7 +177,7 @@ TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, snprintf (buf, sizeof (buf), "%" PRIu32, when.beats); when_beat_entry.set_text (buf); - if (movable) { + if (!initial) { when_bar_entry.set_width_chars(4); when_beat_entry.set_width_chars (4); when_bar_entry.set_alignment (1.0); @@ -420,24 +418,23 @@ TempoDialog::tap_tempo_focus_out (GdkEventFocus* ) MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&) : ArdourDialog (_("New Meter")) { - Timecode::BBT_Time when; frame = map.round_to_bar(frame, RoundNearest); + Timecode::BBT_Time when (map.bbt_at_frame (frame)); Meter meter (map.meter_at_frame (frame)); - map.bbt_time (frame, when); - init (when, meter.divisions_per_bar(), meter.note_divisor(), true, MusicTime); + init (when, meter.divisions_per_bar(), meter.note_divisor(), false, MusicTime); } MeterDialog::MeterDialog (TempoMap& map, MeterSection& section, const string&) : ArdourDialog (_("Edit Meter")) { - Timecode::BBT_Time when; - map.bbt_time (section.frame(), when); - init (when, section.divisions_per_bar(), section.note_divisor(), section.movable(), section.position_lock_style()); + Timecode::BBT_Time when (map.bbt_at_frame (section.frame())); + + init (when, section.divisions_per_bar(), section.note_divisor(), section.initial(), section.position_lock_style()); } void -MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, bool movable, PositionLockStyle style) +MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, bool initial, PositionLockStyle style) { char buf[64]; vector strings; @@ -513,7 +510,7 @@ MeterDialog::init (const Timecode::BBT_Time& when, double bpb, double divisor, b when_bar_entry.set_text (buf); when_bar_entry.set_alignment (1.0); - if (movable) { + if (!initial) { 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);