std::shared_ptr
[dcpomatic.git] / src / lib / playlist.cc
index 9e96c693a529679b197ae66e0ba6c67d8a2fc248..287f23fd4f929bb368cf691c225ac22f34f4248c 100644 (file)
@@ -34,7 +34,7 @@
 #include "compose.hpp"
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
-#include <boost/shared_ptr.hpp>
+#include <boost/bind/placeholders.hpp>
 #include <boost/foreach.hpp>
 #include <iostream>
 
@@ -48,10 +48,13 @@ using std::max;
 using std::string;
 using std::pair;
 using boost::optional;
-using boost::shared_ptr;
-using boost::weak_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::weak_ptr;
+using std::dynamic_pointer_cast;
 using namespace dcpomatic;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 Playlist::Playlist ()
        : _sequence (true)
@@ -70,13 +73,6 @@ Playlist::~Playlist ()
 void
 Playlist::content_change (weak_ptr<const Film> weak_film, ChangeType type, weak_ptr<Content> content, int property, bool frequent)
 {
-       /* Make sure we only hear about atomic changes (e.g. a PENDING always with the DONE/CANCELLED)
-          Ignore any DONE/CANCELLED that arrives without a PENDING.
-       */
-       if (_checker.send (type, property)) {
-               return;
-       }
-
        shared_ptr<const Film> film = weak_film.lock ();
        DCPOMATIC_ASSERT (film);
 
@@ -111,8 +107,11 @@ Playlist::content_change (weak_ptr<const Film> weak_film, ChangeType type, weak_
                        }
 
                        if (changed) {
-                               OrderChanged ();
+                               OrderChange ();
                        }
+
+                       /* The length might have changed, and that's good enough for this signal */
+                       LengthChange ();
                }
        }
 
@@ -281,6 +280,8 @@ Playlist::add (shared_ptr<const Film> film, shared_ptr<Content> c)
        }
 
        Change (CHANGE_TYPE_DONE);
+
+       LengthChange ();
 }
 
 void
@@ -312,6 +313,8 @@ Playlist::remove (shared_ptr<Content> c)
        }
 
        /* This won't change order, so it does not need a sort */
+
+       LengthChange ();
 }
 
 void
@@ -334,9 +337,11 @@ Playlist::remove (ContentList c)
                }
        }
 
+       Change (CHANGE_TYPE_DONE);
+
        /* This won't change order, so it does not need a sort */
 
-       Change (CHANGE_TYPE_DONE);
+       LengthChange ();
 }
 
 class FrameRateCandidate