libdcp
reel_atmos_asset.cc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
3 
4  This file is part of libdcp.
5 
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.
10 
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.
15 
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/>.
18 
19  In addition, as a special exception, the copyright holders give
20  permission to link the code of portions of this program with the
21  OpenSSL library under certain conditions as described in each
22  individual source file, and distribute linked combinations
23  including the two.
24 
25  You must obey the GNU General Public License in all respects
26  for all of the code used other than OpenSSL. If you modify
27  file(s) with this exception, you may extend this exception to your
28  version of the file(s), but you are not obligated to do so. If you
29  do not wish to do so, delete this exception statement from your
30  version. If you delete this exception statement from all source
31  files in the program, then also delete it here.
32 */
33 
34 
40 #include "atmos_asset.h"
41 #include "reel_atmos_asset.h"
42 #include "warnings.h"
43 #include <libcxml/cxml.h>
44 LIBDCP_DISABLE_WARNINGS
45 #include <libxml++/libxml++.h>
46 LIBDCP_ENABLE_WARNINGS
47 
48 
49 using std::string;
50 using std::pair;
51 using std::make_pair;
52 using std::shared_ptr;
53 using namespace dcp;
54 
55 
56 ReelAtmosAsset::ReelAtmosAsset (std::shared_ptr<AtmosAsset> asset, int64_t entry_point)
57  : ReelFileAsset (asset, asset->key_id(), asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point)
58 {
59 
60 }
61 
62 
63 ReelAtmosAsset::ReelAtmosAsset (std::shared_ptr<const cxml::Node> node)
64  : ReelFileAsset (node)
65 {
66  node->ignore_child ("DataType");
67  node->done ();
68 }
69 
70 
71 string
72 ReelAtmosAsset::cpl_node_name (Standard) const
73 {
74  return "axd:AuxData";
75 }
76 
77 
78 pair<string, string>
80 {
81  return { "http://www.dolby.com/schemas/2012/AD", "axd" };
82 }
83 
84 
85 xmlpp::Node *
86 ReelAtmosAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
87 {
88  auto asset = ReelFileAsset::write_to_cpl (node, standard);
89  asset->add_child("axd:DataType")->add_child_text("urn:smpte:ul:060e2b34.04010105.0e090604.00000000");
90  return asset;
91 }
92 
93 
94 bool
95 ReelAtmosAsset::equals (shared_ptr<const ReelAtmosAsset> other, EqualityOptions opt, NoteHandler note) const
96 {
97  if (!asset_equals (other, opt, note)) {
98  return false;
99  }
100 
101  if (!file_asset_equals (other, opt, note)) {
102  return false;
103  }
104 
105  return true;
106 }
AtmosAsset class.
std::pair< std::string, std::string > cpl_node_namespace() const override
Namespace for everything in libdcp.
Definition: array_data.h:50
ReelAtmosAsset class.
A class to describe what "equality" means for a particular test.
Definition: types.h:249