Foobar2000:Development:Overview: Difference between revisions
No edit summary |
|||
Line 20: | Line 20: | ||
If your component requires additional files, include them in the zip; foobar2000 will extract them to the folder containing your DLL upon installation. | 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: | |||
<pre> | |||
foo_sample.dll <= this is for legacy x86 foobar2000 | |||
x64\foo_sample.dll | |||
arm64\foo_sample.dll | |||
</pre> | |||
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. | |||
== Getting a component listed on foobar2000.org/components == | == Getting a component listed on foobar2000.org/components == |
Revision as of 19:35, 25 August 2022
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 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 arm64\foo_sample.dll
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.
Getting a component listed on foobar2000.org/components
Register a forum account and contact Peter with info about your component.