src/gba/gba-rr.h (view raw)
1#ifndef GBA_RR_H
2#define GBA_RR_H
3
4#include "common.h"
5
6struct GBA;
7struct VDir;
8struct VFile;
9
10struct GBARRContext {
11 // Playback state
12 bool isPlaying;
13 size_t inputId;
14
15 // Recording state
16 bool isRecording;
17 bool inputThisFrame;
18
19 // Metadata
20 uint32_t frames;
21 uint32_t lagFrames;
22
23 // Streaming state
24 struct VDir* streamDir;
25 struct VFile* inputsStream;
26};
27
28void GBARRContextCreate(struct GBA*);
29void GBARRContextDestroy(struct GBA*);
30
31bool GBARRSetStream(struct GBARRContext*, struct VDir*);
32
33bool GBARRStartPlaying(struct GBARRContext*);
34void GBARRStopPlaying(struct GBARRContext*);
35bool GBARRStartRecording(struct GBARRContext*);
36void GBARRStopRecording(struct GBARRContext*);
37
38bool GBARRIsPlaying(struct GBARRContext*);
39bool GBARRIsRecording(struct GBARRContext*);
40
41void GBARRNextFrame(struct GBARRContext*);
42void GBARRLogInput(struct GBARRContext*, uint16_t input);
43uint16_t GBARRQueryInput(struct GBARRContext*);
44
45#endif