sources

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a client for 'sources' requests.

func NewClient added in v1.0.0

func NewClient(c *api.Client) *Client

NewSources returns a new 'sources' client.

func (*Client) GetSourceActive added in v0.5.0

func (c *Client) GetSourceActive(paramss ...*GetSourceActiveParams) (*GetSourceActiveResponse, error)

Gets the active and show state of a source.

**Compatible with inputs and scenes.**

func (*Client) GetSourceScreenshot added in v0.9.0

func (c *Client) GetSourceScreenshot(params *GetSourceScreenshotParams) (*GetSourceScreenshotResponse, error)

Gets a Base64-encoded screenshot of a source.

The `imageWidth` and `imageHeight` parameters are treated as "scale to inner", meaning the smallest ratio will be used and the aspect ratio of the original resolution is kept. If `imageWidth` and `imageHeight` are not specified, the compressed image will use the full resolution of the source.

**Compatible with inputs and scenes.**

func (*Client) SaveSourceScreenshot added in v0.9.0

func (c *Client) SaveSourceScreenshot(params *SaveSourceScreenshotParams) (*SaveSourceScreenshotResponse, error)

Saves a screenshot of a source to the filesystem.

The `imageWidth` and `imageHeight` parameters are treated as "scale to inner", meaning the smallest ratio will be used and the aspect ratio of the original resolution is kept. If `imageWidth` and `imageHeight` are not specified, the compressed image will use the full resolution of the source.

**Compatible with inputs and scenes.**

type GetSourceActiveParams added in v0.5.0

type GetSourceActiveParams struct {
	// Name of the source to get the active state of
	SourceName *string `json:"sourceName,omitempty"`

	// UUID of the source to get the active state of
	SourceUuid *string `json:"sourceUuid,omitempty"`
}

Represents the request body for the GetSourceActive request.

func NewGetSourceActiveParams added in v1.0.0

func NewGetSourceActiveParams() *GetSourceActiveParams

func (*GetSourceActiveParams) GetRequestName added in v0.9.0

func (o *GetSourceActiveParams) GetRequestName() string

Returns the associated request.

func (*GetSourceActiveParams) WithSourceName added in v1.0.0

func (o *GetSourceActiveParams) WithSourceName(x string) *GetSourceActiveParams

func (*GetSourceActiveParams) WithSourceUuid added in v1.2.0

func (o *GetSourceActiveParams) WithSourceUuid(x string) *GetSourceActiveParams

type GetSourceActiveResponse added in v0.5.0

type GetSourceActiveResponse struct {

	// Whether the source is showing in Program
	VideoActive bool `json:"videoActive,omitempty"`

	// Whether the source is showing in the UI (Preview, Projector, Properties)
	VideoShowing bool `json:"videoShowing,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the GetSourceActive request.

type GetSourceScreenshotParams added in v0.9.0

type GetSourceScreenshotParams struct {
	// Compression quality to use. 0 for high compression, 100 for uncompressed. -1 to use "default" (whatever that
	// means, idk)
	ImageCompressionQuality *float64 `json:"imageCompressionQuality,omitempty"`

	// Image compression format to use. Use `GetVersion` to get compatible image formats
	ImageFormat *string `json:"imageFormat,omitempty"`

	// Height to scale the screenshot to
	ImageHeight *float64 `json:"imageHeight,omitempty"`

	// Width to scale the screenshot to
	ImageWidth *float64 `json:"imageWidth,omitempty"`

	// Name of the source to take a screenshot of
	SourceName *string `json:"sourceName,omitempty"`

	// UUID of the source to take a screenshot of
	SourceUuid *string `json:"sourceUuid,omitempty"`
}

Represents the request body for the GetSourceScreenshot request.

func NewGetSourceScreenshotParams added in v1.0.0

func NewGetSourceScreenshotParams() *GetSourceScreenshotParams

func (*GetSourceScreenshotParams) GetRequestName added in v0.9.0

func (o *GetSourceScreenshotParams) GetRequestName() string

Returns the associated request.

func (*GetSourceScreenshotParams) WithImageCompressionQuality added in v1.0.0

func (o *GetSourceScreenshotParams) WithImageCompressionQuality(x float64) *GetSourceScreenshotParams

func (*GetSourceScreenshotParams) WithImageFormat added in v1.0.0

func (*GetSourceScreenshotParams) WithImageHeight added in v1.0.0

func (*GetSourceScreenshotParams) WithImageWidth added in v1.0.0

func (*GetSourceScreenshotParams) WithSourceName added in v1.0.0

func (*GetSourceScreenshotParams) WithSourceUuid added in v1.2.0

type GetSourceScreenshotResponse added in v0.9.0

type GetSourceScreenshotResponse struct {

	// Base64-encoded screenshot
	ImageData string `json:"imageData,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the GetSourceScreenshot request.

type SaveSourceScreenshotParams added in v0.9.0

type SaveSourceScreenshotParams struct {
	// Compression quality to use. 0 for high compression, 100 for uncompressed. -1 to use "default" (whatever that
	// means, idk)
	ImageCompressionQuality *float64 `json:"imageCompressionQuality,omitempty"`

	// Path to save the screenshot file to. Eg. `C:\Users\user\Desktop\screenshot.png`
	ImageFilePath *string `json:"imageFilePath,omitempty"`

	// Image compression format to use. Use `GetVersion` to get compatible image formats
	ImageFormat *string `json:"imageFormat,omitempty"`

	// Height to scale the screenshot to
	ImageHeight *float64 `json:"imageHeight,omitempty"`

	// Width to scale the screenshot to
	ImageWidth *float64 `json:"imageWidth,omitempty"`

	// Name of the source to take a screenshot of
	SourceName *string `json:"sourceName,omitempty"`

	// UUID of the source to take a screenshot of
	SourceUuid *string `json:"sourceUuid,omitempty"`
}

Represents the request body for the SaveSourceScreenshot request.

func NewSaveSourceScreenshotParams added in v1.0.0

func NewSaveSourceScreenshotParams() *SaveSourceScreenshotParams

func (*SaveSourceScreenshotParams) GetRequestName added in v0.9.0

func (o *SaveSourceScreenshotParams) GetRequestName() string

Returns the associated request.

func (*SaveSourceScreenshotParams) WithImageCompressionQuality added in v1.0.0

func (o *SaveSourceScreenshotParams) WithImageCompressionQuality(x float64) *SaveSourceScreenshotParams

func (*SaveSourceScreenshotParams) WithImageFilePath added in v1.0.0

func (*SaveSourceScreenshotParams) WithImageFormat added in v1.0.0

func (*SaveSourceScreenshotParams) WithImageHeight added in v1.0.0

func (*SaveSourceScreenshotParams) WithImageWidth added in v1.0.0

func (*SaveSourceScreenshotParams) WithSourceName added in v1.0.0

func (*SaveSourceScreenshotParams) WithSourceUuid added in v1.2.0

type SaveSourceScreenshotResponse added in v0.9.0

type SaveSourceScreenshotResponse struct {
	// contains filtered or unexported fields
}

Represents the response body for the SaveSourceScreenshot request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL