diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-01-23 11:00:02 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-01-23 11:00:02 +0100 |
commit | 201d711a1d3dfbe46d622871731005937598e790 (patch) | |
tree | e43a95ee027e1be6ca8621f9e2c78aaf932a3421 /src/DabModulator.cpp | |
parent | 674228bedb325384f12602350ab36d075b5509a3 (diff) | |
parent | e0abfc3728fb56519fa2507d2468214e2a633c98 (diff) | |
download | dabmod-201d711a1d3dfbe46d622871731005937598e790.tar.gz dabmod-201d711a1d3dfbe46d622871731005937598e790.tar.bz2 dabmod-201d711a1d3dfbe46d622871731005937598e790.zip |
Merge branch 'next' into lime
Diffstat (limited to 'src/DabModulator.cpp')
-rw-r--r-- | src/DabModulator.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp index ca958e3..666745d 100644 --- a/src/DabModulator.cpp +++ b/src/DabModulator.cpp @@ -3,7 +3,7 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2019 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -58,15 +58,20 @@ #include "RemoteControl.h" #include "Log.h" +using namespace std; + DabModulator::DabModulator(EtiSource& etiSource, mod_settings_t& settings) : ModInput(), + RemoteControllable("modulator"), m_settings(settings), myEtiSource(etiSource), myFlowgraph() { PDEBUG("DabModulator::DabModulator() @ %p\n", this); + RC_ADD_PARAMETER(rate, "(Read-only) IQ output samplerate"); + if (m_settings.dabMode == 0) { setMode(2); } @@ -385,3 +390,30 @@ meta_vec_t DabModulator::process_metadata(const meta_vec_t& metadataIn) return {}; } + +void DabModulator::set_parameter(const string& parameter, const string& value) +{ + if (parameter == "rate") { + throw ParameterError("Parameter 'rate' is read-only"); + } + else { + stringstream ss; + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } +} + +const string DabModulator::get_parameter(const string& parameter) const +{ + stringstream ss; + if (parameter == "rate") { + ss << m_settings.outputRate; + } + else { + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } + return ss.str(); +} |