comparison base/AudioLevel.h @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents d397ea0a79f5
children 48e9f538e6e9
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
33 33
34 class AudioLevel 34 class AudioLevel
35 { 35 {
36 public: 36 public:
37 37
38 static const float DB_FLOOR; 38 static const double DB_FLOOR;
39 39
40 enum FaderType { 40 enum FaderType {
41 ShortFader = 0, // -40 -> +6 dB 41 ShortFader = 0, // -40 -> +6 dB
42 LongFader = 1, // -70 -> +10 dB 42 LongFader = 1, // -70 -> +10 dB
43 IEC268Meter = 2, // -70 -> 0 dB 43 IEC268Meter = 2, // -70 -> 0 dB
44 IEC268LongMeter = 3, // -70 -> +10 dB (0dB aligns with LongFader) 44 IEC268LongMeter = 3, // -70 -> +10 dB (0dB aligns with LongFader)
45 PreviewLevel = 4 45 PreviewLevel = 4
46 }; 46 };
47 47
48 static float multiplier_to_dB(float multiplier); 48 static double multiplier_to_dB(double multiplier);
49 static float dB_to_multiplier(float dB); 49 static double dB_to_multiplier(double dB);
50 50
51 static float fader_to_dB(int level, int maxLevel, FaderType type); 51 static double fader_to_dB(int level, int maxLevel, FaderType type);
52 static int dB_to_fader(float dB, int maxFaderLevel, FaderType type); 52 static int dB_to_fader(double dB, int maxFaderLevel, FaderType type);
53 53
54 static float fader_to_multiplier(int level, int maxLevel, FaderType type); 54 static double fader_to_multiplier(int level, int maxLevel, FaderType type);
55 static int multiplier_to_fader(float multiplier, int maxFaderLevel, 55 static int multiplier_to_fader(double multiplier, int maxFaderLevel,
56 FaderType type); 56 FaderType type);
57 57
58 // fast if "levels" doesn't change often -- for audio segment previews 58 // fast if "levels" doesn't change often -- for audio segment previews
59 static int multiplier_to_preview(float multiplier, int levels); 59 static int multiplier_to_preview(double multiplier, int levels);
60 static float preview_to_multiplier(int level, int levels); 60 static double preview_to_multiplier(int level, int levels);
61 }; 61 };
62 62
63 63
64 #endif 64 #endif
65 65