sources

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*api.Client
}

Client represents a client for 'sources' requests.

func (*Client) GetSourceActive added in v0.5.0

func (c *Client) GetSourceActive(params *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"`
}

Represents the request body for the GetSourceActive request.

func (*GetSourceActiveParams) GetRequestName added in v0.9.0

func (o *GetSourceActiveParams) GetRequestName() string

Returns the associated request.

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"`
}

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"`
}

Represents the request body for the GetSourceScreenshot request.

func (*GetSourceScreenshotParams) GetRequestName added in v0.9.0

func (o *GetSourceScreenshotParams) GetRequestName() string

Returns the associated request.

type GetSourceScreenshotResponse added in v0.9.0

type GetSourceScreenshotResponse struct {
	// Base64-encoded screenshot
	ImageData string `json:"imageData,omitempty"`
}

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"`
}

Represents the request body for the SaveSourceScreenshot request.

func (*SaveSourceScreenshotParams) GetRequestName added in v0.9.0

func (o *SaveSourceScreenshotParams) GetRequestName() string

Returns the associated request.

type SaveSourceScreenshotResponse added in v0.9.0

type SaveSourceScreenshotResponse struct {
	// Base64-encoded screenshot
	ImageData string `json:"imageData,omitempty"`
}

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