MusicBee Wiki
MusicBee Wiki
Advertisement

Get started[]

  1. Download API (and checkout examples) and include it in your build
  2. You might have to install the latest MusicBee build to test your work.

Basic MB - plugin workflow[]

  1. MusicBee..
    1. starts by loading your dll
    2. talks to your plugin via predefined plugin-methods on certain events (starting with Initialise)
  2. Your plugin reacts to Musicbee on certain events and can use MusicBee internal "stuff" via API methods

API files and more detailed[]

  • MusicBeeInterface.cs..
    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.
  • TestCSharpDll.cs
    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
  • Properties\AssemblyInfo.cs..
    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.

Remarks[]

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.

Tips[]

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.

Advertisement