Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
226 lines (194 loc) · 18.6 KB

File metadata and controls

226 lines (194 loc) · 18.6 KB

docs » plugins.core.controlsurfaces.manager


Manager for the CommandPost Preferences Window.

API Overview

API Documentation

Constants

Signature plugins.core.controlsurfaces.manager.DEFAULT_HEIGHT -> number
Type Constant
Description Default Height of Preferences Window
Signature plugins.core.controlsurfaces.manager.DEFAULT_WIDTH -> number
Type Constant
Description Default Width of Preferences Window
Signature plugins.core.controlsurfaces.manager.lastTab
Type Constant
Description Returns the last tab saved in settings.
Signature plugins.core.controlsurfaces.manager.NUMBER_OF_BANKS -> number
Type Constant
Description Number of banks.
Signature plugins.core.controlsurfaces.manager.NUMBER_OF_DEVICES -> number
Type Constant
Description Number of devices.
Signature plugins.core.controlsurfaces.manager.position
Type Constant
Description Returns the last frame saved in settings.
Signature plugins.core.controlsurfaces.manager.WEBVIEW_LABEL -> string
Type Constant
Description The WebView Label

Variables

Signature plugins.core.controlsurfaces.manager._handlers -> table
Type Variable
Description Table containing handlers.
Signature plugins.core.controlsurfaces.manager._panels -> table
Type Variable
Description Table containing panels.

Functions

Signature plugins.core.controlsurfaces.manager.addHandler(id, handlerFn) -> string
Type Function
Description Adds a Handler
Parameters
  • id - The ID
  • handlerFn - the handler function
Returns
  • Nothing
Signature plugins.core.controlsurfaces.manager.addPanel(params) -> plugins.core.controlsurfaces.manager.panel
Type Function
Description Adds a new panel with the specified params to the preferences manager.
Parameters
  • params - The parameters table. Details below.
Returns
  • The new panel instance.
Notes
  • The params can have the following properties. The priority and id and properties are required. priority - An integer value specifying the priority of the panel compared to others. id - A string containing the unique ID of the panel. label - The human-readable label for the panel icon. image - The hs.image for the panel icon. tooltip - The human-readable details for the toolbar icon when the mouse is hovering over it. closeFn - A callback function that's triggered when the Preferences window is closed.
Signature plugins.core.controlsurfaces.manager.currentPanelID() -> string
Type Function
Description Returns the panel ID with the highest priority.
Parameters
  • None
Returns
  • The panel ID as a string
Signature plugins.core.controlsurfaces.manager.focus() -> boolean
Type Function
Description Puts focus on the Preferences Window.
Parameters
  • None
Returns
  • true if successful or otherwise false.
Signature plugins.core.controlsurfaces.manager.getHandler(id) -> string
Type Function
Description Returns the handler for a given ID.
Parameters
  • id - The ID
Returns
  • Table
Signature plugins.core.controlsurfaces.manager.getLabel() -> string
Type Function
Description Returns the Webview label.
Parameters
  • None
Returns
  • The Webview label as a string.
Signature plugins.core.controlsurfaces.manager.getWebview() -> hs.webview
Type Function
Description Returns the Webview of the Preferences Window.
Parameters
  • None
Returns
  • A hs.webview
Signature plugins.core.controlsurfaces.manager.hide() -> none
Type Function
Description Hides the Preferences Window.
Parameters
  • None
Returns
  • None
Signature plugins.core.controlsurfaces.manager.init() -> nothing
Type Function
Description Initialises the preferences panel.
Parameters
  • None
Returns
  • Nothing
Signature plugins.core.controlsurfaces.manager.injectScript(script) -> none
Type Function
Description Injects JavaScript into the Preferences Webview.
Parameters
  • script - The JavaScript code you want to inject in the form of a string.
Returns
  • None
Signature plugins.core.controlsurfaces.manager.maxPanelHeight() -> number
Type Function
Description Returns the maximum size defined by a panel.
Parameters
  • None
Returns
  • The maximum panel height.
Signature plugins.core.controlsurfaces.manager.new() -> none
Type Function
Description Creates a new Preferences Window.
Parameters
  • None
Returns
  • None
Signature plugins.core.controlsurfaces.manager.refresh() -> none
Type Function
Description Refreshes the Preferences Window.
Parameters
  • None
Returns
  • None
Signature plugins.core.controlsurfaces.manager.selectPanel(id) -> none
Type Function
Description Selects a Preferences Panel.
Parameters
  • id - the ID of the panel you want to select.
Returns
  • None
Signature plugins.core.controlsurfaces.manager.setPanelRenderer(renderer) -> none
Type Function
Description Sets a Panel Renderer
Parameters
  • renderer - The renderer
Returns
  • None
Signature plugins.core.controlsurfaces.manager.show() -> boolean
Type Function
Description Shows the Preferences Window
Parameters
  • None
Returns
  • True if successful or nil if an error occurred