Ref T730, namespace for BlackCore::Afv

* added namespace
* removed some *.pri files and added files to blackcore.pro
* added copyright etc.
This commit is contained in:
Klaus Basan
2019-09-19 00:56:54 +02:00
committed by Mat Sutcliffe
parent d064da13b5
commit 384aa3ce19
46 changed files with 2985 additions and 2916 deletions

View File

@@ -1,32 +1,53 @@
/* Copyright (C) 2019
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
* or distributed except according to the terms contained in the LICENSE file.
*/
//! \file
#ifndef CALLSIGNDELAYCACHE_H
#define CALLSIGNDELAYCACHE_H
#include <QHash>
#include <QString>
class CallsignDelayCache
namespace BlackCore
{
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);
namespace Afv
{
namespace Audio
{
//! Callsign delay cache
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();
static CallsignDelayCache &instance();
private:
CallsignDelayCache() = default;
private:
//! Ctor
CallsignDelayCache() = default;
static constexpr int delayDefault = 60;
static constexpr int delayMin = 40;
static constexpr int delayIncrement = 20;
static constexpr int delayMax = 300;
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;
};
QHash<QString, int> m_delayCache;
QHash<QString, int> successfulTransmissionsCache;
};
#endif // CALLSIGNDELAYCACHE_H
} // ns
} // ns
} // ns
#endif // guard