Handle pending player changes more efficiently.
[dcpomatic.git] / src / wx / audio_plot.cc
index b8b14b2e699762ac0a061b8dbcd9474bfbe8c075..cb10908df821b432dc68692b51c9e1e67fdcc283 100644 (file)
@@ -25,7 +25,7 @@
 #include "lib/audio_analysis.h"
 #include "lib/compose.hpp"
 #include <wx/graphics.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
 #include <iostream>
 #include <cfloat>
 
@@ -37,8 +37,11 @@ using std::min;
 using std::map;
 using boost::bind;
 using boost::optional;
-using boost::shared_ptr;
-using boost::weak_ptr;
+using std::shared_ptr;
+using std::weak_ptr;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
 using namespace dcpomatic;
 
 int const AudioPlot::_minimum = -70;
@@ -307,7 +310,7 @@ AudioPlot::plot_peak (wxGraphicsPath& path, int channel, Metrics const & metrics
        DCPOMATIC_ASSERT (_peak.find(channel) != _peak.end());
 
        path.MoveToPoint (_peak[channel][0].draw);
-       BOOST_FOREACH (Point const & i, _peak[channel]) {
+       for (auto const& i: _peak[channel]) {
                path.AddLineToPoint (i.draw);
        }
 }
@@ -376,7 +379,7 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel, Metrics const & metrics)
        DCPOMATIC_ASSERT (_rms.find(channel) != _rms.end());
 
        path.MoveToPoint (_rms[channel][0].draw);
-       BOOST_FOREACH (Point const & i, _rms[channel]) {
+       for (auto const& i: _rms[channel]) {
                path.AddLineToPoint (i.draw);
        }
 }
@@ -422,7 +425,7 @@ void
 AudioPlot::search (map<int, PointList> const & search, wxMouseEvent const & ev, double& min_dist, Point& min_point) const
 {
        for (map<int, PointList>::const_iterator i = search.begin(); i != search.end(); ++i) {
-               BOOST_FOREACH (Point const & j, i->second) {
+               for (auto const& j: i->second) {
                        double const dist = pow(ev.GetX() - j.draw.x, 2) + pow(ev.GetY() - j.draw.y, 2);
                        if (dist < min_dist) {
                                min_dist = dist;