Documentation ¶
Overview ¶
Package obs provides a basic obs-websocket 5.0 client. It supports all of the API calls needed for resetti to function.
See https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md for more detailed documentation on the websocket protocol.
Index ¶
- type Batch
- type BatchMode
- type Client
- func (c *Client) AddSceneItem(scene, name string) error
- func (c *Client) Batch(mode BatchMode, fn func(*Batch) error) (err error)
- func (c *Client) Connect(ctx context.Context, addr string, pw string) (<-chan error, error)
- func (c *Client) CreateScene(name string) error
- func (c *Client) CreateSceneCollection(name string) error
- func (c *Client) CreateSource(scene, name string, kind SourceKind, settings StringMap) error
- func (c *Client) DeleteScene(name string) error
- func (c *Client) GetCanvasSize() (width, height int, err error)
- func (c *Client) GetSceneCollectionList() (collections []string, active string, err error)
- func (c *Client) GetSceneItemTransform(scene, name string) (x, y, w, h float64, err error)
- func (c *Client) GetSceneList() ([]string, error)
- func (c *Client) SetScene(name string) error
- func (c *Client) SetSceneCollection(name string) error
- func (c *Client) SetSceneItemBounds(scene, name string, x, y, w, h float64) error
- func (c *Client) SetSceneItemLocked(scene, name string, locked bool) error
- func (c *Client) SetSceneItemVisible(scene, name string, visible bool) error
- func (c *Client) SetSourceSettings(name string, settings StringMap, overlay bool) error
- type SourceKind
- type StringMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶ added in v0.4.0
type Batch struct {
// contains filtered or unexported fields
}
Batch contains multiple requests which are to be submitted and executed at once.
func (*Batch) SetItemPosition ¶ added in v0.4.0
func (*Batch) SetItemVisibility ¶ added in v0.4.0
type BatchMode ¶ added in v0.4.0
type BatchMode int
BatchMode contains the mode the requests of a batch are to be executed in.
type Client ¶ added in v0.4.0
type Client struct {
// contains filtered or unexported fields
}
Client manages an OBS websocket connection.
func (*Client) AddSceneItem ¶ added in v0.4.0
AddSceneItem adds the source with the given name to the given scene.
func (*Client) Batch ¶ added in v0.4.0
Batch creates and *synchronously* submits a new request batch. The provided closure can be used to add requests to the batch. If the closure returns an error or panics, the batch will not be submitted.
func (*Client) Connect ¶ added in v0.4.0
Connect attempts to connect to an OBS instance at the given address. If authentication is required, the given password will be used.
func (*Client) CreateScene ¶ added in v0.4.0
CreateScene creates a new scene with the given name in the current scene collection.
func (*Client) CreateSceneCollection ¶ added in v0.4.0
CreateSceneCollection creates a new scene collection with the given name if one does not already exist.
func (*Client) CreateSource ¶ added in v0.4.0
func (c *Client) CreateSource(scene, name string, kind SourceKind, settings StringMap) error
CreateSource creates a new source with the given name and settings on the given scene.
func (*Client) DeleteScene ¶ added in v0.4.0
DeleteScene deletes the given scene.
func (*Client) GetCanvasSize ¶ added in v0.4.0
GetCanvasSize returns the base resolution (canvas size) of the current OBS profile.
func (*Client) GetSceneCollectionList ¶ added in v0.4.0
GetSceneCollectionList returns a list of the existing scene collections and which one is currently active.
func (*Client) GetSceneItemTransform ¶ added in v0.4.0
GetSceneItemTransform returns the size and position of the given scene item.
func (*Client) GetSceneList ¶ added in v0.4.0
GetSceneList returns a list of the existing scenes.
func (*Client) SetSceneCollection ¶ added in v0.4.0
SetSceneCollection sets the current scene collection.
func (*Client) SetSceneItemBounds ¶ added in v0.4.0
SetSceneItemBounds moves and resizes the given scene item.
func (*Client) SetSceneItemLocked ¶ added in v0.4.0
SetSceneItemLocked locks or unlocks the given scene item.
func (*Client) SetSceneItemVisible ¶ added in v0.4.0
SetSceneItemVisible hides or shows the given scene item.
type SourceKind ¶ added in v0.4.0
type SourceKind string
SourceKind contains the input type for a given source.
const ( KindWindow SourceKind = "xcomposite_input" KindImage SourceKind = "image_source" )
Source kinds.