summaryrefslogtreecommitdiff
path: root/src/lib/moving_image_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-22 15:49:54 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-22 15:49:54 +0000
commitaf474db6af17d468b42fbae8bd4c3e80dcfd0588 (patch)
treee7cf2ccb4d14d7121a9a65f5989e4bc66275737d /src/lib/moving_image_content.cc
parent68808da4a0f8c60ac93cd0bbc3ea776d16503a6a (diff)
Make MovingImageContent use Content::_paths rather than its own _files list.
Diffstat (limited to 'src/lib/moving_image_content.cc')
-rw-r--r--src/lib/moving_image_content.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lib/moving_image_content.cc b/src/lib/moving_image_content.cc
index dd486b0a7..23d18240b 100644
--- a/src/lib/moving_image_content.cc
+++ b/src/lib/moving_image_content.cc
@@ -35,20 +35,23 @@ using std::vector;
using boost::shared_ptr;
MovingImageContent::MovingImageContent (shared_ptr<const Film> f, boost::filesystem::path p)
- : Content (f, p)
- , VideoContent (f, p)
+ : Content (f)
+ , VideoContent (f)
{
+ for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
+ if (boost::filesystem::is_regular_file (i->path()) && valid_image_file (i->path())) {
+ _paths.push_back (i->path ());
+ }
+ }
+ sort (_paths.begin(), _paths.end());
}
MovingImageContent::MovingImageContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
: Content (f, node)
, VideoContent (f, node)
{
- list<cxml::NodePtr> c = node->node_children ("File");
- for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
- _files.push_back ((*i)->content ());
- }
+
}
string
@@ -72,10 +75,6 @@ MovingImageContent::as_xml (xmlpp::Node* node) const
node->add_child("Type")->add_child_text ("MovingImage");
Content::as_xml (node);
VideoContent::as_xml (node);
-
- for (vector<boost::filesystem::path>::const_iterator i = _files.begin(); i != _files.end(); ++i) {
- node->add_child("File")->add_child_text (i->filename().string());
- }
}
void
@@ -92,8 +91,7 @@ MovingImageContent::examine (shared_ptr<Job> job)
take_from_video_examiner (examiner);
- _video_length = examiner->files().size ();
- _files = examiner->files ();
+ _video_length = number_of_paths ();
}
Time