#include <libcxml/cxml.h>
#include <boost/shared_ptr.hpp>
-#include <boost/lexical_cast.hpp>
#include "playlist.h"
#include "sndfile_content.h"
#include "sndfile_decoder.h"
#include "job.h"
#include "config.h"
#include "util.h"
+#include "md5_digester.h"
#include "i18n.h"
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
-using boost::lexical_cast;
Playlist::Playlist ()
: _sequence_video (true)
}
}
- return md5_digest (t.c_str(), t.length());
+ MD5Digester digester;
+ digester.add (t.c_str(), t.length());
+ return digester.get ();
}
/** @param node <Playlist> node */
if (previous == _content.end ()) {
return;
}
+
Time const p = (*previous)->position ();
(*previous)->set_position (p + c->length_after_trim ());
c->set_position (p);
sort (_content.begin(), _content.end(), ContentSorter ());
-
- Changed ();
}
void
Time const p = (*next)->position ();
(*next)->set_position (c->position ());
- c->set_position (p + c->length_after_trim ());
+ c->set_position (c->position() + c->length_after_trim ());
sort (_content.begin(), _content.end(), ContentSorter ());
-
- Changed ();
+}
+
+FrameRateChange
+Playlist::active_frame_rate_change (Time t, int dcp_video_frame_rate) const
+{
+ for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
+ shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
+ if (!vc) {
+ continue;
+ }
+
+ if (vc->position() >= t && t < vc->end()) {
+ return FrameRateChange (vc->video_frame_rate(), dcp_video_frame_rate);
+ }
+ }
+
+ return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
}