#include <libxml++/libxml++.h>
#include <boost/shared_ptr.hpp>
#include <boost/foreach.hpp>
+#include <iostream>
#include "i18n.h"
if (vc->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
vc->set_position (next_right);
- next_right = vc->end() + DCPTime::delta ();
+ next_right = vc->end();
} else {
vc->set_position (next_left);
- next_left = vc->end() + DCPTime::delta ();
+ next_left = vc->end();
}
}
{
list<int> const allowed_dcp_frame_rates = Config::instance()->allowed_dcp_frame_rates ();
- /* Work out what rates we could manage, including those achieved by using skip / repeat. */
+ /* Work out what rates we could manage, including those achieved by using skip / repeat */
list<FrameRateCandidate> candidates;
/* Start with the ones without skip / repeat so they will get matched in preference to skipped/repeated ones */
float this_error = 0;
BOOST_FOREACH (shared_ptr<Content> j, _content) {
shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (j);
- if (!vc) {
+ if (!vc || !vc->has_own_video_frame_rate()) {
continue;
}
return best->dcp;
}
+/** @return length of the playlist from time 0 to the last thing on the playlist */
DCPTime
Playlist::length () const
{
return len;
}
+/** @return position of the first thing on the playlist, if it's not empty */
+optional<DCPTime>
+Playlist::start () const
+{
+ if (_content.empty ()) {
+ return optional<DCPTime> ();
+ }
+
+ DCPTime start = DCPTime::max ();
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ start = min (start, i->position ());
+ }
+
+ return start;
+}
+
void
Playlist::reconnect ()
{
return a->position() < b->position();
}
-/** @return content in an undefined order */
+/** @return content in ascending order of position */
ContentList
Playlist::content () const
{