Tempo ramps - clean up tempo dragging.
[ardour.git] / libs / ardour / ardour / tempo.h
index a570096b45ddd345565ce744a335087b1c78df81..9cbd8b972755e4a47fff3f861bd2afe1e7165338 100644 (file)
@@ -374,14 +374,14 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
        const MeterSection& meter_section_at_beat (double beat) const;
 
 
-       /** add a tempo section locked to pls. ignored values are set in recompute_tempos()
+       /** add a tempo section locked to pls. ignored values will be set in recompute_tempos()
         * @param pulse pulse position of new section. ignored if pls == AudioTime
         * @param frame frame position of new section. ignored if pls == MusicTime
         * @param type type of new tempo section (Ramp, Constant)
         */
        TempoSection* add_tempo (const Tempo&, const double& pulse, const framepos_t& frame, TempoSection::Type type, PositionLockStyle pls);
 
-       /** add an meter section locked to pls.. ignored values are set in recompute_meters()
+       /** add an meter section locked to pls.. ignored values will be set in recompute_meters()
         * @param beat beat position of new section
         * @param where bbt position of new section
         * @param frame frame position of new section. ignored if pls == MusicTime
@@ -391,21 +391,18 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
        void remove_tempo (const TempoSection&, bool send_signal);
        void remove_meter (const MeterSection&, bool send_signal);
 
-       framepos_t predict_tempo_frame (TempoSection* section, const Timecode::BBT_Time& bbt);
-       double predict_tempo_pulse (TempoSection* section, const framepos_t& frame);
-
        void replace_tempo (const TempoSection&, const Tempo&, const double& pulse, const framepos_t& frame
                            , TempoSection::Type type, PositionLockStyle pls);
 
        void replace_meter (const MeterSection&, const Meter&, const Timecode::BBT_Time& where, const framepos_t& frame
                            , PositionLockStyle pls);
 
-       void gui_move_tempo_frame (TempoSection*, const framepos_t& frame);
-       void gui_move_tempo_beat (TempoSection*, const double& beat);
-       void gui_move_meter_frame (MeterSection*, const framepos_t& frame);
-       void gui_move_meter_bbt (MeterSection*, const Timecode::BBT_Time& bbt);
+       std::pair<double, framepos_t> predict_tempo_position (TempoSection* section, const Timecode::BBT_Time& bbt);
+
+       void gui_move_tempo (TempoSection*, const framepos_t& frame);
+       void gui_move_meter (MeterSection*, const framepos_t& frame);
+
        bool gui_change_tempo (TempoSection*, const Tempo& bpm);
-       void gui_dilate_tempo (MeterSection*, const framepos_t& frame);
        void gui_dilate_tempo (TempoSection* tempo, const framepos_t& frame, const framepos_t& end_frame, const double& pulse);
 
        bool can_solve_bbt (TempoSection* section, const Timecode::BBT_Time& bbt);
@@ -445,9 +442,11 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
 
        framecnt_t frame_rate () const { return _frame_rate; }
 
-       double bbt_to_beats (const Timecode::BBT_Time& bbt);
-       Timecode::BBT_Time beats_to_bbt (const double& beats);
-       Timecode::BBT_Time pulse_to_bbt (const double& pulse);
+       double beat_at_bbt (const Timecode::BBT_Time& bbt);
+       Timecode::BBT_Time bbt_at_beat (const double& beats);
+
+       double pulse_at_bbt (const Timecode::BBT_Time& bbt);
+       Timecode::BBT_Time bbt_at_pulse (const double& pulse);
 
        double pulse_at_beat (const double& beat) const;
        double beat_at_pulse (const double& pulse) const;
@@ -467,8 +466,11 @@ private:
        double beat_at_frame_locked (const Metrics& metrics, const framecnt_t& frame) const;
        framecnt_t frame_at_beat_locked (const Metrics& metrics, const double& beat) const;
 
-       double bbt_to_beats_locked (const Metrics& metrics, const Timecode::BBT_Time& bbt) const ;
-       Timecode::BBT_Time beats_to_bbt_locked (const Metrics& metrics, const double& beats) const;
+       double beat_at_bbt_locked (const Metrics& metrics, const Timecode::BBT_Time& bbt) const ;
+       Timecode::BBT_Time bbt_at_beat_locked (const Metrics& metrics, const double& beats) const;
+
+       double pulse_at_bbt_locked (const Metrics& metrics, const Timecode::BBT_Time& bbt) const;
+       Timecode::BBT_Time bbt_at_pulse_locked (const Metrics& metrics, const double& pulse) const;
 
        framepos_t frame_time_locked (const Metrics& metrics, const Timecode::BBT_Time&) const;
 
@@ -482,6 +484,7 @@ private:
 
        bool check_solved (const Metrics& metrics) const;
        bool set_active_tempos (const Metrics& metrics, const framepos_t& frame);
+
        bool solve_map_frame (Metrics& metrics, TempoSection* section, const framepos_t& frame);
        bool solve_map_pulse (Metrics& metrics, TempoSection* section, const double& pulse);
        bool solve_map_frame (Metrics& metrics, MeterSection* section, const framepos_t& frame);