/*
- Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
/** @file src/lib/analyse_audio_job.h
* @brief AnalyseAudioJob class.
*/
-#include "job.h"
+
+#include "audio_analyser.h"
#include "audio_point.h"
-#include "types.h"
#include "dcpomatic_time.h"
+#include "job.h"
+#include <leqm_nrt.h>
+#include <boost/scoped_ptr.hpp>
+
class AudioBuffers;
class AudioAnalysis;
class AudioFilterGraph;
class Filter;
+
/** @class AnalyseAudioJob
* @brief A job to analyse the audio of a film and make a note of its
* broad peak and RMS levels.
class AnalyseAudioJob : public Job
{
public:
- AnalyseAudioJob (boost::shared_ptr<const Film>, boost::shared_ptr<const Playlist>, bool from_zero);
+ AnalyseAudioJob (std::shared_ptr<const Film>, std::shared_ptr<const Playlist>, bool from_zero);
~AnalyseAudioJob ();
- std::string name () const;
- std::string json_name () const;
- void run ();
+ std::string name () const override;
+ std::string json_name () const override;
+ void run () override;
+ bool enable_notify () const override {
+ return true;
+ }
boost::filesystem::path path () const {
return _path;
}
private:
- void analyse (boost::shared_ptr<const AudioBuffers>, DCPTime time);
+ AudioAnalyser _analyser;
- boost::shared_ptr<const Playlist> _playlist;
+ std::shared_ptr<const Playlist> _playlist;
/** playlist's audio analysis path when the job was created */
boost::filesystem::path _path;
- DCPTime _start;
- bool _from_zero;
-
- int64_t _done;
- int64_t _samples_per_point;
- AudioPoint* _current;
-
- float* _sample_peak;
- Frame* _sample_peak_frame;
-
- boost::shared_ptr<AudioAnalysis> _analysis;
-
- boost::shared_ptr<AudioFilterGraph> _ebur128;
- std::vector<Filter const *> _filters;
static const int _num_points;
};