diff options
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r-- | src/DabMod.cpp | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 25a93bf..12cfa43 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -37,12 +37,9 @@ #include "OutputFile.h" #include "FormatConverter.h" #include "FrameMultiplexer.h" -#if defined(HAVE_OUTPUT_UHD) -# include "OutputUHD.h" -#endif -#if defined(HAVE_SOAPYSDR) -# include "OutputSoapy.h" -#endif +#include "output/SDR.h" +#include "output/UHD.h" +#include "output/Soapy.h" #include "OutputZeroMQ.h" #include "InputReader.h" #include "PcDebug.h" @@ -133,15 +130,15 @@ static void printModSettings(const mod_settings_t& mod_settings) else if (mod_settings.useUHDOutput) { fprintf(stderr, " UHD\n" " Device: %s\n" - " Type: %s\n" + " Subdevice: %s\n" " master_clock_rate: %ld\n" " refclk: %s\n" " pps source: %s\n", - mod_settings.outputuhd_conf.device.c_str(), - mod_settings.outputuhd_conf.usrpType.c_str(), - mod_settings.outputuhd_conf.masterClockRate, - mod_settings.outputuhd_conf.refclk_src.c_str(), - mod_settings.outputuhd_conf.pps_src.c_str()); + mod_settings.sdr_device_config.device.c_str(), + mod_settings.sdr_device_config.subDevice.c_str(), + mod_settings.sdr_device_config.masterClockRate, + mod_settings.sdr_device_config.refclk_src.c_str(), + mod_settings.sdr_device_config.pps_src.c_str()); } #endif #if defined(HAVE_SOAPYSDR) @@ -149,8 +146,8 @@ static void printModSettings(const mod_settings_t& mod_settings) fprintf(stderr, " SoapySDR\n" " Device: %s\n" " master_clock_rate: %ld\n", - mod_settings.outputsoapy_conf.device.c_str(), - mod_settings.outputsoapy_conf.masterClockRate); + mod_settings.sdr_device_config.device.c_str(), + mod_settings.sdr_device_config.masterClockRate); } #endif else if (mod_settings.useZeroMQOutput) { @@ -208,18 +205,20 @@ static shared_ptr<ModOutput> prepare_output( #if defined(HAVE_OUTPUT_UHD) else if (s.useUHDOutput) { s.normalise = 1.0f / normalise_factor; - s.outputuhd_conf.sampleRate = s.outputRate; - output = make_shared<OutputUHD>(s.outputuhd_conf); - rcs.enrol((OutputUHD*)output.get()); + s.sdr_device_config.sampleRate = s.outputRate; + auto uhddevice = make_shared<Output::UHD>(s.sdr_device_config); + output = make_shared<Output::SDR>(s.sdr_device_config, uhddevice); + rcs.enrol((Output::SDR*)output.get()); } #endif #if defined(HAVE_SOAPYSDR) else if (s.useSoapyOutput) { /* We normalise the same way as for the UHD output */ s.normalise = 1.0f / normalise_factor; - s.outputsoapy_conf.sampleRate = s.outputRate; - output = make_shared<OutputSoapy>(s.outputsoapy_conf); - rcs.enrol((OutputSoapy*)output.get()); + s.sdr_device_config.sampleRate = s.outputRate; + auto soapydevice = make_shared<Output::Soapy>(s.sdr_device_config); + output = make_shared<Output::SDR>(s.sdr_device_config, soapydevice); + rcs.enrol((Output::SDR*)output.get()); } #endif #if defined(HAVE_ZEROMQ) @@ -321,16 +320,16 @@ int launch_modulator(int argc, char* argv[]) flowgraph.connect(modulator, output); } + if (false #if defined(HAVE_OUTPUT_UHD) - if (mod_settings.useUHDOutput) { - ((OutputUHD*)output.get())->setETISource(modulator->getEtiSource()); - } + or mod_settings.useUHDOutput #endif #if defined(HAVE_SOAPYSDR) - if (mod_settings.useSoapyOutput) { - ((OutputSoapy*)output.get())->setETISource(modulator->getEtiSource()); - } + or mod_settings.useSoapyOutput #endif + ) { + ((Output::SDR*)output.get())->setETISource(modulator->getEtiSource()); + } size_t framecount = 0; @@ -415,16 +414,16 @@ int launch_modulator(int argc, char* argv[]) flowgraph.connect(modulator, output); } + if (false #if defined(HAVE_OUTPUT_UHD) - if (mod_settings.useUHDOutput) { - ((OutputUHD*)output.get())->setETISource(modulator->getEtiSource()); - } + or mod_settings.useUHDOutput #endif #if defined(HAVE_SOAPYSDR) - if (mod_settings.useSoapyOutput) { - ((OutputSoapy*)output.get())->setETISource(modulator->getEtiSource()); - } + or mod_settings.useSoapyOutput #endif + ) { + ((Output::SDR*)output.get())->setETISource(modulator->getEtiSource()); + } inputReader->PrintInfo(); |