diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-31 16:05:59 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-31 16:05:59 +0100 |
| commit | 9c06ca9b86fa06e09caf44f7fe8316e477aac700 (patch) | |
| tree | 72117098df7167e94b64e6aa6ba372b0581d3842 /src | |
| parent | 7592dfb07d20667cf235ab9c30ebfe76e92c5e16 (diff) | |
Basic AssetInstance.
Diffstat (limited to 'src')
| -rw-r--r-- | src/asset_instance.cc | 40 | ||||
| -rw-r--r-- | src/asset_instance.h | 49 | ||||
| -rw-r--r-- | src/wscript | 1 |
3 files changed, 90 insertions, 0 deletions
diff --git a/src/asset_instance.cc b/src/asset_instance.cc new file mode 100644 index 00000000..45f8caf2 --- /dev/null +++ b/src/asset_instance.cc @@ -0,0 +1,40 @@ +/* + Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <libcxml/cxml.h> +#include "asset_instance.h" + +using boost::shared_ptr; +using namespace libdcp; + +AssetInstance::AssetInstance (shared_ptr<const cxml::Node> node) +{ + id = node->string_child ("Id"); + annotation_text = node->optional_string_child ("AnnotationText").get_value_or (""); + edit_rate = Fraction (node->string_child ("EditRate")); + intrinsic_duration = node->number_child<int64_t> ("IntrinsicDuration"); + entry_point = node->number_child<int64_t> ("EntryPoint"); + duration = node->number_child<int64_t> ("Duration"); + key_id = node->optional_string_child ("KeyId").get_value_or (""); + + node->ignore_child ("Hash"); + node->ignore_child ("Language"); + + node->done (); +} diff --git a/src/asset_instance.h b/src/asset_instance.h new file mode 100644 index 00000000..9efbcb4d --- /dev/null +++ b/src/asset_instance.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <boost/shared_ptr.hpp> +#include "types.h" + +namespace cxml { + class Node; +} + +namespace libdcp { + +class AssetInstance +{ +public: + AssetInstance () + : intrinsic_duration (0) + , entry_point (0) + , duration (0) + {} + + AssetInstance (boost::shared_ptr<const cxml::Node>); + + std::string id; + std::string annotation_text; + Fraction edit_rate; + int64_t intrinsic_duration; + int64_t entry_point; + int64_t duration; + std::string key_id; +}; + +} diff --git a/src/wscript b/src/wscript index 98b0169b..cded0ce4 100644 --- a/src/wscript +++ b/src/wscript @@ -12,6 +12,7 @@ def build(bld): obj.source = """ argb_frame.cc asset.cc + asset_instance.cc certificates.cc colour_matrix.cc crypt_chain.cc |
