2 Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
4 This file is part of libdcp.
6 libdcp 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 libdcp 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 libdcp. If not, see <http://www.gnu.org/licenses/>.
21 #include "atmos_asset.h"
22 #include "exceptions.h"
28 AtmosAsset::AtmosAsset (boost::filesystem::path file)
31 ASDCP::ATMOS::MXFReader reader;
32 Kumu::Result_t r = reader.OpenRead (file.string().c_str());
33 if (ASDCP_FAILURE (r)) {
34 boost::throw_exception (MXFFileError ("could not open MXF file for reading", file.string(), r));
37 ASDCP::ATMOS::AtmosDescriptor desc;
38 if (ASDCP_FAILURE (reader.FillAtmosDescriptor (desc))) {
39 boost::throw_exception (DCPReadError ("could not read Atmos MXF information"));
42 _edit_rate = Fraction (desc.EditRate.Numerator, desc.EditRate.Denominator);
43 _intrinsic_duration = desc.ContainerDuration;
44 _first_frame = desc.FirstFrame;
45 _max_channel_count = desc.MaxChannelCount;
46 _max_object_count = desc.MaxObjectCount;
50 AtmosAsset::pkl_type (Standard) const
52 return "application/mxf";