2 Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
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.
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.
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/>.
22 /** @file src/lib/audio_content.h
23 * @brief AudioContent and AudioContentProperty classes.
27 #ifndef DCPOMATIC_AUDIO_CONTENT_H
28 #define DCPOMATIC_AUDIO_CONTENT_H
31 #include "content_part.h"
32 #include "audio_stream.h"
33 #include "audio_mapping.h"
36 /** @class AudioContentProperty
37 * @brief Names for properties of AudioContent.
39 class AudioContentProperty
42 static int const STREAMS;
43 static int const GAIN;
44 static int const DELAY;
48 class AudioContent : public ContentPart
51 explicit AudioContent (Content* parent);
52 AudioContent (Content* parent, std::vector<std::shared_ptr<Content>>);
53 AudioContent (Content* parent, cxml::ConstNodePtr);
55 void as_xml (xmlpp::Node *) const;
56 std::string technical_summary () const;
57 void take_settings_from (std::shared_ptr<const AudioContent> c);
59 AudioMapping mapping () const;
60 void set_mapping (AudioMapping);
61 int resampled_frame_rate (std::shared_ptr<const Film> film) const;
62 std::vector<NamedChannel> channel_names () const;
65 * @param double g New gain in dB.
67 void set_gain (double g);
70 double gain () const {
71 boost::mutex::scoped_lock lm (_mutex);
76 boost::mutex::scoped_lock lm (_mutex);
80 std::string processing_description (std::shared_ptr<const Film> film) const;
82 std::vector<AudioStreamPtr> streams () const {
83 boost::mutex::scoped_lock lm (_mutex);
87 void add_stream (AudioStreamPtr stream);
88 void set_stream (AudioStreamPtr stream);
89 void set_streams (std::vector<AudioStreamPtr> streams);
90 AudioStreamPtr stream () const;
92 void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty> &) const;
94 void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
95 void modify_trim_start (dcpomatic::ContentTime& pos) const;
97 static std::shared_ptr<AudioContent> from_xml (Content* parent, cxml::ConstNodePtr, int version);
101 /** Gain to apply to audio in dB */
103 /** Delay to apply to audio (positive moves audio later) in milliseconds */
105 std::vector<AudioStreamPtr> _streams;