#include "content_factory.h"
#include "ui_signaller.h"
#include "exceptions.h"
+#include "film.h"
#include "i18n.h"
}
-Content::Content (shared_ptr<const Film> f, Time p)
+Content::Content (shared_ptr<const Film> f, DCPTime p)
: _film (f)
, _position (p)
, _trim_start (0)
_paths.push_back ((*i)->content ());
}
_digest = node->string_child ("Digest");
- _position = node->number_child<Time> ("Position");
- _trim_start = node->number_child<Time> ("TrimStart");
- _trim_end = node->number_child<Time> ("TrimEnd");
+ _position = node->number_child<DCPTime> ("Position");
+ _trim_start = node->number_child<DCPTime> ("TrimStart");
+ _trim_end = node->number_child<DCPTime> ("TrimEnd");
}
Content::Content (shared_ptr<const Film> f, vector<shared_ptr<Content> > c)
if (i < (c.size() - 1) && c[i]->trim_end ()) {
throw JoinError (_("Only the last piece of content to be joined can have an end trim."));
}
+
+ for (size_t j = 0; j < c[i]->number_of_paths(); ++j) {
+ _paths.push_back (c[i]->path (j));
+ }
}
}
}
void
-Content::set_position (Time p)
+Content::set_position (DCPTime p)
{
{
boost::mutex::scoped_lock lm (_mutex);
}
void
-Content::set_trim_start (Time t)
+Content::set_trim_start (DCPTime t)
{
{
boost::mutex::scoped_lock lm (_mutex);
}
void
-Content::set_trim_end (Time t)
+Content::set_trim_end (DCPTime t)
{
{
boost::mutex::scoped_lock lm (_mutex);
xmlpp::Document doc;
xmlpp::Node* node = doc.create_root_node ("Content");
as_xml (node);
- return content_factory (film, cxml::NodePtr(new cxml::Node (node)));
+ return content_factory (film, cxml::NodePtr (new cxml::Node (node)), Film::state_version);
}
string
return String::compose ("%1 %2 %3", path_summary(), digest(), position());
}
-Time
+DCPTime
Content::length_after_trim () const
{
return full_length() - trim_start() - trim_end();
* @return true if this time is trimmed by our trim settings.
*/
bool
-Content::trimmed (Time t) const
+Content::trimmed (DCPTime t) const
{
return (t < trim_start() || t > (full_length() - trim_end ()));
}
}
bool
-Content::path_valid () const
+Content::paths_valid () const
{
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
if (!boost::filesystem::exists (*i)) {
{
/* XXX: should handle multiple paths more gracefully */
+ assert (number_of_paths ());
+
string s = path(0).filename().string ();
if (number_of_paths() > 1) {
s += " ...";