aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp
index f423dc1..b4816d3 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -3,7 +3,7 @@
Her Majesty the Queen in Right of Canada (Communications Research
Center Canada)
- Copyright (C) 2017
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -214,3 +214,17 @@ double parseChannel(const std::string& chan)
}
return freq;
}
+
+std::chrono::milliseconds transmission_frame_duration(unsigned int dabmode)
+{
+ using namespace std::chrono;
+ switch (dabmode) {
+ case 1: return milliseconds(96);
+ case 2: return milliseconds(24);
+ case 3: return milliseconds(24);
+ case 4: return milliseconds(48);
+ default:
+ throw std::runtime_error("invalid DAB mode");
+ }
+}
+