Debian Codegraph @

au4/src/playback/view/toolbars/components/numericformatter.h

raw
1 /*
2 * Audacity: A Digital Audio Editor
3 */
4 #pragma once
5
6 #include <QString>
7
8 #include "types.h"
9 #include "timecodeformatter.h"
10
11 namespace au::playback {
12 class NumericFormatter : public TimecodeFormatter
13 {
14 public:
15 NumericFormatter(const QString& formatStr);
16
17 void init() override;
18
19 ConversionResult valueToString(double value, bool nearest) const override;
20
21 std::optional<double> stringToValue(const QString& value) const override;
22
23 double singleStep(double value, int digitIndex, bool upwards) override;
24
25 protected:
26 double m_scalingFactor = 0.0;
27 bool m_scalingFactorIsSamples = false;
28
29 bool m_ntscDrop = false;
30
31 NumericType m_type = NumericType::Time;
32 };
33 }