summaryrefslogtreecommitdiff
path: root/src/lib/audio_analysis.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-25 11:41:21 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-25 16:16:37 +0100
commit54038beb4437c027e584fc95110f6fd4dbf2207d (patch)
treed72963f95eaa0f0aba26dfa1db90838f1c6292f2 /src/lib/audio_analysis.h
parentb42066b7d664ac322e6d2c79c5b0fa8bb0eb75c9 (diff)
Add channel details to high-audio-level hints (#822).
Diffstat (limited to 'src/lib/audio_analysis.h')
-rw-r--r--src/lib/audio_analysis.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h
index 9acd491ce..a8ef4fb2d 100644
--- a/src/lib/audio_analysis.h
+++ b/src/lib/audio_analysis.h
@@ -42,12 +42,21 @@ public:
void add_point (int c, AudioPoint const & p);
- void set_sample_peak (float peak, DCPTime time) {
+ struct PeakTime {
+ PeakTime (float p, DCPTime t)
+ : peak (p)
+ , time (t)
+ {}
+
+ float peak;
+ DCPTime time;
+ };
+
+ void set_sample_peak (std::vector<PeakTime> peak) {
_sample_peak = peak;
- _sample_peak_time = time;
}
- void set_true_peak (float peak) {
+ void set_true_peak (std::vector<float> peak) {
_true_peak = peak;
}
@@ -63,18 +72,18 @@ public:
int points (int c) const;
int channels () const;
- boost::optional<float> sample_peak () const {
+ std::vector<PeakTime> sample_peak () const {
return _sample_peak;
}
- boost::optional<DCPTime> sample_peak_time () const {
- return _sample_peak_time;
- }
+ std::pair<PeakTime, int> overall_sample_peak () const;
- boost::optional<float> true_peak () const {
+ std::vector<float> true_peak () const {
return _true_peak;
}
+ boost::optional<float> overall_true_peak () const;
+
boost::optional<float> integrated_loudness () const {
return _integrated_loudness;
}
@@ -97,9 +106,8 @@ public:
private:
std::vector<std::vector<AudioPoint> > _data;
- boost::optional<float> _sample_peak;
- boost::optional<DCPTime> _sample_peak_time;
- boost::optional<float> _true_peak;
+ std::vector<PeakTime> _sample_peak;
+ std::vector<float> _true_peak;
boost::optional<float> _integrated_loudness;
boost::optional<float> _loudness_range;
/** If this analysis was run on a single piece of
@@ -107,6 +115,8 @@ private:
* happened.
*/
boost::optional<double> _analysis_gain;
+
+ static int const _current_state_version;
};
#endif