diff options
author | Josh Blum <josh@joshknows.com> | 2017-02-02 11:33:34 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2017-02-02 11:33:34 -0800 |
commit | 2a2236cc9e97581e59cfc8018bd03d90659e6acc (patch) | |
tree | ee7259bc583835a32993a3fe039b40f3a9019904 /lib/soapy/soapy_sink_c.cc | |
parent | 3511defbf42a3f8cf0fd74b8ae19869406f18b6f (diff) |
soapy: support step size in gain ranges
* This change is backwards compatible and checks for API support for step size.
* Created soapy_common.cc/h to house common gain range functions
* Moved factory mutex declaration to common source files as well
Diffstat (limited to 'lib/soapy/soapy_sink_c.cc')
-rw-r--r-- | lib/soapy/soapy_sink_c.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/soapy/soapy_sink_c.cc b/lib/soapy/soapy_sink_c.cc index 9e3c364..1af5a65 100644 --- a/lib/soapy/soapy_sink_c.cc +++ b/lib/soapy/soapy_sink_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2015-2016 Josh Blum <josh@joshknows.com> + * Copyright 2015-2017 Josh Blum <josh@joshknows.com> * Copyright 2013 Dimitri Stolnikov <horiz0n@gmx.net> * * GNU Radio is free software; you can redistribute it and/or modify @@ -38,17 +38,12 @@ #include "arg_helpers.h" #include "soapy_sink_c.h" +#include "soapy_common.h" #include <SoapySDR/Device.hpp> #include <SoapySDR/Version.hpp> using namespace boost::assign; -boost::mutex &get_soapy_maker_mutex(void) -{ - static boost::mutex m; - return m; -} - /* * Create a new instance of soapy_sink_c and return * a boost shared_ptr. This is effectively the public constructor. @@ -185,14 +180,14 @@ std::vector<std::string> soapy_sink_c::get_gain_names( size_t chan) osmosdr::gain_range_t soapy_sink_c::get_gain_range( size_t chan) { SoapySDR::Range r = _device->getGainRange(SOAPY_SDR_TX, chan); - return osmosdr::gain_range_t(r.minimum(), r.maximum(), 1.0); + return soapy_range_to_gain_range(r); } osmosdr::gain_range_t soapy_sink_c::get_gain_range( const std::string & name, size_t chan) { SoapySDR::Range r = _device->getGainRange(SOAPY_SDR_TX, chan, name); - return osmosdr::gain_range_t(r.minimum(), r.maximum(), 1.0); + return soapy_range_to_gain_range(r); } bool soapy_sink_c::set_gain_mode( bool automatic, size_t chan) |