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
- func (b *Batch) SetItemBounds(scene, name string, x, y, w, h float64)
- func (b *Batch) SetItemIndex(scene, name string, index int)
- func (b *Batch) SetItemVisibility(scene, name string, visible bool)
- func (b *Batch) SetSourceFilterEnabled(source, filter string, enabled bool)
- func (b *Batch) SetSourceSettings(source string, settings StringMap, keep bool)
- type BatchMode
- type Client
- func (c *Client) Batch(mode BatchMode, fn func(*Batch)) error
- func (c *Client) BatchAsync(mode BatchMode, fn func(*Batch))
- func (c *Client) Connect(ctx context.Context, port uint16, pw string) (<-chan error, error)
- func (c *Client) GetCanvasSize() (width, height int, err error)
- func (c *Client) GetSceneItemIndex(scene, name string) (int, error)
- func (c *Client) GetSceneItemTransform(scene, name string) (x, y, w, h float64, err error)
- func (c *Client) GetSourceFilterList(source string) ([]string, error)
- func (c *Client) SetScene(name string)
- func (c *Client) SetSceneItemBounds(scene, name string, x, y, w, h float64)
- func (c *Client) SetSceneItemVisible(scene, name string, visible bool)
- func (c *Client) SetSourceFilterEnabled(source, filter string, enabled bool)
- type SourceKind
- type StringMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch contains multiple requests which are to be submitted and executed at once.
func (*Batch) SetItemBounds ¶
func (*Batch) SetItemIndex ¶
func (*Batch) SetItemVisibility ¶
func (*Batch) SetSourceFilterEnabled ¶
type BatchMode ¶
type BatchMode int
BatchMode contains the mode the requests of a batch are to be executed in.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages an OBS websocket connection.
func (*Client) Batch ¶
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) BatchAsync ¶
BatchAsync creates and submits a new request batch in another goroutine. If the batch errors, the error will be logged.
func (*Client) Connect ¶
Connect attempts to connect to an OBS instance at the given address. If authentication is required, the given password will be used.
func (*Client) GetCanvasSize ¶
GetCanvasSize returns the base resolution (canvas size) of the current OBS profile.
func (*Client) GetSceneItemIndex ¶
GetSceneItemIndex returns the index of the given scene item.
func (*Client) GetSceneItemTransform ¶
GetSceneItemTransform returns the size and position of the given scene item.
func (*Client) GetSourceFilterList ¶
GetSourceFilterList gets a list of all source filters on a given source.
func (*Client) SetSceneItemBounds ¶
SetSceneItemBounds moves and resizes the given scene item and logs any errors that occur.
func (*Client) SetSceneItemVisible ¶
SetSceneItemVisible hides or shows the given scene item and logs any errors that occur.
func (*Client) SetSourceFilterEnabled ¶
SetSourceFilterEnabled enables or disables a given filter and logs any errors that occur.
type SourceKind ¶
type SourceKind string
SourceKind contains the input type for a given source.
const ( KindWindow SourceKind = "xcomposite_input" KindImage SourceKind = "image_source" )
Source kinds.