aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/manager/ReplayManager.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 18:46:34 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 18:46:34 +0100
commitf34daa492c30a0d28b747817a9f2d6fb0186cf80 (patch)
tree2c2501968f12e379ac196abb4161527d86a351e5 /src/crepe/manager/ReplayManager.h
parentb9694e8cc6b85a0089f97ff3c21862adc75a7ee5 (diff)
clean up ReplayManager API
Diffstat (limited to 'src/crepe/manager/ReplayManager.h')
-rw-r--r--src/crepe/manager/ReplayManager.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/crepe/manager/ReplayManager.h b/src/crepe/manager/ReplayManager.h
index 672d093..5794761 100644
--- a/src/crepe/manager/ReplayManager.h
+++ b/src/crepe/manager/ReplayManager.h
@@ -15,33 +15,34 @@ typedef size_t recording_t;
class ReplayManager : public Manager {
public:
ReplayManager(Mediator & mediator);
- friend class ReplaySystem;
-
-protected:
- void record_frame();
-
-private:
- struct Recording {
- size_t frame = 0;
- std::vector<ComponentManager::Snapshot> frames;
- };
+public:
+ void record_start();
+ recording_t record_end();
+ void play(recording_t handle);
+ void release(recording_t handle);
+
+public:
enum State {
IDLE,
RECORDING,
PLAYING,
};
+ State get_state() const;
+public:
+ void frame_record();
+ bool frame_step();
+
+private:
+ struct Recording {
+ size_t frame = 0;
+ std::vector<ComponentManager::Snapshot> frames;
+ };
State state = IDLE;
OptionalRef<Recording> recording;
recording_t id = -1;
-
std::unordered_map<recording_t, std::unique_ptr<Recording>> memory;
-public:
- void record_start();
- recording_t record_end();
- void play(recording_t handle);
- void release(recording_t handle);
};
} // namespace crepe