Fix the build for older macOS.
[dcpomatic.git] / src / lib / analyse_audio_job.h
1 /*
2     Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 /** @file  src/lib/analyse_audio_job.h
23  *  @brief AnalyseAudioJob class.
24  */
25
26
27 #include "audio_analyser.h"
28 #include "job.h"
29 #include "audio_point.h"
30 #include "types.h"
31 #include "dcpomatic_time.h"
32 #include <leqm_nrt.h>
33 #include <boost/scoped_ptr.hpp>
34
35
36 class AudioBuffers;
37 class AudioAnalysis;
38 class Playlist;
39 class AudioPoint;
40 class AudioFilterGraph;
41 class Filter;
42
43
44 /** @class AnalyseAudioJob
45  *  @brief A job to analyse the audio of a film and make a note of its
46  *  broad peak and RMS levels.
47  *
48  *  After computing the peak and RMS levels the job will write a file
49  *  to Film::audio_analysis_path.
50  */
51 class AnalyseAudioJob : public Job
52 {
53 public:
54         AnalyseAudioJob (std::shared_ptr<const Film>, std::shared_ptr<const Playlist>, bool from_zero);
55         ~AnalyseAudioJob ();
56
57         std::string name () const;
58         std::string json_name () const;
59         void run ();
60
61         boost::filesystem::path path () const {
62                 return _path;
63         }
64
65 private:
66         AudioAnalyser _analyser;
67
68         std::shared_ptr<const Playlist> _playlist;
69         /** playlist's audio analysis path when the job was created */
70         boost::filesystem::path _path;
71
72         static const int _num_points;
73 };