summaryrefslogtreecommitdiff
path: root/src/lib/playlist.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-08 01:10:38 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-14 10:21:14 +0100
commitd22e839b94af048bdeaba61e427bcd2f07b4a3ee (patch)
tree18f37e00d1a5a64c0426588fa530bcffb14e66a3 /src/lib/playlist.cc
parent4704d088ae03ab2b5f73ceed577fd84935ad0640 (diff)
Fix analysis of audio when the subject is later in the playlist than
some other long piece of content. Small optimisation to AudioBuffers to extend size logarithmically.
Diffstat (limited to 'src/lib/playlist.cc')
-rw-r--r--src/lib/playlist.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index a1b209a11..4aff1015d 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -263,6 +263,7 @@ Playlist::best_dcp_frame_rate () const
return best->dcp;
}
+/** @return length of the playlist from time 0 to the last thing on the playlist */
DCPTime
Playlist::length () const
{
@@ -274,6 +275,22 @@ 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 ()
{