diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/utils/gain_group.hpp | 7 | ||||
-rw-r--r-- | host/lib/utils/gain_group.cpp | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/host/include/uhd/utils/gain_group.hpp b/host/include/uhd/utils/gain_group.hpp index f85e841dc..4a3a01a65 100644 --- a/host/include/uhd/utils/gain_group.hpp +++ b/host/include/uhd/utils/gain_group.hpp @@ -91,6 +91,13 @@ public: * \return a gain group object. */ static sptr make(void); + + /*! + * Make a new gain group with all zero values. + * \param name the name of the (only and zero-valued) gain element + * \return a gain group object populated with zeroes + */ + static sptr make_zero(); }; } // namespace uhd diff --git a/host/lib/utils/gain_group.cpp b/host/lib/utils/gain_group.cpp index 50edf2515..0e4df6469 100644 --- a/host/lib/utils/gain_group.cpp +++ b/host/lib/utils/gain_group.cpp @@ -182,3 +182,14 @@ private: gain_group::sptr gain_group::make(void){ return sptr(new gain_group_impl()); } + +gain_group::sptr gain_group::make_zero() +{ + gain_fcns_t gain_fcns; + gain_fcns.get_range = []() { return meta_range_t(0.0, 0.0); }; + gain_fcns.get_value = []() { return 0.0; }; + gain_fcns.set_value = [](const double) {}; + auto gg = make(); + gg->register_fcns("null", gain_fcns); + return gg; +} |