Rename SafeStringStream -> locked_stringstream. Bump deps for removal of stringstream.
[dcpomatic.git] / src / lib / dcp_examiner.h
1 /*
2     Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21 /** @file  src/lib/dcp_examiner.h
22  *  @brief DCPExaminer class.
23  */
24
25 #include "video_examiner.h"
26 #include "audio_examiner.h"
27
28 class DCPContent;
29
30 class DCPExaminer : public VideoExaminer, public AudioExaminer
31 {
32 public:
33         DCPExaminer (boost::shared_ptr<const DCPContent>);
34
35         boost::optional<double> video_frame_rate () const {
36                 return _video_frame_rate;
37         }
38
39         dcp::Size video_size () const {
40                 return _video_size.get_value_or (dcp::Size (1998, 1080));
41         }
42
43         Frame video_length () const {
44                 return _video_length;
45         }
46
47         bool yuv () const {
48                 return false;
49         }
50
51         std::string name () const {
52                 return _name;
53         }
54
55         bool has_subtitles () const {
56                 return _has_subtitles;
57         }
58
59         bool encrypted () const {
60                 return _encrypted;
61         }
62
63         int audio_channels () const {
64                 return _audio_channels.get_value_or (0);
65         }
66
67         Frame audio_length () const {
68                 return _audio_length;
69         }
70
71         int audio_frame_rate () const {
72                 return _audio_frame_rate.get_value_or (48000);
73         }
74
75         bool kdm_valid () const {
76                 return _kdm_valid;
77         }
78
79         boost::optional<dcp::Standard> standard () const {
80                 return _standard;
81         }
82
83         bool three_d () const {
84                 return _three_d;
85         }
86
87 private:
88         boost::optional<double> _video_frame_rate;
89         boost::optional<dcp::Size> _video_size;
90         Frame _video_length;
91         boost::optional<int> _audio_channels;
92         boost::optional<int> _audio_frame_rate;
93         Frame _audio_length;
94         std::string _name;
95         bool _has_subtitles;
96         bool _encrypted;
97         bool _kdm_valid;
98         boost::optional<dcp::Standard> _standard;
99         bool _three_d;
100 };