Supporters update.
[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 "audio_point.h"
29 #include "dcpomatic_time.h"
30 #include "job.h"
31 #include <leqm_nrt.h>
32 #include <boost/scoped_ptr.hpp>
33
34
35 class AudioBuffers;
36 class AudioAnalysis;
37 class Playlist;
38 class AudioPoint;
39 class AudioFilterGraph;
40 class Filter;
41
42
43 /** @class AnalyseAudioJob
44  *  @brief A job to analyse the audio of a film and make a note of its
45  *  broad peak and RMS levels.
46  *
47  *  After computing the peak and RMS levels the job will write a file
48  *  to Film::audio_analysis_path.
49  */
50 class AnalyseAudioJob : public Job
51 {
52 public:
53         AnalyseAudioJob(std::shared_ptr<const Film>, std::shared_ptr<const Playlist>, bool whole_film);
54         ~AnalyseAudioJob ();
55
56         std::string name () const override;
57         std::string json_name () const override;
58         void run () override;
59         bool enable_notify () const override {
60                 return true;
61         }
62
63         boost::filesystem::path path () const {
64                 return _path;
65         }
66
67 private:
68         AudioAnalyser _analyser;
69
70         std::shared_ptr<const Playlist> _playlist;
71         /** playlist's audio analysis path when the job was created */
72         boost::filesystem::path _path;
73         bool _whole_film;
74
75         static const int _num_points;
76 };