Build fixes for Boost >= 1.73
[dcpomatic.git] / src / wx / timeline_dialog.cc
index d2194f5c750b16e09bbd7680c97809bfc3940fbd..261177e36815e55b2a8d7ad52f812892ffbed585 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -33,10 +33,14 @@ using std::list;
 using std::cout;
 using std::string;
 using boost::shared_ptr;
+using boost::weak_ptr;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
-TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film)
+TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
        : wxDialog (
-               cp->panel(),
+               cp->window(),
                wxID_ANY,
                _("Timeline"),
                wxDefaultPosition,
@@ -51,7 +55,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film)
 #endif
                )
        , _film (film)
-       , _timeline (this, cp, film)
+       , _timeline (this, cp, film, viewer)
 {
        wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
 
@@ -87,21 +91,18 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film)
        sizer->SetSizeHints (this);
 
         _toolbar->ToggleTool ((int) Timeline::SNAP, _timeline.snap ());
-       film_changed (Film::SEQUENCE);
-
-       _film_changed_connection = film->Changed.connect (bind (&TimelineDialog::film_changed, this, _1));
-}
+       film_change (CHANGE_TYPE_DONE, Film::SEQUENCE);
 
-wxString
-TimelineDialog::bitmap_path (string name)
-{
-       boost::filesystem::path p = shared_path() / String::compose("%1.png", name);
-       return std_to_wx (p.string());
+       _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2));
 }
 
 void
-TimelineDialog::film_changed (Film::Property p)
+TimelineDialog::film_change (ChangeType type, Film::Property p)
 {
+       if (type != CHANGE_TYPE_DONE) {
+               return;
+       }
+
        shared_ptr<Film> film = _film.lock ();
        if (!film) {
                return;