forked from jtdx-project/jtdx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Radio.hpp
58 lines (48 loc) · 1.48 KB
/
Radio.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef RADIO_HPP_
#define RADIO_HPP_
#include <QObject>
#include <QLocale>
class QVariant;
class QString;
//
// Declarations common to radio software.
//
namespace Radio
{
//
// Frequency types
//
using Frequency = quint64;
using Frequencies = QList<Frequency>;
using FrequencyDelta = qint64;
//
// Frequency type conversion.
//
// QVariant argument is convertible to double and is assumed to
// be scaled by (10 ** -scale).
//
Frequency frequency (QVariant const&, int scale, QLocale const& = QLocale ());
FrequencyDelta frequency_delta (QVariant const&, int scale, QLocale const& = QLocale ());
//
// Frequency type formatting
//
QString frequency_MHz_string (Frequency, QLocale const& = QLocale ());
QString frequency_MHz_string (FrequencyDelta, QLocale const& = QLocale ());
QString pretty_frequency_MHz_string (Frequency, QLocale const& = QLocale ());
QString pretty_frequency_MHz_string (double, int scale, QLocale const& = QLocale ());
QString pretty_frequency_MHz_string (FrequencyDelta, QLocale const& = QLocale ());
//
// Callsigns
//
bool is_callsign (QString const&);
bool is_compound_callsign (QString const&);
QString base_callsign (QString);
QString effective_prefix (QString);
QString striped_prefix (QString);
// Darkstyle Color
QString convert_dark(QString const& color, bool useDarkStyle);
}
Q_DECLARE_METATYPE (Radio::Frequency);
Q_DECLARE_METATYPE (Radio::Frequencies);
Q_DECLARE_METATYPE (Radio::FrequencyDelta);
#endif