SatDump 2.0.0-alpha-76a915210
Loading...
Searching...
No Matches
iq_types.h
1#pragma once
2
3#include <string>
4
5namespace satdump
6{
7 namespace ndsp
8 {
9 enum IQTypeEnum
10 {
11 CF32,
12 CS32,
13 CS16,
14 CS8,
15 CU8,
16 WAV16,
17 // #ifdef BUILD_ZIQ
18 // ZIQ,
19 // #endif
20 // #ifdef BUILD_ZIQ2
21 // ZIQ2,
22 // #endif
23 };
24
25 class IQType
26 {
27 private:
28 IQTypeEnum type;
29 void from_string(const std::string &s);
30
31 public:
32 IQType() { type = CF32; }
33
34 IQType(const IQTypeEnum &e) { type = e; }
35
36 IQType(const std::string &s) { from_string(s); }
37
38 IQType(const char *s) { from_string(std::string(s)); }
39
40 inline operator IQTypeEnum() const { return type; }
41
42 inline IQType &operator=(const IQTypeEnum &e)
43 {
44 type = e;
45 return *this;
46 }
47
48 inline IQType &operator=(const std::string &s)
49 {
50 from_string(s);
51 return *this;
52 }
53
54 inline IQType &operator=(const char *s)
55 {
56 from_string(std::string(s));
57 return *this;
58 }
59
60 operator std::string() const;
61
62 bool draw_combo(const char *label = "Format");
63
64 // #if defined(BUILD_ZIQ) || defined(BUILD_ZIQ2)
65 // int ziq_depth = 8;
66 // IQType(IQTypeEnum e, int d)
67 // {
68 // type = e;
69 // ziq_depth = d;
70 // }
71
72 // friend struct std::less<IQType>;
73 // #endif
74 };
75 } // namespace ndsp
76} // namespace satdump