Remove unused lambda capture.
[dcpomatic.git] / src / wx / player_stress_tester.cc
index c0e6e8443f2c5640876e613a17250b7ce2931005..2593757270a075f10f1c4b4788d23c9ec9705249 100644 (file)
 
 */
 
-#include "player_stress_tester.h"
+
 #include "controls.h"
+#include "player_stress_tester.h"
 #include <dcp/raw_convert.h>
 #include <dcp/util.h>
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
+#include <iostream>
 #include <string>
 #include <vector>
-#include <iostream>
 
+
+using std::cout;
 using std::string;
 using std::vector;
-using std::cout;
 using dcp::raw_convert;
 using boost::optional;
 
+
 /* Interval to check for things to do with the stress script (in milliseconds) */
 #define CHECK_INTERVAL 20
 
+
 Command::Command (string line)
        : type (NONE)
        , int_param (0)
@@ -67,6 +73,8 @@ Command::Command (string line)
                }
                type = SEEK;
                int_param = raw_convert<int>(bits[1]);
+       } else if (bits[0] == "E") {
+               type = EXIT;
        }
 }
 
@@ -97,7 +105,7 @@ PlayerStressTester::load_script (boost::filesystem::path file)
        vector<string> lines;
        string const script = dcp::file_to_string(file);
        boost::split (lines, script, boost::is_any_of("\n"));
-       BOOST_FOREACH (string i, lines) {
+       for (auto i: lines) {
                _commands.push_back (Command(i));
        }
        _current_command = _commands.begin();
@@ -156,6 +164,9 @@ PlayerStressTester::check_commands ()
                        _controls->seek (_current_command->int_param);
                        ++_current_command;
                        break;
+               case Command::EXIT:
+                       wxTheApp->GetTopWindow()->Destroy();
+                       break;
        }
 }