Tempo ramps - rename meter_at() -> meter_at_frame() & make the ticker slightly more...
authornick_m <mainsbridge@gmail.com>
Thu, 26 May 2016 15:44:58 +0000 (01:44 +1000)
committernick_m <mainsbridge@gmail.com>
Fri, 27 May 2016 13:38:17 +0000 (23:38 +1000)
gtk2_ardour/automation_line.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor_ops.cc
gtk2_ardour/midi_region_view.cc
gtk2_ardour/step_editor.cc
gtk2_ardour/tempo_dialog.cc
gtk2_ardour/verbose_cursor.cc
libs/ardour/ardour/tempo.h
libs/ardour/tempo.cc
libs/ardour/ticker.cc

index 47e91021aee9142a6207a7dc62bd0257bba87289..cf7e10dd8a49efc202e065217bcdc813bc3bd81d 100644 (file)
@@ -546,7 +546,7 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
                        before_x = line.nth (front()->view_index() - 1)->get_x();
 
                        const framepos_t pos = e.pixel_to_sample(before_x);
-                       const Meter& meter = map.meter_at (pos);
+                       const Meter& meter = map.meter_at_frame (pos);
                        const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at_frame (pos), e.session()->frame_rate())
                                        / (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()) );
                        const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
@@ -562,7 +562,7 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
                        after_x = line.nth (back()->view_index() + 1)->get_x();
 
                        const framepos_t pos = e.pixel_to_sample(after_x);
-                       const Meter& meter = map.meter_at (pos);
+                       const Meter& meter = map.meter_at_frame (pos);
                        const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at_frame (pos), e.session()->frame_rate())
                                        / (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()));
                        const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
index 691292025f06cac9cfe371eb432295dea3d37108..c5d99c69bf1e58fc32156d172105b93cfdf737e4 100644 (file)
@@ -4105,7 +4105,7 @@ Editor::get_grid_type_as_beats (bool& success, framepos_t position)
                return Evoral::Beats(1.0);
        case SnapToBar:
                if (_session) {
-                       return Evoral::Beats(_session->tempo_map().meter_at (position).divisions_per_bar());
+                       return Evoral::Beats(_session->tempo_map().meter_at_frame (position).divisions_per_bar());
                }
                break;
        default:
index 2038c40860f81ac5d695f7cd5a9416a3f27a0ee7..47f2e8cec75cd671d1a43f5164d2ed8787f5fa15 100644 (file)
@@ -6476,7 +6476,7 @@ Editor::define_one_bar (framepos_t start, framepos_t end)
 {
        framepos_t length = end - start;
 
-       const Meter& m (_session->tempo_map().meter_at (start));
+       const Meter& m (_session->tempo_map().meter_at_frame (start));
 
        /* length = 1 bar */
 
index 3fbe2c83fc1d874a3e3f13af240692113620e4ae..31030988ee6e2a1dfa0deae9489680a69182c383 100644 (file)
@@ -3229,7 +3229,7 @@ MidiRegionView::nudge_notes (bool forward, bool fine)
        if (!fine) {
 
                /* non-fine, move by 1 bar regardless of snap */
-               delta = Evoral::Beats(trackview.session()->tempo_map().meter_at(ref_point).divisions_per_bar());
+               delta = Evoral::Beats(trackview.session()->tempo_map().meter_at_frame (ref_point).divisions_per_bar());
 
        } else if (trackview.editor().snap_mode() == Editing::SnapOff) {
 
index 62b2646b818b64b5301a1c6fabf31cd9affcfd47..d82f0a2dd7a38a37aeb6b14c0ea2a577ddf230e9 100644 (file)
@@ -115,7 +115,7 @@ StepEditor::prepare_step_edit_region ()
 
        } else {
 
-               const Meter& m = _mtv.session()->tempo_map().meter_at (step_edit_insert_position);
+               const Meter& m = _mtv.session()->tempo_map().meter_at_frame (step_edit_insert_position);
                const Tempo& t = _mtv.session()->tempo_map().tempo_at_frame (step_edit_insert_position);
 
                double baf = _mtv.session()->tempo_map().beat_at_frame (step_edit_insert_position);
index b68e82f30b15d7fa52e9de6268d43a9a310e4932..b4951f35ca272df27249729933e856d1767d29b2 100644 (file)
@@ -422,7 +422,7 @@ MeterDialog::MeterDialog (TempoMap& map, framepos_t frame, const string&)
 {
        Timecode::BBT_Time when;
        frame = map.round_to_bar(frame, RoundNearest);
-       Meter meter (map.meter_at(frame));
+       Meter meter (map.meter_at_frame (frame));
 
        map.bbt_time (frame, when);
        init (when, meter.divisions_per_bar(), meter.note_divisor(), true, MusicTime);
index 84d75d2451ab26c0ef7542c1a29542cc7a8e1dba..aac476408d436d4f925eb2d6482c8e2840405e11 100644 (file)
@@ -137,7 +137,7 @@ VerboseCursor::set_duration (framepos_t start, framepos_t end)
        Timecode::Time timecode;
        Timecode::BBT_Time sbbt;
        Timecode::BBT_Time ebbt;
-       Meter meter_at_start (_editor->_session->tempo_map().meter_at(start));
+       Meter meter_at_start (_editor->_session->tempo_map().meter_at_frame (start));
 
        if (_editor->_session == 0) {
                return;
index 52caaf5030741cd8b44550dcc250aad5664f433e..f08ffa64b9ef6696f5ac0bec07de4eeee33bce11 100644 (file)
@@ -332,8 +332,6 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
 
        double frames_per_beat_at (const framepos_t&, const framecnt_t& sr) const;
 
-       const Meter& meter_at (framepos_t) const;
-
        const TempoSection& tempo_section_at (framepos_t frame) const;
        const MeterSection& meter_section_at (framepos_t frame) const;
        const MeterSection& meter_section_at_beat (double beat) const;
@@ -417,6 +415,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
        framecnt_t frame_at_pulse (const double& pulse) const;
 
        const Tempo tempo_at_frame (const framepos_t& frame) const;
+       const Meter& meter_at_frame (framepos_t) const;
 
        double beat_at_bbt (const Timecode::BBT_Time& bbt);
        Timecode::BBT_Time bbt_at_beat (const double& beats);
index fcb840c0ed334401a2921774f64cc1be707a6809..36ac3a8203d03703ffccb8b2a001615d3eec14d5 100644 (file)
@@ -3023,7 +3023,7 @@ TempoMap::meter_section_at_beat (double beat) const
 }
 
 const Meter&
-TempoMap::meter_at (framepos_t frame) const
+TempoMap::meter_at_frame (framepos_t frame) const
 {
        TempoMetric m (metric_at (frame));
        return m.meter();
index 58a1c4573d6ea1dbc3d110ceb0dae6075bab7bf5..def219a4331654aea57d154fc2ce808c7318ddc3 100644 (file)
@@ -68,9 +68,10 @@ public:
            s->bbt_time (this->frame, *this);
 
            const TempoMap& tempo = s->tempo_map();
+           const Meter& meter = tempo.meter_at_frame (frame);
 
-           const double divisions   = tempo.meter_at(frame).divisions_per_bar();
-           const double divisor     = tempo.meter_at(frame).note_divisor();
+           const double divisions   = meter.divisions_per_bar();
+           const double divisor     = meter.note_divisor();
            const double qnote_scale = divisor * 0.25f;
            double mb;