aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/ReplayManager.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
commit23196be83778973d9688cc5d465e4e4a16476568 (patch)
tree91dee3b2c2e05d3b529cf537d12a7faf7ec21dc1 /src/crepe/manager/ReplayManager.cpp
parent297d621987c224db26eadfb9bde9235741387496 (diff)
add documentation
Diffstat (limited to 'src/crepe/manager/ReplayManager.cpp')
-rw-r--r--src/crepe/manager/ReplayManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/crepe/manager/ReplayManager.cpp b/src/crepe/manager/ReplayManager.cpp
index ab8a5a0..db6acb0 100644
--- a/src/crepe/manager/ReplayManager.cpp
+++ b/src/crepe/manager/ReplayManager.cpp
@@ -38,6 +38,9 @@ void ReplayManager::release(recording_t handle) {
}
void ReplayManager::frame_record() {
+ if (this->state != RECORDING)
+ throw runtime_error("ReplayManager: frame_step called while not playing");
+
ComponentManager & components = this->mediator.component_manager;
Recording & recording = this->recording;
@@ -46,6 +49,9 @@ void ReplayManager::frame_record() {
}
bool ReplayManager::frame_step() {
+ if (this->state != PLAYING)
+ throw runtime_error("ReplayManager: frame_step called while not playing");
+
ComponentManager & components = this->mediator.component_manager;
Recording & recording = this->recording;
@@ -58,6 +64,7 @@ bool ReplayManager::frame_step() {
// end of recording
recording.frame = 0;
this->state = IDLE;
+ this->recording.clear();
return true;
}