Gainput  v1.0.0
GainputInputPlayer.h
1 
2 #ifndef GAINPUTINPUTPLAYER_H_
3 #define GAINPUTINPUTPLAYER_H_
4 
5 #ifdef GAINPUT_ENABLE_RECORDER
6 
7 namespace gainput
8 {
9 
11 
15 class GAINPUT_LIBEXPORT InputPlayer : public DeviceStateModifier
16 {
17 public:
19 
23  InputPlayer(InputManager& manager, InputRecording* recording = 0);
25  ~InputPlayer();
26 
28  void Update(InputDeltaState* delta);
29 
31 
35  void Start();
37  void Stop();
39  bool IsPlaying() const { return isPlaying_; }
40 
42  void SetRecording(InputRecording* recording);
44  InputRecording* GetRecording() { return recording_; }
46  const InputRecording* GetRecording() const { return recording_; }
47 
48 private:
49  InputManager& manager_;
50 
51  bool isPlaying_;
52  InputRecording* recording_;
53  uint64_t startTime_;
54 
55  Array<DeviceId> devicesToReset_;
56 
57  ModifierId playingModifierId_;
58 };
59 
60 }
61 
62 #endif
63 
64 #endif
65 
A recorded sequence of input changes.
Definition: GainputInputRecording.h:39
const InputRecording * GetRecording() const
Returns the currently set recording.
Definition: GainputInputPlayer.h:46
Interface for modifiers that change device input states after they have been updated.
Definition: GainputInputManager.h:315
Manages all input devices and some other helpful stuff.
Definition: GainputInputManager.h:24
Stores a list of input state changes.
Definition: GainputInputDeltaState.h:9
Plays back a previously recorded sequence of device state changes.
Definition: GainputInputPlayer.h:15
unsigned int ModifierId
ID of a device state modifier.
Definition: gainput.h:125
InputRecording * GetRecording()
Returns the currently set recording.
Definition: GainputInputPlayer.h:44
bool IsPlaying() const
Returns if the player is currently playing.
Definition: GainputInputPlayer.h:39
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103