*/
-#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)
}
type = SEEK;
int_param = raw_convert<int>(bits[1]);
+ } else if (bits[0] == "E") {
+ type = EXIT;
}
}
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();
_controls->seek (_current_command->int_param);
++_current_command;
break;
+ case Command::EXIT:
+ wxTheApp->GetTopWindow()->Destroy();
+ break;
}
}