std::shared_ptr
[dcpomatic.git] / src / wx / timeline.cc
index 9f71847f5c626dfb7e39690c91010e19d4f54252..054eac734f5afdc00f465b5826f344ea7f6d77a8 100644 (file)
@@ -39,7 +39,6 @@
 #include "lib/video_content.h"
 #include "lib/atmos_mxf_content.h"
 #include <wx/graphics.h>
-#include <boost/weak_ptr.hpp>
 #include <boost/foreach.hpp>
 #include <list>
 #include <iterator>
@@ -50,12 +49,15 @@ using std::cout;
 using std::min;
 using std::max;
 using std::abs;
-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 boost::bind;
 using boost::optional;
 using namespace dcpomatic;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 
 /* 3 hours in 640 pixels */
 double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3);
@@ -262,8 +264,8 @@ Timeline::recreate_views ()
                        _views.push_back (shared_ptr<TimelineView> (new TimelineTextContentView (*this, i, j)));
                }
 
-               if (dynamic_pointer_cast<AtmosMXFContent> (i)) {
-                       _views.push_back (shared_ptr<TimelineView> (new TimelineAtmosContentView (*this, i)));
+               if (i->atmos) {
+                       _views.push_back (shared_ptr<TimelineView>(new TimelineAtmosContentView(*this, i)));
                }
        }
 
@@ -420,12 +422,9 @@ Timeline::assign_tracks ()
 
        bool have_atmos = false;
        BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
-               shared_ptr<TimelineVideoContentView> cv = dynamic_pointer_cast<TimelineVideoContentView> (i);
-               if (!cv) {
-                       continue;
-               }
-               if (dynamic_pointer_cast<TimelineAtmosContentView> (i)) {
-                       cv->set_track (_tracks - 1);
+               shared_ptr<TimelineAtmosContentView> cv = dynamic_pointer_cast<TimelineAtmosContentView>(i);
+               if (cv) {
+                       cv->set_track (_tracks);
                        have_atmos = true;
                }
        }