From b20b932571daff5621f12f760234e998d6e79fab Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 21 Jan 2014 22:02:21 +0100 Subject: add RemoteControl, make the ZMQ input inherit from it --- src/dabInputZmq.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/dabInputZmq.cpp') diff --git a/src/dabInputZmq.cpp b/src/dabInputZmq.cpp index 9b61033..4a2114a 100644 --- a/src/dabInputZmq.cpp +++ b/src/dabInputZmq.cpp @@ -235,5 +235,38 @@ int DabInputZmq::setBitrate(int bitrate) return bitrate; // TODO do a nice check here } +/********* REMOTE CONTROL ***********/ + +void DabInputZmq::set_parameter(string parameter, string value) +{ + stringstream ss(value); + ss.exceptions ( stringstream::failbit | stringstream::badbit ); + + if (parameter == "buffer") { + throw ParameterError("Parameter 'ntaps' is read-only"); + } + else { + stringstream ss; + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } +} + +string DabInputZmq::get_parameter(string parameter) +{ + stringstream ss; + if (parameter == "buffer") { + ss << INPUT_ZMQ_MAX_BUFFER_SIZE; + } + else { + ss << "Parameter '" << parameter << + "' is not exported by controllable " << get_rc_name(); + throw ParameterError(ss.str()); + } + return ss.str(); + +} + #endif -- cgit v1.2.3