diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-31 16:10:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-31 16:10:35 +0100 |
| commit | 8924ad6077ecb84385ecdcd244921af2dc34f9fb (patch) | |
| tree | 2dffaf46649e5344eae88e4a7e01bcb733d744a4 /src/asset_instance.cc | |
| parent | 9c06ca9b86fa06e09caf44f7fe8316e477aac700 (diff) | |
Add MainPicture etc. AssetInstances.
Diffstat (limited to 'src/asset_instance.cc')
| -rw-r--r-- | src/asset_instance.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/asset_instance.cc b/src/asset_instance.cc index 45f8caf2..6107cfda 100644 --- a/src/asset_instance.cc +++ b/src/asset_instance.cc @@ -19,7 +19,9 @@ #include <libcxml/cxml.h> #include "asset_instance.h" +#include "exceptions.h" +using std::bad_cast; using boost::shared_ptr; using namespace libdcp; @@ -38,3 +40,22 @@ AssetInstance::AssetInstance (shared_ptr<const cxml::Node> node) node->done (); } + +Picture::Picture (shared_ptr<const cxml::Node> node) + : AssetInstance (node) +{ + frame_rate = Fraction (node->string_child ("FrameRate")); + + try { + screen_aspect_ratio = Fraction (node->string_child ("ScreenAspectRatio")); + } catch (XMLError& e) { + /* Maybe it's not a fraction */ + } + + try { + float f = node->number_child<float> ("ScreenAspectRatio"); + screen_aspect_ratio = Fraction (f * 1000, 1000); + } catch (bad_cast& e) { + + } +} |
