projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix failure to save screen notes when making a new one (github bug #6).
[dcpomatic.git]
/
src
/
lib
/
empty.cc
diff --git
a/src/lib/empty.cc
b/src/lib/empty.cc
index 2233b43426e7d859875fae85792c693d5d04f832..206acfdb0a67d62131bb11c688906e68f01b49e2 100644
(file)
--- a/
src/lib/empty.cc
+++ b/
src/lib/empty.cc
@@
-19,11
+19,13
@@
*/
#include "empty.h"
*/
#include "empty.h"
+#include "film.h"
#include "playlist.h"
#include "content.h"
#include "content_part.h"
#include "dcp_content.h"
#include "dcpomatic_time_coalesce.h"
#include "playlist.h"
#include "content.h"
#include "content_part.h"
#include "dcp_content.h"
#include "dcpomatic_time_coalesce.h"
+#include "piece.h"
#include <boost/foreach.hpp>
#include <iostream>
#include <boost/foreach.hpp>
#include <iostream>
@@
-32,17
+34,22
@@
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::function;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::function;
+using namespace dcpomatic;
-Empty::Empty (shared_ptr<const
Playlist> playlist, function<shared_ptr<ContentPart> (Content *
)> part)
+Empty::Empty (shared_ptr<const
Film> film, list<shared_ptr<Piece> > pieces, function<bool (shared_ptr<Piece>
)> part)
{
list<DCPTimePeriod> full;
{
list<DCPTimePeriod> full;
- BOOST_FOREACH (shared_ptr<
Content> i, playlist->content()
) {
- if (part
(i.get()
)) {
- full.push_back (DCPTimePeriod (i->
position(), i->end(
)));
+ BOOST_FOREACH (shared_ptr<
Piece> i, pieces
) {
+ if (part
(i
)) {
+ full.push_back (DCPTimePeriod (i->
content->position(), i->content->end(film
)));
}
}
}
}
- _periods = subtract (DCPTimePeriod(DCPTime(), playlist->length()), coalesce(full));
+ _periods = subtract (DCPTimePeriod(DCPTime(), film->length()), coalesce(full));
+
+ if (!_periods.empty ()) {
+ _position = _periods.front().from;
+ }
}
void
}
void
@@
-79,11
+86,10
@@
Empty::period_at_position () const
bool
Empty::done () const
{
bool
Empty::done () const
{
+ DCPTime latest;
BOOST_FOREACH (DCPTimePeriod i, _periods) {
BOOST_FOREACH (DCPTimePeriod i, _periods) {
- if (i.contains(_position)) {
- return false;
- }
+ latest = max (latest, i.to);
}
}
- return
true
;
+ return
_position >= latest
;
}
}