Add-on System Overview

EarTrumpet includes an extensibility system that allows for loading external add-on assemblies to expand its functionality. This enables both first-party and potentially third-party features to be integrated into the application.

Architecture

The add-on system is managed by the AddonManager class, which orchestrates the discovery and loading process.

  • AddonResolver: This class is responsible for discovering add-on assemblies. It searches for add-ons in the Addons subfolder of the main application directory.

  • AddonHost: Once add-ons are loaded, they are held in the AddonHost. This host provides access to the add-ons and their implemented features through strongly-typed lists corresponding to the supported extensibility interfaces.

Version Selection

To ensure compatibility, add-ons are versioned. An add-on can support multiple versions of EarTrumpet by placing its binaries in a version-specific folder:

Addons/
  MyAddon/
    Versions/
      2.1.8.0/
        MyAddon.dll

The AddonResolver selects the highest compatible version of an add-on that is less than or equal to the current EarTrumpet version.

Extensibility Interfaces

Add-ons can implement various interfaces to integrate with different parts of EarTrumpet:

  • IEarTrumpetAddonEvents: Receives lifecycle events, such as application startup and shutdown.
  • IEarTrumpetAddonNotificationAreaContextMenu: Adds custom items to the main right-click context menu of the taskbar icon.
  • IEarTrumpetAddonAppContent: Provides custom UI content and context menu items for individual application popups.
  • IEarTrumpetAddonDeviceContent: Provides custom UI content and context menu items for device popups.
  • IEarTrumpetAddonSettingsPage: Adds new categories and pages to the EarTrumpet settings window.

Built-in Add-ons

EarTrumpet ships with a powerful built-in add-on for automation.

  • Actions Add-on: A feature-rich system for creating custom rules to automate audio management based on triggers and conditions.