Skip to main content

Services

Services are pure abstract interfaces looked up through ctx.GetService<T>(). Each has a stable InterfaceId string used as its registry key. This page lists the interfaces shipped with the SDK.

For how to look up and register services, see Cross-Plugin Communication.

Host services

Registered by the host before any plugin installs, so they are always available in OnInstall. Discover each with GetService<T>() and null-check.

Settings — ISettingsStore, ISettingsRegistry

Declared in <framelift/services.h>.

  • ISettingsStore — typed host-setting getters (GetSettingBool/Int/Float/String keyed by "section.name"), commit + SaveSettings() (settings-menu only), change-callback registration, and per-plugin INI sections via GetModuleSettings("section")IModuleSettings.
  • ISettingsRegistry — register settings pages and keybind entries (RegisterSettingsPage, RegisterKeybindEntry) so the SettingsMenu plugin can render them without knowing your types, plus the Enumerate* walks it uses.

See Settings.

Media playback — interface family

The playback backend (FFmpeg + libass) is exposed as a family of small interfaces in <framelift/platform/IMediaPlayer.h> rather than one god-object. One host object implements them all; fetch only the facet you need:

InterfaceCovers
IMediaPlaybackLoadFile, SetPause/TogglePause, Seek/SeekAbsolute, image timing, playback + read-ahead options, the PollEvent source behind media events.
IMediaPropertiesAsync property queries: GetDoubleAsync, GetInt64Async, GetStringAsync, GetDisplaySizeAsync, ObserveProperty.
IAudioControlMute/volume, normalization, audio track enumeration/selection, output devices, audio preferences.
ISubtitleControlSubtitle track enumeration/selection, visibility, delay, appearance styling.
IVideoOutputVideo presentation surface (host-internal; rarely needed by plugins).

Window & platform

Declared in <framelift/platform.h>.

  • IAppWindow — plugin-visible window title and fullscreen state (SetTitle, IsFullscreen/SetFullscreen).
  • IEventPump — inject custom events into the Qt-owned event loop (RegisterCustomEventType, PushCustomEvent, PushQuitEvent).
  • IFileDialog — native open/save file dialogs.

Other registered services

The host also registers Hotkeys (keybind dispatch — see Keybinds), FocusManager, ContextMenu, IPluginCatalog (installed plugins), and IAppPaths (config directory), each keyed by its own InterfaceId.

Feature services

Provided by the corresponding feature plugins, so they are present only when that plugin is enabled — always null-check the result of GetService. Declared in <framelift/services.h>.

IHistory

int    GetMostRecent(char* buf, int cap) const noexcept; // most recent path; buf may be null
double GetResumePos(const char* path) const noexcept; // 0.0 if not found

GetMostRecent follows the buffer convention: returns the full length excluding NUL; pass buf=nullptr to query the required size.

History updates (adding entries, updating resume positions) flow through events (FileOpenedEvent / FileEndedEvent) rather than this interface.

Defining your own

Any plugin can publish a service: a pure abstract class with a unique InterfaceId and POD-only method signatures, registered with ctx.RegisterService<IMyService>(this). See Cross-Plugin Communication and the ABI rules.