Skip to content

Instantly share code, notes, and snippets.

@haakov
Created February 8, 2024 18:08
Show Gist options
  • Save haakov/fc22222caecd78e7f44cf2c940a4a231 to your computer and use it in GitHub Desktop.
Save haakov/fc22222caecd78e7f44cf2c940a4a231 to your computer and use it in GitHub Desktop.
Uses of prefs::singleton in GNU Radio (Feb 2024)
gr-qtgui/lib/qtgui_util.cc:75: std::string qssfile = gr::prefs::singleton()->get_string("qtgui", "qss", "");
gr-qtgui/lib/qtgui_util.cc:76- if (!qssfile.empty()) {
gr-qtgui/lib/qtgui_util.cc:77- QString sstext = get_qt_style_sheet(QString(qssfile.c_str()));
docs/usage-manual/(exported from wiki) Logging.txt:182: prefs *p = prefs::singleton();
docs/usage-manual/(exported from wiki) Logging.txt:183- std::string log_file = p->get_string("LOG", "log_config", "");
docs/usage-manual/(exported from wiki) Logging.txt:184- std::string log_level = p->get_string("LOG", "log_level", "off");
docs/usage-manual/(exported from wiki) Configuration Files.txt:63: prefs *p = prefs::singleton();
docs/usage-manual/(exported from wiki) Configuration Files.txt:64-
docs/usage-manual/(exported from wiki) Configuration Files.txt:65-The methods associated with this preferences object are (from class gr::prefs):
gr-uhd/lib/usrp_sink_impl.cc:747: gr::prefs::singleton()->get_long("uhd", "logging_interval_ms", 750));
gr-uhd/lib/usrp_sink_impl.cc:748-
gr-uhd/lib/usrp_sink_impl.cc:749- while (_async_event_loop_running) {
gr-uhd/lib/usrp_source_impl.cc:45: gr::prefs::singleton()->get_long("uhd", "logging_interval_ms", 750))
gr-uhd/lib/usrp_source_impl.cc:46-{
gr-uhd/lib/usrp_source_impl.cc:47- std::stringstream str;
gr-audio/lib/jack/jack_source.cc:45: return prefs::singleton()->get_string(
gr-audio/lib/jack/jack_source.cc:46- "audio_jack", "default_input_device", "gr_source");
gr-audio/lib/jack/jack_source.cc:47-}
gr-audio/lib/alsa/alsa_sink.cc:47: return prefs::singleton()->get_string(
gr-audio/lib/alsa/alsa_sink.cc:48- "audio_alsa", "default_output_device", "default");
gr-audio/lib/alsa/alsa_sink.cc:49-}
--
gr-audio/lib/alsa/alsa_sink.cc:54: prefs::singleton()->get_double("audio_alsa", "period_time", 0.010));
gr-audio/lib/alsa/alsa_sink.cc:55-}
gr-audio/lib/alsa/alsa_sink.cc:56-
--
gr-audio/lib/alsa/alsa_sink.cc:59: return std::max(2L, prefs::singleton()->get_long("audio_alsa", "nperiods", 32));
gr-audio/lib/alsa/alsa_sink.cc:60-}
gr-audio/lib/alsa/alsa_sink.cc:61-
--
gr-audio/lib/alsa/alsa_sink.cc:74: CHATTY_DEBUG = prefs::singleton()->get_bool("audio_alsa", "verbose", false);
gr-audio/lib/alsa/alsa_sink.cc:75-
gr-audio/lib/alsa/alsa_sink.cc:76- int error = -1;
gr-audio/lib/alsa/alsa_source.cc:44: return prefs::singleton()->get_string(
gr-audio/lib/alsa/alsa_source.cc:45- "audio_alsa", "default_input_device", "default");
gr-audio/lib/alsa/alsa_source.cc:46-}
--
gr-audio/lib/alsa/alsa_source.cc:51: prefs::singleton()->get_double("audio_alsa", "period_time", 0.010));
gr-audio/lib/alsa/alsa_source.cc:52-}
gr-audio/lib/alsa/alsa_source.cc:53-
--
gr-audio/lib/alsa/alsa_source.cc:56: return std::max(2L, prefs::singleton()->get_long("audio_alsa", "nperiods", 32));
gr-audio/lib/alsa/alsa_source.cc:57-}
gr-audio/lib/alsa/alsa_source.cc:58-
--
gr-audio/lib/alsa/alsa_source.cc:72: CHATTY_DEBUG = prefs::singleton()->get_bool("audio_alsa", "verbose", false);
gr-audio/lib/alsa/alsa_source.cc:73-
gr-audio/lib/alsa/alsa_source.cc:74- int error;
gr-audio/lib/oss/oss_sink.cc:39: return prefs::singleton()->get_string(
gr-audio/lib/oss/oss_sink.cc:40- "audio_oss", "default_output_device", "/dev/dsp");
gr-audio/lib/oss/oss_sink.cc:41-}
--
gr-audio/lib/oss/oss_sink.cc:59: std::max(0.001, prefs::singleton()->get_double("audio_oss", "latency", 0.005));
gr-audio/lib/oss/oss_sink.cc:60-
gr-audio/lib/oss/oss_sink.cc:61- d_chunk_size = (int)(d_sampling_rate * CHUNK_TIME);
gr-audio/lib/oss/oss_source.cc:39: return prefs::singleton()->get_string(
gr-audio/lib/oss/oss_source.cc:40- "audio_oss", "default_input_device", "/dev/dsp");
gr-audio/lib/oss/oss_source.cc:41-}
--
gr-audio/lib/oss/oss_source.cc:59: std::max(0.001, prefs::singleton()->get_double("audio_oss", "latency", 0.005));
gr-audio/lib/oss/oss_source.cc:60-
gr-audio/lib/oss/oss_source.cc:61- d_chunk_size = (int)(d_sampling_rate * CHUNK_TIME);
gr-audio/lib/audio_registry.cc:127: return prefs::singleton()->get_string("audio", "audio_module", "auto");
gr-audio/lib/audio_registry.cc:128-}
gr-audio/lib/audio_registry.cc:129-
gr-audio/lib/portaudio/portaudio_sink.cc:47: return prefs::singleton()->get_string("audio_portaudio", "default_output_device", "");
gr-audio/lib/portaudio/portaudio_sink.cc:48-}
gr-audio/lib/portaudio/portaudio_sink.cc:49-
--
gr-audio/lib/portaudio/portaudio_sink.cc:133: d_verbose(prefs::singleton()->get_bool("audio_portaudio", "verbose", false)),
gr-audio/lib/portaudio/portaudio_sink.cc:134- d_portaudio_buffer_size_frames(0),
gr-audio/lib/portaudio/portaudio_sink.cc:135- d_stream(0),
gr-audio/lib/portaudio/portaudio_source.cc:46: return prefs::singleton()->get_string("audio_portaudio", "default_input_device", "");
gr-audio/lib/portaudio/portaudio_source.cc:47-}
gr-audio/lib/portaudio/portaudio_source.cc:48-
--
gr-audio/lib/portaudio/portaudio_source.cc:130: d_verbose(prefs::singleton()->get_bool("audio_portaudio", "verbose", false)),
gr-audio/lib/portaudio/portaudio_source.cc:131- d_portaudio_buffer_size_frames(0),
gr-audio/lib/portaudio/portaudio_source.cc:132- d_stream(0),
gr-audio/lib/jack/jack_sink.cc:44: return prefs::singleton()->get_string(
gr-audio/lib/jack/jack_sink.cc:45- "audio_jack", "default_output_device", "gr_sink");
gr-audio/lib/jack/jack_sink.cc:46-}
gr-audio/lib/osx/osx_source.cc:33: return prefs::singleton()->get_string(
gr-audio/lib/osx/osx_source.cc:34- "audio_osx", "default_input_device", "built-in");
gr-audio/lib/osx/osx_source.cc:35-}
gr-audio/lib/osx/osx_sink.cc:34: return prefs::singleton()->get_string(
gr-audio/lib/osx/osx_sink.cc:35- "audio_osx", "default_output_device", "built-in");
gr-audio/lib/osx/osx_sink.cc:36-}
gr-audio/lib/windows/windows_source.cc:42:static const double CHUNK_TIME = prefs::singleton()->get_double(
gr-audio/lib/windows/windows_source.cc:43- "audio_windows",
gr-audio/lib/windows/windows_source.cc:44- "period_time",
--
gr-audio/lib/windows/windows_source.cc:47:static const int nPeriods = prefs::singleton()->get_long(
gr-audio/lib/windows/windows_source.cc:48- "audio_windows",
gr-audio/lib/windows/windows_source.cc:49- "nperiods",
--
gr-audio/lib/windows/windows_source.cc:53: prefs::singleton()->get_bool("audio_windows", "verbose", false);
gr-audio/lib/windows/windows_source.cc:54-static const std::string default_device =
gr-audio/lib/windows/windows_source.cc:55: prefs::singleton()->get_string("audio_windows", "standard_input_device", "default");
gr-audio/lib/windows/windows_source.cc:56-
gr-audio/lib/windows/windows_source.cc:57-static std::string default_device_name()
gr-audio/lib/windows/windows_sink.cc:39:static const double CHUNK_TIME = prefs::singleton()->get_double(
gr-audio/lib/windows/windows_sink.cc:40- "audio_windows",
gr-audio/lib/windows/windows_sink.cc:41- "period_time",
--
gr-audio/lib/windows/windows_sink.cc:44:static const int nPeriods = prefs::singleton()->get_long(
gr-audio/lib/windows/windows_sink.cc:45- "audio_windows",
gr-audio/lib/windows/windows_sink.cc:46- "nperiods",
--
gr-audio/lib/windows/windows_sink.cc:50: prefs::singleton()->get_bool("audio_windows", "verbose", false);
gr-audio/lib/windows/windows_sink.cc:51-static const std::string default_device =
gr-audio/lib/windows/windows_sink.cc:52: prefs::singleton()->get_string("audio_windows", "standard_output_device", "default");
gr-audio/lib/windows/windows_sink.cc:53-
gr-audio/lib/windows/windows_sink.cc:54-static std::string default_device_name()
gnuradio-runtime/lib/top_block_impl.cc:116: prefs* p = prefs::singleton();
gnuradio-runtime/lib/top_block_impl.cc:117- if (p->get_bool("ControlPort", "on", false) &&
gnuradio-runtime/lib/top_block_impl.cc:118- p->get_bool("PerfCounters", "export", false))
gnuradio-runtime/lib/block_executor.cc:247: prefs* prefs = prefs::singleton();
gnuradio-runtime/lib/block_executor.cc:248- d_use_pc = prefs->get_bool("PerfCounters", "on", false);
gnuradio-runtime/lib/block_executor.cc:249-#endif /* GR_PERFORMANCE_COUNTERS */
gnuradio-runtime/lib/prefs.cc:44:prefs* prefs::singleton()
gnuradio-runtime/lib/prefs.cc:45-{
gnuradio-runtime/lib/prefs.cc:46- static prefs instance;
gnuradio-runtime/lib/top_block.cc:45: prefs::singleton()->get_string("PerfCounters", "clock", "thread");
gnuradio-runtime/lib/top_block.cc:46- if (initial_clock.compare("thread") == 0) {
gnuradio-runtime/lib/top_block.cc:47- gr::high_res_timer_source = CLOCK_THREAD_CPUTIME_ID;
--
gnuradio-runtime/lib/top_block.cc:57: if (prefs::singleton()->get_bool("ControlPort", "on", false)) {
gnuradio-runtime/lib/top_block.cc:58- setup_rpc();
gnuradio-runtime/lib/top_block.cc:59- }
--
gnuradio-runtime/lib/top_block.cc:120: if (prefs::singleton()->get_bool("ControlPort", "edges_list", false)) {
gnuradio-runtime/lib/top_block.cc:121- add_rpc_variable(rpcbasic_sptr(new rpcbasic_register_get<top_block, std::string>(
gnuradio-runtime/lib/top_block.cc:122- alias(),
--
gnuradio-runtime/lib/top_block.cc:134: if (prefs::singleton()->get_bool("ControlPort", "edges_list", false)) {
gnuradio-runtime/lib/top_block.cc:135- add_rpc_variable(rpcbasic_sptr(new rpcbasic_register_get<top_block, std::string>(
gnuradio-runtime/lib/top_block.cc:136- alias(),
gnuradio-runtime/lib/qa_dictionary_logger.cc:22: gr::prefs::singleton()->set_string("LOG", "log_level", "info");
gnuradio-runtime/lib/qa_dictionary_logger.cc:23- auto& logging_system = gr::logging::singleton();
gnuradio-runtime/lib/qa_dictionary_logger.cc:24-
--
gnuradio-runtime/lib/qa_dictionary_logger.cc:67: gr::prefs::singleton()->set_string("LOG", "log_level", "info");
gnuradio-runtime/lib/qa_dictionary_logger.cc:68- auto& logging_system = gr::logging::singleton();
gnuradio-runtime/lib/qa_dictionary_logger.cc:69-
gnuradio-runtime/lib/hier_block2_detail.cc:555: bool ctrlport_on = prefs::singleton()->get_bool("ControlPort", "on", false);
gnuradio-runtime/lib/hier_block2_detail.cc:556-
gnuradio-runtime/lib/hier_block2_detail.cc:557- int min_buff = 0;
gnuradio-runtime/lib/flat_flowgraph.cc:510: if (prefs::singleton()->get_bool("PerfCounters", "on", false)) {
gnuradio-runtime/lib/flat_flowgraph.cc:511- basic_block_viter_t p;
gnuradio-runtime/lib/flat_flowgraph.cc:512- for (p = d_blocks.begin(); p != d_blocks.end(); p++) {
gnuradio-runtime/lib/tpb_thread_body.cc:46: prefs* p = prefs::singleton();
gnuradio-runtime/lib/tpb_thread_body.cc:47- size_t max_nmsgs = static_cast<size_t>(p->get_long("DEFAULT", "max_messages", 100));
gnuradio-runtime/lib/tpb_thread_body.cc:48-
gnuradio-runtime/lib/logger.cc:34: prefs::singleton()->get_string("LOG", "log_level", "info")));
gnuradio-runtime/lib/logger.cc:35- _debug_backend->set_level(spdlog::level::from_str(
gnuradio-runtime/lib/logger.cc:36: prefs::singleton()->get_string("LOG", "debug_level", "info")));
gnuradio-runtime/lib/logger.cc:37-
gnuradio-runtime/lib/logger.cc:38-
--
gnuradio-runtime/lib/logger.cc:42: const auto pref = prefs::singleton();
gnuradio-runtime/lib/logger.cc:43- const auto default_file = pref->get_string("LOG", "log_file", "");
gnuradio-runtime/lib/logger.cc:44-
gnuradio-runtime/lib/block.cc:31: prefs::singleton()->get_long("DEFAULT", "buffer_size", GR_FIXED_BUFFER_SIZE);
gnuradio-runtime/lib/block.cc:32-
gnuradio-runtime/lib/block.cc:33-
gnuradio-runtime/apps/gnuradio-config-info.cc:75: std::cout << gr::prefs::singleton()->to_string() << std::endl;
gnuradio-runtime/apps/gnuradio-config-info.cc:76-
gnuradio-runtime/apps/gnuradio-config-info.cc:77- if (vm.count("builddate") || print_all)
gnuradio-runtime/include/gnuradio/thrift_server_template.h:94: gr::prefs::singleton()->get_string("ControlPort", "config", "");
gnuradio-runtime/include/gnuradio/thrift_server_template.h:95-
gnuradio-runtime/include/gnuradio/thrift_server_template.h:96- if (thrift_config_file.length() > 0) {
gnuradio-runtime/include/gnuradio/thrift_server_template.h:97: gr::prefs::singleton()->add_config_file(thrift_config_file);
gnuradio-runtime/include/gnuradio/thrift_server_template.h:98- }
gnuradio-runtime/include/gnuradio/thrift_server_template.h:99-
--
gnuradio-runtime/include/gnuradio/thrift_server_template.h:103: port = static_cast<unsigned int>(gr::prefs::singleton()->get_long(
gnuradio-runtime/include/gnuradio/thrift_server_template.h:104- "thrift",
gnuradio-runtime/include/gnuradio/thrift_server_template.h:105- "port",
--
gnuradio-runtime/include/gnuradio/thrift_server_template.h:107: nthreads = static_cast<unsigned int>(gr::prefs::singleton()->get_long(
gnuradio-runtime/include/gnuradio/thrift_server_template.h:108- "thrift",
gnuradio-runtime/include/gnuradio/thrift_server_template.h:109- "nthreads",
--
gnuradio-runtime/include/gnuradio/thrift_server_template.h:111: buffersize = static_cast<unsigned int>(gr::prefs::singleton()->get_long(
gnuradio-runtime/include/gnuradio/thrift_server_template.h:112- "thrift",
gnuradio-runtime/include/gnuradio/thrift_server_template.h:113- "buffersize",
gnuradio-runtime/include/gnuradio/thrift_application_base.h:202: static_cast<unsigned int>(gr::prefs::singleton()->get_long(
gnuradio-runtime/include/gnuradio/thrift_application_base.h:203- "thrift", "init_attempts", d_default_max_init_attempts));
gnuradio-runtime/include/gnuradio/thrift_application_base.h:204-
gnuradio-runtime/include/gnuradio/prefs.h:45: * prefs *p = prefs::singleton();
gnuradio-runtime/include/gnuradio/prefs.h:46- * \endcode
gnuradio-runtime/include/gnuradio/prefs.h:47- */
gr-digital/lib/clock_recovery_mm_cc_impl.cc:46: d_verbose(prefs::singleton()->get_bool("clock_recovery_mm_cc", "verbose", false)),
gr-digital/lib/clock_recovery_mm_cc_impl.cc:47- d_p_2T(0),
gr-digital/lib/clock_recovery_mm_cc_impl.cc:48- d_p_1T(0),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment