Class InstanceBase<TConfig>Abstract

Type Parameters

  • TConfig

Implements

Constructors

Properties

id: string

Accessors

  • get label(): string
  • The user chosen name for this instance. This can be changed just before configUpdated is called

    Returns string

Methods

  • Returns Pick<ActionInstance,
        | "id"
        | "controlId"
        | "actionId"
        | "options">[]

  • Returns Pick<FeedbackInstance,
        | "id"
        | "controlId"
        | "options"
        | "feedbackId">[]

  • Request all feedbacks of the specified types to be checked for changes

    Parameters

    • Rest...feedbackTypes: string[]

      The feedback types to check

    Returns void

  • Request the specified feedback instances to be checked for changes

    Parameters

    • Rest...feedbackIds: string[]

      The ids of the feedback instances to check

    Returns void

  • Called when the configuration is updated.

    Parameters

    • config: TConfig

      The new config object

    Returns Promise<void>

  • Create a shared udp socket. This can be neccessary for modules where the device/software sends UDP messages to a hardcoded port number. In those cases if you don't use this then it won't be possible to use multiple instances of you module. The api here is a subset of the Socket from the builtin node:dgram, but with Companion hosting the sockets instead of the module.

    Parameters

    • type: "udp4" | "udp6"

      Type of udp to use

    • Optionalcallback: SharedUdpSocketMessageCallback

      Message received callback

    Returns SharedUdpSocket

  • Parameters

    • options: SharedUdpSocketOptions
    • Optionalcallback: SharedUdpSocketMessageCallback

    Returns SharedUdpSocket

  • Clean up the instance before it is destroyed.

    Returns Promise<void>

  • Handle request from Companion to start/stop recording actions

    Parameters

    • isRecording: boolean

      whether recording is now running

    Returns void

  • Main initialization function called once the module is OK to start doing things.

    Parameters

    • config: TConfig
    • isFirstInit: boolean

    Returns Promise<void>

  • Write a line to the log

    Parameters

    • level: LogLevel

      The level of the message

    • message: string

      The message text to write

    Returns void

  • Send an osc message from the system osc sender

    Parameters

    • host: string

      destination ip address

    • port: number

      destination port number

    • path: string

      message path

    • args: OSCSomeArguments

      mesage arguments

    Returns void

  • Parse and replace all the variables in a string Note: You must not use this for feedbacks, as your feedback will not update when the variable changes. There is an alternate version of this supplied to each of the action/feedback callbacks that tracks usages properly and will retrigger the feedback when the variables change.

    Parameters

    • text: string

      The text to parse

    Returns Promise<string>

    The string with variables replaced with their values

  • Add an action to the current recording session

    Parameters

    • action: CompanionRecordedAction

      The action to be added to the recording session

    • OptionaluniquenessId: string

      A unique id for the action being recorded. This should be different for each action, but by passing the same as a previous call will replace the previous value.

    Returns void

  • Parameters

    Returns void

    Promise which resolves upon success, or rejects if the variable no longer exists

    Experimental: This method may change without notice. Do not use! Set the value of a custom variable

  • Call subscribe on all currently known placed actions. It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.

    Parameters

    • Rest...actionIds: string[]

      The actionIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call subscribe on all currently known placed feedbacks. It can be useful to trigger this upon establishing a connection, to ensure all data is loaded.

    Parameters

    • Rest...feedbackIds: string[]

      The feedbackIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call unsubscribe on all currently known placed actions. It can be useful to do some cleanup upon a connection closing.

    Parameters

    • Rest...actionIds: string[]

      The actionIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Call unsubscribe on all currently known placed feedbacks. It can be useful to do some cleanup upon a connection closing.

    Parameters

    • Rest...feedbackIds: string[]

      The feedbackIds to call subscribe for. If no values are provided, then all are called.

    Returns void

  • Update the status of this connection

    Parameters

    • status: InstanceStatus

      The status level

    • Optionalmessage: null | string

      Additional information about the status

      this.updateStatus(InstanceStatus.Ok)
      

    Returns void