2 Copyright (C) 2013-2016 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/>.
21 /** @file src/lib/audio_content.h
22 * @brief AudioContent and AudioContentProperty classes.
25 #ifndef DCPOMATIC_AUDIO_CONTENT_H
26 #define DCPOMATIC_AUDIO_CONTENT_H
28 #include "content_part.h"
29 #include "audio_stream.h"
30 #include "audio_mapping.h"
32 /** @class AudioContentProperty
33 * @brief Names for properties of AudioContent.
35 class AudioContentProperty
38 static int const STREAMS;
39 static int const GAIN;
40 static int const DELAY;
43 class AudioContent : public ContentPart
46 AudioContent (Content* parent);
47 AudioContent (Content* parent, std::vector<boost::shared_ptr<Content> >);
49 void as_xml (xmlpp::Node *) const;
50 std::string technical_summary () const;
52 AudioMapping mapping () const;
53 void set_mapping (AudioMapping);
54 int resampled_frame_rate () const;
55 bool has_rate_above_48k () const;
56 std::vector<std::string> channel_names () const;
58 void set_gain (double);
61 double gain () const {
62 boost::mutex::scoped_lock lm (_mutex);
67 boost::mutex::scoped_lock lm (_mutex);
71 std::string processing_description () const;
73 std::vector<AudioStreamPtr> streams () const {
74 boost::mutex::scoped_lock lm (_mutex);
78 void add_stream (AudioStreamPtr stream);
79 void set_stream (AudioStreamPtr stream);
80 void set_streams (std::vector<AudioStreamPtr> streams);
81 AudioStreamPtr stream () const;
83 void add_properties (std::list<UserProperty> &) const;
85 static boost::shared_ptr<AudioContent> from_xml (Content* parent, cxml::ConstNodePtr, int version);
89 AudioContent (Content* parent, cxml::ConstNodePtr);
91 /** Gain to apply to audio in dB */
93 /** Delay to apply to audio (positive moves audio later) in milliseconds */
95 std::vector<AudioStreamPtr> _streams;