Foobar2000:Development:Overview
What is a component
A foobar2000 component is a Windows Dynamic Link Library (DLL) extending the functionality of the foobar2000 application.
A foobar2000 component implements one or more entrypoint services and interacts with services provided by foobar2000 core or other components.
Each component has a single exported DLL function, foobar2000_get_interface()
, called on startup to initialize and discover entrypoint services of your component. This function is generated automatically by the foobar2000_component_client module. Do not implement it yourself.
foobar2000 components are made using foobar2000 SDK and Microsoft Visual Studio.
See also: Visual Studio Compatibility, SDK Contents.
Packaging a component
Components are delivered to the user in form of fb2k-component file.
This is simply a renamed zip of your DLL.
If your component requires additional files, include them in the zip; foobar2000 will extract them to the folder containing your DLL upon installation.
Different CPU architectures
Delivering as straightforward zip-of-a-DLL still works, but that leaves it up to the user to download the correct binary.
To support multiple CPU architectures with one package, put files meant for legacy x86 foobar2000 in top level and create subdirectories named after the architectures, with files that are specialized for those architectures.
For an example, x64 foobar2000 will extract whole component archive, then overwrite files in root with those in x64 subfolder:
foo_sample.dll <= this is for legacy x86 foobar2000 x64\foo_sample.dll <= for x64 and arm64ec arm64ec\foo_sample.dll <= arm64ec foobar2000 will prefer this over x64 if provided
Components packaged this way will let foobar2000 choose the right DLL to load.
The components site now accepts such components and detects supported CPU architectures by listing zip contents.
ARM support
foobar2000 for ARM is built in ARM64EC (Emulation Compatible) mode.
Because ARM64 Windows is still a niche platform, we cannot expect every developer to compile and test ARM64 components. foobar2000 for ARM64 is capable of seamlessly loading x64 components and transparently running them side by side with native components.
For non-performance-critical components, emulation of verified working x64 code is more than good enough, likely better than running untested ARM64 code if the developer has no means to test it.
Getting a component listed on foobar2000.org/components
Register a forum account and contact Peter with info about your component.