X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_analysis.h;h=a8ef4fb2d74007e1a984133492b8a841eaa53964;hb=54038beb4437c027e584fc95110f6fd4dbf2207d;hp=9acd491ce96738897dc5ac69b0fc4b6f58262f20;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git 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 peak) { _sample_peak = peak; - _sample_peak_time = time; } - void set_true_peak (float peak) { + void set_true_peak (std::vector peak) { _true_peak = peak; } @@ -63,18 +72,18 @@ public: int points (int c) const; int channels () const; - boost::optional sample_peak () const { + std::vector sample_peak () const { return _sample_peak; } - boost::optional sample_peak_time () const { - return _sample_peak_time; - } + std::pair overall_sample_peak () const; - boost::optional true_peak () const { + std::vector true_peak () const { return _true_peak; } + boost::optional overall_true_peak () const; + boost::optional integrated_loudness () const { return _integrated_loudness; } @@ -97,9 +106,8 @@ public: private: std::vector > _data; - boost::optional _sample_peak; - boost::optional _sample_peak_time; - boost::optional _true_peak; + std::vector _sample_peak; + std::vector _true_peak; boost::optional _integrated_loudness; boost::optional _loudness_range; /** If this analysis was run on a single piece of @@ -107,6 +115,8 @@ private: * happened. */ boost::optional _analysis_gain; + + static int const _current_state_version; }; #endif