|This page is still under construction. Feel free to help out! |
If you're not able to find what you need on this topic, try asking at the MusicBee Forum.
See Category:Under Construction for other incomplete pages.
- Download API (and checkout examples) and include it in your build
- You might have to install the latest MusicBee build to test your work.
Basic MB - plugin workflowEdit
- starts by loading your dll
- talks to your plugin via predefined plugin-methods on certain events (starting with Initialise)
- Your plugin reacts to Musicbee on certain events and can use MusicBee internal "stuff" via API methods
API files and more detailedEdit
contains all the definitions and constants used by MusicBee (such as MusicBeeApiInterface, PluginInfoVersion, etc.). All these enums, delegates and structs are members of the class MusicBeePlugin.Plugin.
is an example plugin and extends the class further with predefined methods called by MusicBee to communicate with your plugin, such as:
- Initialise sets it all up:
- Provides the MusicBeeApiInterface to control MusicBee
- Provides/returns the PluginInfo with various ways for MB to know how to handle the plugin
- ReceiveNotification handles all Notifications depending on its own PluginInfo::ReceiveNotificationFlags
- whatever you need to do to initialise the plugin
- See TestCSharpDll.cs itself, it's all explained in comments.
- Inside these methods requests are sent to MusicBee via MusicBeeApiInterface
is auto-generated (and auto-modified) by Visual Studio and contains a bunch of attributes that define the product name, description, copyright, version etc. strings embedded into the DLL file.
The API (MusicBeeApiInterface) provides a bunch of delegates it received from MB If you know C, delegates are type-safe and nicely encapsulated function pointers slash trampolines.
- Don't display version number in your dll
E.g. don't compile into "MyPlugin_1.3.dll"
Because this can result into having multiple versions of the same plugin loaded by MB, since the end-user will not necessarily delete the old version. It's better to let them overwrite it by default.