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/>.
20 #include "atmos_asset.h"
21 #include "exceptions.h"
27 AtmosAsset::AtmosAsset (boost::filesystem::path file)
30 ASDCP::ATMOS::MXFReader reader;
31 Kumu::Result_t r = reader.OpenRead (file.string().c_str());
32 if (ASDCP_FAILURE (r)) {
33 boost::throw_exception (MXFFileError ("could not open MXF file for reading", file.string(), r));
36 ASDCP::ATMOS::AtmosDescriptor desc;
37 if (ASDCP_FAILURE (reader.FillAtmosDescriptor (desc))) {
38 boost::throw_exception (DCPReadError ("could not read Atmos MXF information"));
41 _edit_rate = Fraction (desc.EditRate.Numerator, desc.EditRate.Denominator);
42 _intrinsic_duration = desc.ContainerDuration;
43 _first_frame = desc.FirstFrame;
44 _max_channel_count = desc.MaxChannelCount;
45 _max_object_count = desc.MaxObjectCount;
49 AtmosAsset::pkl_type (Standard) const
51 return "application/mxf";