Skip to main content

Scene <Items, Filters>

Hierarchy

Index

Constructors

constructor

  • new Scene<Items, Filters>(args: SceneArgs<Items, Filters>): Scene<Items, Filters>
  • Type parameters

    Parameters

    Returns Scene<Items, Filters>

Properties

filters

filters: Filter<Settings, Source<{}>>[] = []

itemInstances

itemInstances: Set<SceneItem<Source<{}>, Scene<{}, {}>>> = ...

items

items: SceneItem<Source<{}>, Scene<{}, {}>>[] = []

kind

kind: string

linked

linked: boolean = false

name

name: string

obs

obs: OBS

Accessors

exists

  • get exists(): boolean
  • Whether this source has at least one scene item in OBS


    Returns boolean

initialized

  • get initialized(): boolean
  • Whether initialize has been called on this source yet


    Returns boolean

Methods

addFilter

  • addFilter(ref: string, filter: Filter<Settings, Source<{}>>): Promise<void>
  • Adds a filter to this source, provided that 1. The filter has not already been applied to another source, and 2. The source in OBS does not have a filter with a different type but the same name as the filter being added.


    Parameters

    Returns Promise<void>

create

  • create(obs: OBS): Promise<Scene<Items, Filters>>
  • Creates a scene in OBS and populates it with items as defined by the scene’s items schema.


    Parameters

    Returns Promise<Scene<Items, Filters>>

createItem

  • createItem<T>(ref: string, itemSchema: SceneItemSchema<T>): Promise<ReturnType<T[createSceneItemObject]>>
  • Type parameters

    Parameters

    Returns Promise<ReturnType<T[createSceneItemObject]>>

createSceneItemObject

  • Overridable function for creating SceneItem instances for a source. Doesn’t create any objects in OBS. Instead, creates SceneItem objects that can override default SceneItem behaviours.


    Parameters

    • scene: Scene<{}, {}>
    • id: number
    • ref: string

    Returns SceneItem<Scene<Items, Filters>, Scene<{}, {}>>

    An instance of SceneItem or a class that extends it.

filter

  • filter<R>(ref: R): Filters[R]
  • filter(ref: string): undefined | Filter<Settings, Source<{}>>
  • Gets a filter from the input by its ref


    Type parameters

    • R: string | number | symbol

    Parameters

    • ref: R

    Returns Filters[R]

getPrivateSettings

  • getPrivateSettings(): Promise<Settings>
  • 8 Get a source’s private settings. This is an UNDOCUMENTED request of obs-websocket, and SHOULD NOT be used unless you know what you’re doing.


    Returns Promise<Settings>

item

  • item<R>(ref: R): ReturnType<Items[R][createSceneItemObject]>
  • item(ref: string): undefined | SceneItem<Source<{}>, Scene<{}, {}>>
  • Gets a scene item from the scene by its ref.


    Type parameters

    • R: string | number | symbol

    Parameters

    • ref: R

    Returns ReturnType<Items[R][createSceneItemObject]>

link

  • link(obs: OBS, options?: Partial<LinkOptions>): Promise<void>
  • Links to an existing scene in OBS, verifying that all sources as defined by the scene’s items schema exist. Will mark itself as existing if a matching scene is found, but will still throw if the items schema is not matched.


    Parameters

    • obs: OBS
    • optionaloptions: Partial<LinkOptions>

    Returns Promise<void>

makeCurrentScene

  • makeCurrentScene(preview?: boolean): Promise<void>
  • Parameters

    • optionalpreview: boolean

      Whether to make the scene the current preview scene

    Returns Promise<void>

remove

  • remove(): Promise<void>
  • Returns Promise<void>

setName

  • setName(name: string): Promise<void>
  • Parameters

    • name: string

    Returns Promise<void>

setPrivateSettings

  • setPrivateSettings(settings: Settings): Promise<void>
  • Set a source’s private settings. This is an UNDOCUMENTED request of obs-websocket, and SHOULD NOT be used unless you know what you’re doing.


    Parameters

    • settings: Settings

    Returns Promise<void>