mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 07:05:38 +08:00
AFV initial commit
This commit is contained in:
committed by
Mat Sutcliffe
parent
7030302e73
commit
b5a2f2ad13
32
src/blackcore/afv/audio/callsigndelaycache.h
Normal file
32
src/blackcore/afv/audio/callsigndelaycache.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef CALLSIGNDELAYCACHE_H
|
||||
#define CALLSIGNDELAYCACHE_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
|
||||
class CallsignDelayCache
|
||||
{
|
||||
public:
|
||||
void initialise(const QString &callsign);
|
||||
int get(const QString &callsign);
|
||||
void underflow(const QString &callsign);
|
||||
void success(const QString &callsign);
|
||||
void increaseDelayMs(const QString &callsign);
|
||||
void decreaseDelayMs(const QString &callsign);
|
||||
|
||||
static CallsignDelayCache &instance();
|
||||
|
||||
private:
|
||||
CallsignDelayCache() = default;
|
||||
|
||||
static constexpr int delayDefault = 60;
|
||||
static constexpr int delayMin = 40;
|
||||
static constexpr int delayIncrement = 20;
|
||||
static constexpr int delayMax = 300;
|
||||
|
||||
QHash<QString, int> m_delayCache;
|
||||
QHash<QString, int> successfulTransmissionsCache;
|
||||
};
|
||||
|
||||
#endif // CALLSIGNDELAYCACHE_H
|
||||
Reference in New Issue
Block a user