general

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: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastCustomEventParams added in v0.9.0

type BroadcastCustomEventParams struct {
	// Data payload to emit to all receivers
	EventData map[string]any `json:"eventData,omitempty"`
}

Represents the request body for the BroadcastCustomEvent request.

func NewBroadcastCustomEventParams added in v1.0.0

func NewBroadcastCustomEventParams() *BroadcastCustomEventParams

func (*BroadcastCustomEventParams) GetRequestName added in v0.9.0

func (o *BroadcastCustomEventParams) GetRequestName() string

Returns the associated request.

func (*BroadcastCustomEventParams) WithEventData added in v1.0.0

type BroadcastCustomEventResponse added in v0.9.0

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

Represents the response body for the BroadcastCustomEvent request.

type CallVendorRequestParams added in v0.9.0

type CallVendorRequestParams struct {
	// Object containing appropriate request data
	RequestData map[string]any `json:"requestData,omitempty"`

	// The request type to call
	RequestType *string `json:"requestType,omitempty"`

	// Name of the vendor to use
	VendorName *string `json:"vendorName,omitempty"`
}

Represents the request body for the CallVendorRequest request.

func NewCallVendorRequestParams added in v1.0.0

func NewCallVendorRequestParams() *CallVendorRequestParams

func (*CallVendorRequestParams) GetRequestName added in v0.9.0

func (o *CallVendorRequestParams) GetRequestName() string

Returns the associated request.

func (*CallVendorRequestParams) WithRequestData added in v1.0.0

func (o *CallVendorRequestParams) WithRequestData(x map[string]any) *CallVendorRequestParams

func (*CallVendorRequestParams) WithRequestType added in v1.0.0

func (*CallVendorRequestParams) WithVendorName added in v1.0.0

type CallVendorRequestResponse added in v0.9.0

type CallVendorRequestResponse struct {

	// Echoed of `requestType`
	RequestType string `json:"requestType,omitempty"`

	// Object containing appropriate response data. {} if request does not provide any response data
	ResponseData map[string]any `json:"responseData,omitempty"`

	// Echoed of `vendorName`
	VendorName string `json:"vendorName,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the CallVendorRequest request.

type Client

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

Client represents a client for 'general' requests.

func NewClient added in v1.0.0

func NewClient(c *api.Client) *Client

NewGeneral returns a new 'general' client.

func (*Client) BroadcastCustomEvent added in v0.9.0

func (c *Client) BroadcastCustomEvent(params *BroadcastCustomEventParams) (*BroadcastCustomEventResponse, error)

Broadcasts a `CustomEvent` to all WebSocket clients. Receivers are clients which are identified and subscribed.

func (*Client) CallVendorRequest added in v0.9.0

func (c *Client) CallVendorRequest(params *CallVendorRequestParams) (*CallVendorRequestResponse, error)

Call a request registered to a vendor.

A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them.

func (*Client) GetHotkeyList added in v0.9.0

func (c *Client) GetHotkeyList(paramss ...*GetHotkeyListParams) (*GetHotkeyListResponse, error)

Gets an array of all hotkey names in OBS.

Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests.

func (*Client) GetStats added in v0.2.0

func (c *Client) GetStats(paramss ...*GetStatsParams) (*GetStatsResponse, error)

Gets statistics about OBS, obs-websocket, and the current session.

func (*Client) GetVersion

func (c *Client) GetVersion(paramss ...*GetVersionParams) (*GetVersionResponse, error)

Gets data about the current plugin and RPC version.

func (*Client) Sleep added in v0.5.0

func (c *Client) Sleep(paramss ...*SleepParams) (*SleepResponse, error)

Sleeps for a time duration or number of frames. Only available in request batches with types `SERIAL_REALTIME` or `SERIAL_FRAME`.

func (*Client) TriggerHotkeyByKeySequence added in v0.9.0

func (c *Client) TriggerHotkeyByKeySequence(
	paramss ...*TriggerHotkeyByKeySequenceParams,
) (*TriggerHotkeyByKeySequenceResponse, error)

Triggers a hotkey using a sequence of keys.

Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests.

func (*Client) TriggerHotkeyByName added in v0.5.0

func (c *Client) TriggerHotkeyByName(params *TriggerHotkeyByNameParams) (*TriggerHotkeyByNameResponse, error)

Triggers a hotkey using its name. See `GetHotkeyList`.

Note: Hotkey functionality in obs-websocket comes as-is, and we do not guarantee support if things are broken. In 9/10 usages of hotkey requests, there exists a better, more reliable method via other requests.

type GetHotkeyListParams added in v0.9.0

type GetHotkeyListParams struct{}

Represents the request body for the GetHotkeyList request.

func (*GetHotkeyListParams) GetRequestName added in v0.9.0

func (o *GetHotkeyListParams) GetRequestName() string

Returns the associated request.

type GetHotkeyListResponse added in v0.9.0

type GetHotkeyListResponse struct {

	// Array of hotkey names
	Hotkeys []string `json:"hotkeys,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the GetHotkeyList request.

type GetStatsParams added in v0.2.0

type GetStatsParams struct{}

Represents the request body for the GetStats request.

func (*GetStatsParams) GetRequestName added in v0.9.0

func (o *GetStatsParams) GetRequestName() string

Returns the associated request.

type GetStatsResponse added in v0.2.0

type GetStatsResponse struct {

	// Current FPS being rendered
	ActiveFps float64 `json:"activeFps,omitempty"`

	// Available disk space on the device being used for recording storage
	AvailableDiskSpace float64 `json:"availableDiskSpace,omitempty"`

	// Average time in milliseconds that OBS is taking to render a frame
	AverageFrameRenderTime float64 `json:"averageFrameRenderTime,omitempty"`

	// Current CPU usage in percent
	CpuUsage float64 `json:"cpuUsage,omitempty"`

	// Amount of memory in MB currently being used by OBS
	MemoryUsage float64 `json:"memoryUsage,omitempty"`

	// Number of frames skipped by OBS in the output thread
	OutputSkippedFrames float64 `json:"outputSkippedFrames,omitempty"`

	// Total number of frames outputted by the output thread
	OutputTotalFrames float64 `json:"outputTotalFrames,omitempty"`

	// Number of frames skipped by OBS in the render thread
	RenderSkippedFrames float64 `json:"renderSkippedFrames,omitempty"`

	// Total number of frames outputted by the render thread
	RenderTotalFrames float64 `json:"renderTotalFrames,omitempty"`

	// Total number of messages received by obs-websocket from the client
	WebSocketSessionIncomingMessages float64 `json:"webSocketSessionIncomingMessages,omitempty"`

	// Total number of messages sent by obs-websocket to the client
	WebSocketSessionOutgoingMessages float64 `json:"webSocketSessionOutgoingMessages,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the GetStats request.

type GetVersionParams

type GetVersionParams struct{}

Represents the request body for the GetVersion request.

func (*GetVersionParams) GetRequestName added in v0.9.0

func (o *GetVersionParams) GetRequestName() string

Returns the associated request.

type GetVersionResponse

type GetVersionResponse struct {

	// Array of available RPC requests for the currently negotiated RPC version
	AvailableRequests []string `json:"availableRequests,omitempty"`

	// Current OBS Studio version
	ObsVersion string `json:"obsVersion,omitempty"`

	// Current obs-websocket version
	ObsWebSocketVersion string `json:"obsWebSocketVersion,omitempty"`

	// Name of the platform. Usually `windows`, `macos`, or `ubuntu` (linux flavor). Not guaranteed to be any of those
	Platform string `json:"platform,omitempty"`

	// Description of the platform, like `Windows 10 (10.0)`
	PlatformDescription string `json:"platformDescription,omitempty"`

	// Current latest obs-websocket RPC version
	RpcVersion float64 `json:"rpcVersion,omitempty"`

	// Image formats available in `GetSourceScreenshot` and `SaveSourceScreenshot` requests.
	SupportedImageFormats []string `json:"supportedImageFormats,omitempty"`
	// contains filtered or unexported fields
}

Represents the response body for the GetVersion request.

type SleepParams added in v0.5.0

type SleepParams struct {
	// Number of frames to sleep for (if `SERIAL_FRAME` mode)
	SleepFrames *float64 `json:"sleepFrames,omitempty"`

	// Number of milliseconds to sleep for (if `SERIAL_REALTIME` mode)
	SleepMillis *float64 `json:"sleepMillis,omitempty"`
}

Represents the request body for the Sleep request.

func NewSleepParams added in v1.0.0

func NewSleepParams() *SleepParams

func (*SleepParams) GetRequestName added in v0.9.0

func (o *SleepParams) GetRequestName() string

Returns the associated request.

func (*SleepParams) WithSleepFrames added in v1.0.0

func (o *SleepParams) WithSleepFrames(x float64) *SleepParams

func (*SleepParams) WithSleepMillis added in v1.0.0

func (o *SleepParams) WithSleepMillis(x float64) *SleepParams

type SleepResponse added in v0.5.0

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

Represents the response body for the Sleep request.

type TriggerHotkeyByKeySequenceParams added in v0.9.0

type TriggerHotkeyByKeySequenceParams struct {
	// The OBS key ID to use. See https://github.com/obsproject/obs-studio/blob/master/libobs/obs-hotkeys.h
	KeyId *string `json:"keyId,omitempty"`

	// Object containing key modifiers to apply
	KeyModifiers *typedefs.KeyModifiers `json:"keyModifiers,omitempty"`
}

Represents the request body for the TriggerHotkeyByKeySequence request.

func NewTriggerHotkeyByKeySequenceParams added in v1.0.0

func NewTriggerHotkeyByKeySequenceParams() *TriggerHotkeyByKeySequenceParams

func (*TriggerHotkeyByKeySequenceParams) GetRequestName added in v0.9.0

func (o *TriggerHotkeyByKeySequenceParams) GetRequestName() string

Returns the associated request.

func (*TriggerHotkeyByKeySequenceParams) WithKeyId added in v1.0.0

func (*TriggerHotkeyByKeySequenceParams) WithKeyModifiers added in v1.0.0

type TriggerHotkeyByKeySequenceResponse added in v0.9.0

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

Represents the response body for the TriggerHotkeyByKeySequence request.

type TriggerHotkeyByNameParams added in v0.5.0

type TriggerHotkeyByNameParams struct {
	// Name of context of the hotkey to trigger
	ContextName *string `json:"contextName,omitempty"`

	// Name of the hotkey to trigger
	HotkeyName *string `json:"hotkeyName,omitempty"`
}

Represents the request body for the TriggerHotkeyByName request.

func NewTriggerHotkeyByNameParams added in v1.0.0

func NewTriggerHotkeyByNameParams() *TriggerHotkeyByNameParams

func (*TriggerHotkeyByNameParams) GetRequestName added in v0.9.0

func (o *TriggerHotkeyByNameParams) GetRequestName() string

Returns the associated request.

func (*TriggerHotkeyByNameParams) WithContextName added in v1.2.0

func (*TriggerHotkeyByNameParams) WithHotkeyName added in v1.0.0

type TriggerHotkeyByNameResponse added in v0.5.0

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

Represents the response body for the TriggerHotkeyByName request.

Jump to

Keyboard shortcuts

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