resonance 1.0.1
Loading...
Searching...
No Matches
metcommandrepeater.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "met/metscreen.h"
6
20public:
28
36
47 void Reset();
48
64 void Arm(const MetScreenCommand *pCommand, int nButton, int nPadIndex);
65
79 void Update(MetScreen *pPanel, const long long *pNowNanoseconds);
80
81private:
82 // One controller's repeat state. Twenty-four bytes.
83 struct Record {
84 // Only the delay and the time are initialised, which is what the constructor's prototype
85 // record writes.
86 Record() : mDelayMs(0), mLastNs(0) {
87 }
88
89 int mDelayMs; // +0x00 the initial delay still to run
90 int mButton; // +0x04
91 int mCommand; // +0x08 zero while disarmed
92 int mReserved; // +0x0c padding before the eight-byte time
93 long long mLastNs; // +0x10 when the record was last serviced
94 };
95
96 std::vector<Record> mRecords; // +0x00
97};
void Reset()
Disarm every record.
~MetCommandRepeater()
Release the vector.
void Update(MetScreen *pPanel, const long long *pNowNanoseconds)
Re-deliver every armed command whose interval has elapsed.
MetCommandRepeater()
Build four empty records.
void Arm(const MetScreenCommand *pCommand, int nButton, int nPadIndex)
Arm one record from a command that has just been delivered.
Base of every front-end screen.
Definition metscreen.h:212
One navigation command delivered to a screen.
Definition metscreen.h:46