aboutsummaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 18:56:43 +0200
committerMatthias P. Braendli (think) <matthias@mpb.li>2012-08-16 18:56:43 +0200
commit63f6e31cad0276352dd508394742b3161dde77bf (patch)
treeca071abf8a14479b507e10b717dbd9d5727a39ee /src/DabMod.cpp
parent06fe89bd86fc709908c5882a2c48d03fc0977a25 (diff)
downloaddabmod-63f6e31cad0276352dd508394742b3161dde77bf.tar.gz
dabmod-63f6e31cad0276352dd508394742b3161dde77bf.tar.bz2
dabmod-63f6e31cad0276352dd508394742b3161dde77bf.zip
crc-dabmod: UHD remote control supports mutingr3
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index dbfc885..83fb210 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -192,8 +192,7 @@ int main(int argc, char* argv[])
InputMemory* input = NULL;
ModOutput* output = NULL;
- RemoteControllerTelnet rc (2121);
- rc.start();
+ BaseRemoteController* rc = NULL;
Logger logger;
@@ -310,6 +309,25 @@ int main(int argc, char* argv[])
read_ini(configuration_file, pt);
+ // remote controller:
+ if (pt.get("remotecontrol.telnet", 0) == 1) {
+ try {
+ int telnetport = pt.get<int>("remotecontrol.telnetport");
+ RemoteControllerTelnet* telnetrc = new RemoteControllerTelnet(telnetport);
+ telnetrc->start();
+ rc = telnetrc;
+ }
+ catch (std::exception &e) {
+ std::cerr << "Error: " << e.what() << "\n";
+ std::cerr << " telnet remote control enabled, but no telnetport defined.\n";
+ goto END_MAIN;
+ }
+ }
+ else {
+ rc = new RemoteControllerDummy();
+ }
+
+
// input params:
if (pt.get("input.loop", 0) == 1) {
loop = true;
@@ -513,7 +531,7 @@ int main(int argc, char* argv[])
uhdFrequency, uhdTxGain,
uhd_enable_sync, uhd_mute_no_timestamps,
logger);
- ((OutputUHD*)output)->enrol_at(rc);
+ ((OutputUHD*)output)->enrol_at(*rc);
}
catch (std::exception& e) {
logger(error, "UHD initialisation failed");