diff dsp/tempotracking/TempoTrackV2.h @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents bb78ca3fe7de
children
line wrap: on
line diff
--- a/dsp/tempotracking/TempoTrackV2.h	Thu May 30 16:18:13 2019 +0100
+++ b/dsp/tempotracking/TempoTrackV2.h	Wed Jun 05 12:55:15 2019 +0100
@@ -13,12 +13,10 @@
     COPYING included with this distribution for more information.
 */
 
-
-#ifndef TEMPOTRACKV2_H
-#define TEMPOTRACKV2_H
+#ifndef QM_DSP_TEMPOTRACKV2_H
+#define QM_DSP_TEMPOTRACKV2_H
 
 #include <vector>
-using namespace std;
 
 //!!! Question: how far is this actually sample rate dependent?  I
 // think it does produce plausible results for e.g. 48000 as well as
@@ -36,47 +34,47 @@
      * Currently the sample rate and increment are used only for the
      * conversion from beat frame location to bpm in the tempo array.
      */
-    TempoTrackV2(float sampleRate, size_t dfIncrement);
+    TempoTrackV2(float sampleRate, int dfIncrement);
     ~TempoTrackV2();
 
     // Returned beat periods are given in df increment units; inputtempo and tempi in bpm
-    void calculateBeatPeriod(const vector<double> &df,
-                             vector<double> &beatPeriod,
-                             vector<double> &tempi) {
+    void calculateBeatPeriod(const std::vector<double> &df,
+                             std::vector<double> &beatPeriod,
+                             std::vector<double> &tempi) {
         calculateBeatPeriod(df, beatPeriod, tempi, 120.0, false);
     }
 
     // Returned beat periods are given in df increment units; inputtempo and tempi in bpm
     // MEPD 28/11/12 Expose inputtempo and constraintempo parameters
     // Note, if inputtempo = 120 and constraintempo = false, then functionality is as it was before
-    void calculateBeatPeriod(const vector<double> &df,
-                             vector<double> &beatPeriod,
-                             vector<double> &tempi,
+    void calculateBeatPeriod(const std::vector<double> &df,
+                             std::vector<double> &beatPeriod,
+                             std::vector<double> &tempi,
                              double inputtempo, bool constraintempo);
 
     // Returned beat positions are given in df increment units
-    void calculateBeats(const vector<double> &df,
-                        const vector<double> &beatPeriod,
-                        vector<double> &beats) {
+    void calculateBeats(const std::vector<double> &df,
+                        const std::vector<double> &beatPeriod,
+                        std::vector<double> &beats) {
         calculateBeats(df, beatPeriod, beats, 0.9, 4.0);
     }
 
     // Returned beat positions are given in df increment units
     // MEPD 28/11/12 Expose alpha and tightness parameters
     // Note, if alpha = 0.9 and tightness = 4, then functionality is as it was before
-    void calculateBeats(const vector<double> &df,
-                        const vector<double> &beatPeriod,
-                        vector<double> &beats,
+    void calculateBeats(const std::vector<double> &df,
+                        const std::vector<double> &beatPeriod,
+                        std::vector<double> &beats,
                         double alpha, double tightness);
 
 private:
-    typedef vector<int> i_vec_t;
-    typedef vector<vector<int> > i_mat_t;
-    typedef vector<double> d_vec_t;
-    typedef vector<vector<double> > d_mat_t;
+    typedef std::vector<int> i_vec_t;
+    typedef std::vector<std::vector<int> > i_mat_t;
+    typedef std::vector<double> d_vec_t;
+    typedef std::vector<std::vector<double> > d_mat_t;
 
     float m_rate;
-    size_t m_increment;
+    int m_increment;
 
     void adapt_thresh(d_vec_t &df);
     double mean_array(const d_vec_t &dfin, int start, int end);