2 Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /** @file src/lib/audio_content.h
21 * @brief AudioContent and AudioContentProperty classes.
24 #ifndef DCPOMATIC_AUDIO_CONTENT_H
25 #define DCPOMATIC_AUDIO_CONTENT_H
28 #include "audio_stream.h"
29 #include "audio_mapping.h"
31 /** @class AudioContentProperty
32 * @brief Names for properties of AudioContent.
34 class AudioContentProperty
37 static int const AUDIO_STREAMS;
38 static int const AUDIO_GAIN;
39 static int const AUDIO_DELAY;
42 /** @class AudioContent
43 * @brief Parent class for content which may contain audio data.
45 class AudioContent : public virtual Content
48 AudioContent (boost::shared_ptr<const Film>);
49 AudioContent (boost::shared_ptr<const Film>, DCPTime);
50 AudioContent (boost::shared_ptr<const Film>, boost::filesystem::path);
51 AudioContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr);
52 AudioContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
54 void as_xml (xmlpp::Node *) const;
55 std::string technical_summary () const;
57 virtual std::vector<AudioStreamPtr> audio_streams () const = 0;
59 AudioMapping audio_mapping () const;
60 void set_audio_mapping (AudioMapping);
61 int resampled_audio_frame_rate () const;
62 bool has_rate_above_48k () const;
63 std::vector<std::string> audio_channel_names () const;
65 void set_audio_gain (double);
66 void set_audio_delay (int);
68 double audio_gain () const {
69 boost::mutex::scoped_lock lm (_mutex);
73 int audio_delay () const {
74 boost::mutex::scoped_lock lm (_mutex);
78 std::string processing_description () const;
81 /** Gain to apply to audio in dB */
83 /** Delay to apply to audio (positive moves audio later) in milliseconds */