diff options
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r-- | src/DabMod.cpp | 24 |
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"); |