588c250fe7282fdeec15e1305f7ef4496a2b6a4d
[dcpomatic.git] / src / lib / single_stream_audio_content.h
1 /*
2     Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef DCPOMATIC_SINGLE_STREAM_AUDIO_CONTENT_H
21 #define DCPOMATIC_SINGLE_STREAM_AUDIO_CONTENT_H
22
23 #include "audio_content.h"
24
25 class AudioExaminer;
26
27 class SingleStreamAudioContent : public AudioContent
28 {
29 public:
30         SingleStreamAudioContent (boost::shared_ptr<const Film>);
31         SingleStreamAudioContent (boost::shared_ptr<const Film>, boost::filesystem::path);
32         SingleStreamAudioContent (boost::shared_ptr<const Film> f, cxml::ConstNodePtr node, int version);
33
34         void as_xml (xmlpp::Node* node) const;
35
36         /* AudioContent */
37         int audio_channels () const {
38                 boost::mutex::scoped_lock lm (_mutex);
39                 return _audio_channels;
40         }
41         
42         ContentTime audio_length () const {
43                 boost::mutex::scoped_lock lm (_mutex);
44                 return _audio_length;
45         }
46         
47         int audio_frame_rate () const {
48                 boost::mutex::scoped_lock lm (_mutex);
49                 return _audio_frame_rate;
50         }
51
52         AudioMapping audio_mapping () const {
53                 boost::mutex::scoped_lock lm (_mutex);
54                 return _audio_mapping;
55         }
56
57         void set_audio_mapping (AudioMapping);
58
59         void take_from_audio_examiner (boost::shared_ptr<AudioExaminer>);
60
61 protected:
62         int _audio_channels;
63         ContentTime _audio_length;
64         int _audio_frame_rate;
65         AudioMapping _audio_mapping;
66 };
67
68 #endif