diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-12 22:10:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | 6f344b876689a1234a5eb75041882f06f5d9fe5c (patch) | |
| tree | 3a51f17cab8b8f31b21661b643aaed6a53326031 /src/tools | |
| parent | 36774ee2b48f0bfde43b743592e5816ff58bb7d2 (diff) | |
Reasonably straightforward stuff; main things are adding
a _parent to VideoContent (mainly, but not only, for signalling)
and moving the video shared_ptr into Content, which makes much
more sense to replace dynamic_cast tests for whether something
has video or whatever. Nearly builds.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 13 | ||||
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index f336f0a85..edc44ee66 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -41,6 +41,7 @@ #include "lib/config.h" #include "lib/util.h" #include "lib/video_content.h" +#include "lib/content.h" #include "lib/version.h" #include "lib/signal_manager.h" #include "lib/log.h" @@ -585,17 +586,17 @@ private: void content_scale_to_fit_width () { - VideoContentList vc = _film_editor->content_panel()->selected_video (); - for (VideoContentList::iterator i = vc.begin(); i != vc.end(); ++i) { - (*i)->scale_and_crop_to_fit_width (); + ContentList vc = _film_editor->content_panel()->selected_video (); + for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) { + (*i)->video->scale_and_crop_to_fit_width (); } } void content_scale_to_fit_height () { - VideoContentList vc = _film_editor->content_panel()->selected_video (); - for (VideoContentList::iterator i = vc.begin(); i != vc.end(); ++i) { - (*i)->scale_and_crop_to_fit_height (); + ContentList vc = _film_editor->content_panel()->selected_video (); + for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) { + (*i)->video->scale_and_crop_to_fit_height (); } } diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 2911be0a7..0e5bee70a 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 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 @@ -27,6 +27,7 @@ #include "lib/dcp_content_type.h" #include "lib/ratio.h" #include "lib/image_content.h" +#include "lib/video_content.h" #include <libxml++/libxml++.h> #include <boost/filesystem.hpp> #include <getopt.h> @@ -215,9 +216,8 @@ main (int argc, char* argv[]) for (int i = optind; i < argc; ++i) { shared_ptr<Content> c = content_factory (film, boost::filesystem::canonical (argv[i])); - shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c); - if (vc) { - vc->set_scale (VideoContentScale (content_ratio)); + if (c->video) { + c->video->set_scale (VideoContentScale (content_ratio)); } film->examine_and_add_content (c); } @@ -231,7 +231,7 @@ main (int argc, char* argv[]) for (ContentList::iterator i = content.begin(); i != content.end(); ++i) { shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i); if (ic) { - ic->set_video_length (still_length * 24); + ic->video->set_video_length (still_length * 24); } } |
