summaryrefslogtreecommitdiffstats
path: root/src/vinylcontrol/steadypitch.h
blob: 6b37d7efaa753f3aace8349d2bc9b5425f12ab36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once

#include <QTime>

#include "vinylcontrol.h"

class SteadyPitch {
    public:
        SteadyPitch(double threshold, bool assumeSteady);
        void reset(double pitch, double time);
        double check(double pitch, double time);
        double steadyValue(void) const;
        bool directionChanged(double pitch);
        bool resyncDetected(double new_time);
    private:
        const bool m_bAssumeSteady;
        double m_dSteadyPitch;
        double m_dOldSteadyPitch;
        double m_dSteadyPitchTime;
        double m_dLastSteadyDur;
        double m_dLastTime;
        double m_dPitchThreshold;
        int m_iPlayDirection;
};