+ ;
+ PostMessage(s.str());
+}
+
+void Interface::ToggleAudio() {
+ config.audio_disabled = !config.audio_disabled;
+ if (config.audio_disabled) {
+ PostMessage("audio off");
+ } else {
+ PostMessage("audio on");
+ }
+}
+
+void Interface::ToggleVisual() {
+ config.visual_disabled = !config.visual_disabled;
+ if (config.visual_disabled) {
+ PostMessage("visual off");
+ } else {
+ PostMessage("visual on");
+ }
+}
+
+void Interface::ToggleDebug() {
+ counter_text.Toggle();
+ position_text.Toggle();
+ if (counter_text.Visible()) {
+ UpdateCounter();
+ UpdatePosition();
+ }
+}
+
+void Interface::UpdateCounter() {
+ std::stringstream s;
+ s << std::setprecision(3) <<
+ "avg: " << counter.Average().running << "ms, "
+ "peak: " << counter.Peak().running << "ms";
+ std::string text = s.str();
+ counter_text.Set(font, text);
+}
+
+void Interface::UpdatePosition() {
+ std::stringstream s;
+ s << std::setprecision(3) << "pos: " << ctrl.Controlled().AbsolutePosition();
+ position_text.Set(font, s.str());