Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Read foobar preferences? (Read 1385 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Read foobar preferences?

Hi,

I wanted to ask if it's possible to read foobar2000 preferences within my component. More specific, I want to find out the name of the current output device. How can I achieve this?

Best,
Mario

Re: Read foobar preferences?

Reply #1
If you just care about querying the current output in foobar2000 1.3.5 and above, something like the following should do it.
If you require updates as the output changes, output_manager_v2 of foobar2000 1.4 lets you register a change callback.

Code: [Select]
        static_api_ptr_t<output_manager> om;
        outputCoreConfig_t cfg;
        om->getCoreConfig(cfg);
        auto op = output_entry::g_find(cfg.m_output);
        std::string output_name = op->get_name();
        std::string device_name = op->get_device_name(cfg.m_device);
        console::formatter() << "Output: " << pfc::print_guid(cfg.m_output)
                             << " - \"" << output_name.c_str() << "\"\n"
                             << "Device: " << pfc::print_guid(cfg.m_device)
                             << " - \"" << device_name.c_str() << "\"\n";
Stay sane, exile.

 

Re: Read foobar preferences?

Reply #2
Thanks! Works flawless.

Good to know that there will be a callback in the future, this will probably make the code a little bit cleaner. But for now, your example is sufficient for me. Thanks again!