constify some TempoMap functions.
authornick_m <mainsbridge@gmail.com>
Tue, 22 Nov 2016 14:45:43 +0000 (01:45 +1100)
committernick_m <mainsbridge@gmail.com>
Tue, 22 Nov 2016 14:45:43 +0000 (01:45 +1100)
libs/ardour/ardour/tempo.h
libs/ardour/tempo.cc

index ed3268145d75bf59d33eb56d9fb55724e904fb5b..68ce3a056530def792b04e2d756eed0cf3f88512 100644 (file)
@@ -460,12 +460,12 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
        framecnt_t frames_between_quarter_notes (const double start, const double end) const;
        double     quarter_notes_between_frames (const framecnt_t start, const framecnt_t end) const;
 
        framecnt_t frames_between_quarter_notes (const double start, const double end) const;
        double     quarter_notes_between_frames (const framecnt_t start, const framecnt_t end) const;
 
-       double quarter_note_at_beat (const double beat);
-       double beat_at_quarter_note (const double beat);
+       double quarter_note_at_beat (const double beat) const;
+       double beat_at_quarter_note (const double beat) const;
 
        /* obtain a musical subdivision via a frame position and magic note divisor.*/
 
        /* obtain a musical subdivision via a frame position and magic note divisor.*/
-       double exact_qn_at_frame (const framepos_t& frame, const int32_t sub_num);
-       double exact_beat_at_frame (const framepos_t& frame, const int32_t sub_num);
+       double exact_qn_at_frame (const framepos_t& frame, const int32_t sub_num) const;
+       double exact_beat_at_frame (const framepos_t& frame, const int32_t sub_num) const;
 
        Tempo tempo_at_frame (const framepos_t& frame) const;
        framepos_t frame_at_tempo (const Tempo& tempo) const;
 
        Tempo tempo_at_frame (const framepos_t& frame) const;
        framepos_t frame_at_tempo (const Tempo& tempo) const;
@@ -532,8 +532,8 @@ private:
        bool solve_map_minute (Metrics& metrics, MeterSection* section, const double& minute);
        bool solve_map_bbt (Metrics& metrics, MeterSection* section, const Timecode::BBT_Time& bbt);
 
        bool solve_map_minute (Metrics& metrics, MeterSection* section, const double& minute);
        bool solve_map_bbt (Metrics& metrics, MeterSection* section, const Timecode::BBT_Time& bbt);
 
-       double exact_beat_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num);
-       double exact_qn_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num);
+       double exact_beat_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num) const;
+       double exact_qn_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num) const;
 
        double minute_at_frame (const framepos_t frame) const;
        framepos_t frame_at_minute (const double minute) const;
 
        double minute_at_frame (const framepos_t frame) const;
        framepos_t frame_at_minute (const double minute) const;
index 64bcd58f03917fb74fa9557d5c4bbe7e5e0e2642..41c08ae675b11bdca0d5eee1664d03e1671fc028 100644 (file)
@@ -2326,7 +2326,7 @@ TempoMap::minute_at_quarter_note_locked (const Metrics& metrics, const double qu
  *
  */
 double
  *
  */
 double
-TempoMap::quarter_note_at_beat (const double beat)
+TempoMap::quarter_note_at_beat (const double beat) const
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
@@ -2351,7 +2351,7 @@ TempoMap::quarter_note_at_beat_locked (const Metrics& metrics, const double beat
  *
  */
 double
  *
  */
 double
-TempoMap::beat_at_quarter_note (const double quarter_note)
+TempoMap::beat_at_quarter_note (const double quarter_note) const
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
@@ -3409,7 +3409,7 @@ TempoMap::gui_dilate_tempo (TempoSection* ts, const framepos_t& frame, const fra
  * This function is sensitive to tempo and meter.
  */
 double
  * This function is sensitive to tempo and meter.
  */
 double
-TempoMap::exact_beat_at_frame (const framepos_t& frame, const int32_t sub_num)
+TempoMap::exact_beat_at_frame (const framepos_t& frame, const int32_t sub_num) const
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
@@ -3417,7 +3417,7 @@ TempoMap::exact_beat_at_frame (const framepos_t& frame, const int32_t sub_num)
 }
 
 double
 }
 
 double
-TempoMap::exact_beat_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t divisions)
+TempoMap::exact_beat_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t divisions) const
 {
        return beat_at_pulse_locked (_metrics, exact_qn_at_frame_locked (metrics, frame, divisions) / 4.0);
 }
 {
        return beat_at_pulse_locked (_metrics, exact_qn_at_frame_locked (metrics, frame, divisions) / 4.0);
 }
@@ -3445,7 +3445,7 @@ TempoMap::exact_beat_at_frame_locked (const Metrics& metrics, const framepos_t&
  * This function is tempo-sensitive.
  */
 double
  * This function is tempo-sensitive.
  */
 double
-TempoMap::exact_qn_at_frame (const framepos_t& frame, const int32_t sub_num)
+TempoMap::exact_qn_at_frame (const framepos_t& frame, const int32_t sub_num) const
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
 {
        Glib::Threads::RWLock::ReaderLock lm (lock);
 
@@ -3453,7 +3453,7 @@ TempoMap::exact_qn_at_frame (const framepos_t& frame, const int32_t sub_num)
 }
 
 double
 }
 
 double
-TempoMap::exact_qn_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num)
+TempoMap::exact_qn_at_frame_locked (const Metrics& metrics, const framepos_t& frame, const int32_t sub_num) const
 {
        double qn = quarter_note_at_minute_locked (metrics, minute_at_frame (frame));
 
 {
        double qn = quarter_note_at_minute_locked (metrics, minute_at_frame (frame));