Gainput
v1.0.0
lib
include
gainput
recorder
GainputInputRecorder.h
1
2
#ifndef GAINPUTINPUTRECORDER_H_
3
#define GAINPUTINPUTRECORDER_H_
4
5
#ifdef GAINPUT_ENABLE_RECORDER
6
7
namespace
gainput
8
{
9
11
15
class
GAINPUT_LIBEXPORT
InputRecorder
16
{
17
public
:
19
22
InputRecorder
(
InputManager
& manager);
24
~
InputRecorder
();
25
27
31
void
Start();
33
void
Stop();
35
bool
IsRecording
()
const
{
return
isRecording_; }
36
38
42
void
AddDeviceToRecord
(
DeviceId
device) { recordedDevices_[device] =
true
; }
44
47
bool
IsDeviceToRecord
(
DeviceId
device) {
return
recordedDevices_.empty() || recordedDevices_.count(device) > 0; }
48
50
InputRecording
*
GetRecording
() {
return
recording_; }
52
const
InputRecording
*
GetRecording
()
const
{
return
recording_; }
54
uint64_t
GetStartTime
()
const
{
return
startTime_; }
55
56
private
:
57
InputManager
& manager_;
58
59
bool
isRecording_;
60
InputListener
* recordingListener_;
61
ListenerId
recordingListenerId_;
62
InputRecording
* recording_;
63
uint64_t startTime_;
64
HashMap<DeviceId, bool>
recordedDevices_;
65
66
};
67
68
}
69
70
#endif
71
72
#endif
73
gainput::InputRecording
A recorded sequence of input changes.
Definition:
GainputInputRecording.h:39
gainput::InputRecorder::AddDeviceToRecord
void AddDeviceToRecord(DeviceId device)
Adds a device to record the button state changes of.
Definition:
GainputInputRecorder.h:42
gainput::InputRecorder::IsRecording
bool IsRecording() const
Returns if the recorder is currently recording.
Definition:
GainputInputRecorder.h:35
gainput::InputRecorder::GetRecording
const InputRecording * GetRecording() const
Returns the recording that is being recorded to, may be 0.
Definition:
GainputInputRecorder.h:52
gainput::InputManager
Manages all input devices and some other helpful stuff.
Definition:
GainputInputManager.h:24
gainput::InputRecorder::IsDeviceToRecord
bool IsDeviceToRecord(DeviceId device)
Returns if the given device should be recorded.
Definition:
GainputInputRecorder.h:47
gainput::InputRecorder::GetStartTime
uint64_t GetStartTime() const
Returns the time the recording was started.
Definition:
GainputInputRecorder.h:54
gainput::InputRecorder
Records a sequence of button state changes.
Definition:
GainputInputRecorder.h:15
gainput::InputListener
Listener interface that allows to receive notifications when device button states change...
Definition:
GainputInputListener.h:9
gainput::HashMap< DeviceId, bool >
gainput::DeviceId
unsigned int DeviceId
ID of an input device.
Definition:
gainput.h:107
gainput::ListenerId
unsigned int ListenerId
ID of an input listener.
Definition:
gainput.h:123
gainput::InputRecorder::GetRecording
InputRecording * GetRecording()
Returns the recording that is being recorded to, may be 0.
Definition:
GainputInputRecorder.h:50
gainput
Contains all Gainput related classes, types, and functions.
Definition:
gainput.h:103
Generated on Wed Sep 6 2017 20:47:59 for Gainput by
1.8.13