diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-01-20 01:20:41 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-01-20 01:20:41 +0100 |
commit | 28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d (patch) | |
tree | f22941e989bb775aacda52876c97ada7b899a7dd /src/Utils.cpp | |
parent | 95f556cf0797ab4c23f431e5c8c5accfa7f4c30b (diff) | |
parent | f52b0e13f61a947c26236504ffb4b072352abc04 (diff) | |
download | dabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.tar.gz dabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.tar.bz2 dabmod-28ddaa742d1a815c8c07d17b2a79fbfb964fdc1d.zip |
Merge branch 'outputRefactoring' into next
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r-- | src/Utils.cpp | 16 |
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"); + } +} + |