Gainput
v1.0.0
lib
include
gainput
recorder
GainputInputRecording.h
1
2
#ifndef GAINPUTINPUTRECORDING_H_
3
#define GAINPUTINPUTRECORDING_H_
4
5
#ifdef GAINPUT_ENABLE_RECORDER
6
7
namespace
gainput
8
{
9
11
struct
GAINPUT_LIBEXPORT
RecordedDeviceButtonChange
12
{
14
uint64_t
time
;
16
DeviceId
deviceId
;
18
DeviceButtonId
buttonId
;
19
20
union
21
{
23
bool
b
;
25
float
f
;
26
};
27
};
28
30
39
class
GAINPUT_LIBEXPORT
InputRecording
40
{
41
public
:
43
46
InputRecording
(
Allocator
& allocator =
GetDefaultAllocator
());
48
57
InputRecording
(
InputManager
& manager,
void
* data,
size_t
size,
Allocator
& allocator =
GetDefaultAllocator
());
58
60
69
void
AddChange(uint64_t time,
DeviceId
deviceId,
DeviceButtonId
buttonId,
bool
value);
71
80
void
AddChange(uint64_t time,
DeviceId
deviceId,
DeviceButtonId
buttonId,
float
value);
81
83
void
Clear();
84
86
91
bool
GetNextChange(uint64_t time,
RecordedDeviceButtonChange
& outChange);
93
97
void
Reset
() { position_ = 0; }
98
100
uint64_t GetDuration()
const
;
101
103
size_t
GetSerializedSize()
const
;
105
111
void
GetSerialized(
InputManager
& manager,
void
* data)
const
;
112
113
private
:
114
Array<RecordedDeviceButtonChange>
changes_;
115
117
unsigned
position_;
118
};
119
120
}
121
122
#endif
123
124
#endif
125
gainput::InputRecording
A recorded sequence of input changes.
Definition:
GainputInputRecording.h:39
gainput::Array
A std::vector-like data container for POD-types.
Definition:
GainputContainers.h:96
gainput::InputManager
Manages all input devices and some other helpful stuff.
Definition:
GainputInputManager.h:24
gainput::RecordedDeviceButtonChange::buttonId
DeviceButtonId buttonId
The ID of the button that changed.
Definition:
GainputInputRecording.h:18
gainput::GetDefaultAllocator
GAINPUT_LIBEXPORT DefaultAllocator & GetDefaultAllocator()
Returns the default instance of the default allocator.
gainput::RecordedDeviceButtonChange::time
uint64_t time
The time at which the change occurred.
Definition:
GainputInputRecording.h:14
gainput::RecordedDeviceButtonChange
A single recorded change for a device button.
Definition:
GainputInputRecording.h:11
gainput::RecordedDeviceButtonChange::f
float f
If the button's type is BT_FLOAT, this contains the new value.
Definition:
GainputInputRecording.h:25
gainput::DeviceId
unsigned int DeviceId
ID of an input device.
Definition:
gainput.h:107
gainput::RecordedDeviceButtonChange::deviceId
DeviceId deviceId
The ID of the device owning the button that changed.
Definition:
GainputInputRecording.h:16
gainput::InputRecording::Reset
void Reset()
Resets the playback position.
Definition:
GainputInputRecording.h:97
gainput::RecordedDeviceButtonChange::b
bool b
If the button's type is BT_BOOL, this contains the new value.
Definition:
GainputInputRecording.h:23
gainput::DeviceButtonId
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition:
gainput.h:109
gainput::Allocator
Interface used to pass custom allocators to the library.
Definition:
GainputAllocator.h:16
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