HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: tn1 on 2021-03-15 02:07:58

Title: Modify core settings programmatically
Post by: tn1 on 2021-03-15 02:07:58
I would like to modify foobar2000 preferences programmatically. In particular, I would like the Networking > Proxy setting to be automatically changed when I turn on/off my VPN (so I can access geo-restricted podcasts).

As we know (https://hydrogenaud.io/index.php?topic=73374.0), the config file format is not public.  :(

I don't see any API methods in the SDK to change this either.

My guess is that if the networking preferences pane is implemented in the same way as plugins would make their preferences pages, then there are GUIDs for those settings. If I could figure out those GUIDs, and also how to cause the foobar preferences API to update its settings automatically, then I could hook it up to a COM server or something, which can then be called from a PowerShell script that OpenVPN calls.

My workaround is an AutoIt script to simply walk through the preferences and toggle the options, but I was hoping someone knows a better way!
Title: Re: Modify core settings programmatically
Post by: Peter on 2021-03-15 07:02:02
You just can't update the settings programmatically.
Live editing the config file will do you no good (will not be reloaded, may get rewritten with original settings on shutdown).
Feature request noted.
Title: Re: Modify core settings programmatically
Post by: tn1 on 2021-03-15 20:54:57
You just can't update the settings programmatically.
Live editing the config file will do you no good (will not be reloaded, may get rewritten with original settings on shutdown).
That's what I was afraid of. :-/ I know editing the file won't help which is why I was hoping for there to be some API that I missed.

Feature request noted.
Awesome, looking forward to it!