Foobar2000:Development:SDK 2022-08-10 Release Notes

From Hydrogenaudio Knowledgebase
Jump to: navigation, search


Overview[edit]

This SDK, while retaining the ability to build components for v1.5 & v1.6 series, allows you to utilize features of upcoming foobar2000 v2.0 series.

This most notably includes:

  • Support for x64 and ARM64 architectures.
  • Dark mode support.
  • metadb v2

Backwards compatibility[edit]

Since many developers will wish to support both new and old foobar2000 for a while, this SDK defaults to FOOBAR2000_TARGET_VERSION of 80 (foobar2000 v1.5/v1.6). With this target version, you can still detect and utilize foobar2000 v2.0 APIs without actually requiring foobar2000 v2.0.

32-bit version of foobar2000 v2.0 remains capable of running all available components, though performance of playlists and media library viewers may be inferior until the component is updated with foobar2000 v2.0 in mind. 64-bit (x64, ARM64) versions obviously require new builds of components.

Non-x86 architectures[edit]

You can now build components for x64 and ARM64 architectures, which is necessary to get them loaded into relevant builds of foobar2000 v2.0.

It's encouraged to keep FOOBAR2000_TARGET_VERSION at 80, so x86 32-bit build of your component works with both old and new foobar2000, while x64 & ARM64 ones, otherwise built from the same source, work in new foobar2000.

audio_sample[edit]

64-bit builds of foobar2000 have audio_sample defined to double (64-bit float), contrary to 32-bit in legacy 32-bit builds.

PFC audio_math methods have been modified to take either, as well as re-optimized for all target CPU architectures.

Note that 64-bit processing DOES NOT improve audio quality. It only allows bitexact passthru of exotic formats and valid results of Binary Comparator with such formats.

Dark mode[edit]

All foobar2000 dark mode support code, ugly as it is, is now available for anyone to reuse freely, as a part of libPPUI.

I hope that other software authors find it useful, not having to repeat my mistakes to reach usable state.

Helpers exist (see helpers/DarkMode.h) to detect and conditionally enable dark mode depending on foobar2000 settings, if running under foobar2000 v2.0 or newer (idle otherwise).

Dark mode in preferences[edit]

foobar2000 needs to know if your preferences page is dark mode compliant or not, applying dark/light mode to the whole dialog if necessary, to make the entire dialog appear consistent with the page content.

To accomplish this, alter your get_state() to combine its return value with preferences_state::dark_mode_supported.

metadb v2[edit]

Until foobar2000 v2.0, metadb preloaded all indexable track information on app startup.

This is no longer done, info is handled by SQLite; also partial info hacks (LargeFieldsConfig.txt) have been dropped as they're no longer necessary.

While old foobar2000 versions allowed zero-cost querying of track info objects (you'd get a reference to foobar2000's internal data object, without actual copying or malloc!), this is no longer possible, so code abusing the old system will slow down.

To work around this:

  • Absolutely avoid repeated info queries on the same track, make sure that whatever you're doing does only one query per track and reuses the result.
  • The new metadb_v2_rec_t structure contains all info about this track; methods that take it, such as formatTitle_v2_(), will not read from the database, so query once and pass the already fetched data to multiple title formatting function calls.
  • If you must make multiple title formatting calls yet don't want to use new methods, concatenate title formatting patterns and split output. You don't even need the new SDK for this.
  • When info from multiple tracks is required, check for metadb_v2 availability and utilize its methods to retrieve metadb_v2_rec_t info in batches.

Where the heck is foobar2000 v2.0 anyway? Web site lists 1.6.12 beta as latest[edit]

A public beta will be released soon, immediately after 1.6.12 stable. If you want to test an updated version your component already, contact staff via IRC for early access.