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: Text .CFG file... (Read 3958 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Text .CFG file...

It'd be nice if foobar2000.cfg was a text file, rather than being a binary. Perhaps even an .INI file?

This way, people could write applications to simplify tasks like EQ setting, rather than having to use a necessarily pixel-precise mouse interface. It'd also allow for alteration of your playlist formatting string in your favorite text editor, rather than the tiny text-box, especially now that people are really starting to create huge formatting strings.

Text .CFG file...

Reply #1
Great idea! I really second this one!

Text .CFG file...

Reply #2
Yupz, great idea. Had crossed my mind some time ago...

Text .CFG file...

Reply #3
I also support this idea.

thnx

Text .CFG file...

Reply #4
Excellent idea


Text .CFG file...

Reply #6
How about a library or class for accessing and modifying the configuration file outside of the plug-in SDK?

That won't be as smooth as a plain text configuration file, but consider that a plain text file would definately be much larger. The current configuration file stores DWORD length of name, name, DWORD length of data, data. None of the variables specify their type in the configuration file, however.

A text file would need to have each variable formatted, and possibly have its type identified. The top level cfg_var class does not know what type of variable it's loading or storing, just how many bytes. Looks like you'd either need to know what you're dealing with in your own program, or the interface would have to be rewritten just for this.

Oh yes, and write off messing with variables from within other plug-ins. Plug-in specific variables are categorized by the DLL filename. Including unique prefixes on your config variable names is entirely optional, and probably does not serve a purpose. You can still locate them in the .cfg file by searching for your DLL name first. (EDIT: Assuming this is before you design in a configuration panel and wish to mess with your variables with a hex editor. You will only be able to modify them after you close the player...)

Text .CFG file...

Reply #7
Quote
How about a library or class for accessing and modifying the configuration file outside of the plug-in SDK?

That won't be as smooth as a plain text configuration file, but consider that a plain text file would definately be much larger. The current configuration file stores DWORD length of name, name, DWORD length of data, data. None of the variables specify their type in the configuration file, however.

A text file would need to have each variable formatted, and possibly have its type identified. The top level cfg_var class does not know what type of variable it's loading or storing, just how many bytes. Looks like you'd either need to know what you're dealing with in your own program, or the interface would have to be rewritten just for this.

Oh yes, and write off messing with variables from within other plug-ins. Plug-in specific variables are categorized by the DLL filename. Including unique prefixes on your config variable names is entirely optional, and probably does not serve a purpose. You can still locate them in the .cfg file by searching for your DLL name first. (EDIT: Assuming this is before you design in a configuration panel and wish to mess with your variables with a hex editor. You will only be able to modify them after you close the player...)

Can't see the point of this. A simple INI file is much more robust, at least from the helper classes I've mucked around with in Delphi. I don't know if C is as easy. INI files were made to hold information that can be externally edited using a text editor. Plus, they're very standard in Windows.

The only downside you've claimed about the text/INI file is that it's larger. I'm sure most coders out there have more experience with INI files than proprietary binary formats.

Text .CFG file...

Reply #8
win32 api functions accessing .ini files have a lot of idiotic problems, including total mess with quotation marks, truncated spaces at the end of string, limited length of entire file, etc.
format of foobar2000.cfg will not be changed, don't bother asking.
if you want a better way to adjust the EQ, sourcecode of foo_dsp_extra is in the SDK, why don't you improve that yourself instead ?
Microsoft Windows: We can't script here, this is bat country.