FramebufferUi

interface FramebufferUi

A plugin editor that is a pixel buffer rather than a view.

Some formats have no window to embed: JSFX draws its editor itself and expects input back. A host asks for the size, copies out frames, hands in input, and answers the three services below while the editor is on screen. What it draws with is its own business, and nothing here is specific to any format.

Obtained from PluginInstance.framebufferUi, which is null for every plugin whose editor is a native window and for every plugin with no editor at all.

Properties

Link copied to clipboard

The size the plugin would like, or null when it has no opinion and the host picks.

Functions

Link copied to clipboard
abstract fun copyFrame(destination: ByteArray, destinationStride: Int): FramebufferFrameInfo?

Copies the most recent frame into destination, one row every destinationStride bytes, and describes what was copied. Null when the plugin has not drawn yet or destination is too small.

Link copied to clipboard
abstract fun deliverInput(input: FramebufferInput, keys: List<FramebufferKeyEvent> = emptyList())

Hands the plugin everything that has happened since the last call.

Link copied to clipboard

Describes the frame that would be copied now, without copying it. Null before the plugin has drawn anything. Compare FramebufferFrameInfo.serial against the last frame drawn to decide whether copyFrame is worth calling at all.

Link copied to clipboard
abstract fun setDisplayed(displayed: Boolean)

Whether the editor is on screen. A plugin that is not displayed stops drawing.

Link copied to clipboard
abstract fun setHost(host: FramebufferUiHost?)

Installs the services the plugin needs while displayed, or null to uninstall. A host must uninstall before it stops drawing.

Link copied to clipboard
abstract fun setSurfaceSize(width: Int, height: Int, scaleFactor: Double)

Tells the plugin how large a surface it is drawing into, and at what scale.