diff options
author | nick_m <mainsbridge@gmail.com> | 2015-12-22 01:21:54 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:09 +1000 |
commit | 7898435d3f94355fa0996dc9f85b3bc1ef173585 (patch) | |
tree | 77dd39b6122330328b15046a8ae45e4fdaeda483 /gtk2_ardour | |
parent | 9eeccf0c17094708996c3c491f265877b04199fe (diff) |
Tempo ramps - define_one_bar() delivers constant tempo.
- also some renaming and code review
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/tempo_dialog.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/tempo_dialog.h | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 8302f1b778..f094c793ac 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6480,7 +6480,9 @@ Editor::define_one_bar (framepos_t start, framepos_t end) /* length = 1 bar */ - /* now we want frames per beat. + /* We're going to deliver a constant tempo here, + so we can use frames per beat to determine length. + now we want frames per beat. we have frames per bar, and beats per bar, so ... */ @@ -6552,7 +6554,7 @@ Editor::define_one_bar (framepos_t start, framepos_t end) } else { Timecode::BBT_Time bbt; _session->tempo_map().bbt_time (start, bbt); - _session->tempo_map().add_tempo (Tempo (beats_per_minute, t.note_type()), bbt, TempoSection::TempoSectionType::Ramp); + _session->tempo_map().add_tempo (Tempo (beats_per_minute, t.note_type()), bbt, TempoSection::Type::Constant); } XMLNode& after (_session->tempo_map().get_state()); diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index 613a2d9a5a..2c45d50085 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -108,9 +108,9 @@ TempoDialog::init (const Timecode::BBT_Time& when, double bpm, double note_type, strings.clear(); - tempo_types.insert (make_pair (_("ramped"), TempoSection::TempoSectionType::Ramp)); + tempo_types.insert (make_pair (_("ramped"), TempoSection::Type::Ramp)); strings.push_back (_("ramped")); - tempo_types.insert (make_pair (_("constant"), TempoSection::TempoSectionType::Constant)); + tempo_types.insert (make_pair (_("constant"), TempoSection::Type::Constant)); strings.push_back (_("constant")); set_popdown_strings (tempo_type, strings); tempo_type.set_active_text (strings[0]); // "ramped" @@ -272,14 +272,14 @@ TempoDialog::get_note_type () return x->second; } -TempoSection::TempoSectionType +TempoSection::Type TempoDialog::get_tempo_type () { TempoTypes::iterator x = tempo_types.find (tempo_type.get_active_text()); if (x == tempo_types.end()) { error << string_compose(_("incomprehensible pulse note type (%1)"), tempo_type.get_active_text()) << endmsg; - return TempoSection::TempoSectionType::Constant; + return TempoSection::Type::Constant; } return x->second; diff --git a/gtk2_ardour/tempo_dialog.h b/gtk2_ardour/tempo_dialog.h index 842c2f2c3c..89f93016a2 100644 --- a/gtk2_ardour/tempo_dialog.h +++ b/gtk2_ardour/tempo_dialog.h @@ -44,7 +44,7 @@ public: double get_bpm (); double get_note_type (); bool get_bbt_time (Timecode::BBT_Time&); - ARDOUR::TempoSection::TempoSectionType get_tempo_type (); + ARDOUR::TempoSection::Type get_tempo_type (); private: void init (const Timecode::BBT_Time& start, double, double, bool); @@ -61,7 +61,7 @@ private: typedef std::map<std::string,float> NoteTypes; NoteTypes note_types; - typedef std::map<std::string, ARDOUR::TempoSection::TempoSectionType> TempoTypes; + typedef std::map<std::string, ARDOUR::TempoSection::Type> TempoTypes; TempoTypes tempo_types; bool tapped; // whether the tap-tempo button has been clicked |