Merge pull request #36 from onyx-and-iris/add-projector-methods

Add projector methods
This commit is contained in:
Onyx and Iris 2023-10-10 17:38:53 +01:00 committed by GitHub
commit 3c36619173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import logging import logging
from warnings import warn
from .baseclient import ObsClient from .baseclient import ObsClient
from .error import OBSSDKError, OBSSDKRequestError from .error import OBSSDKError, OBSSDKRequestError
@ -1938,3 +1939,66 @@ class ReqClient:
""" """
return self.send("GetMonitorList") return self.send("GetMonitorList")
def open_video_mix_projector(
self, video_mix_type, monitor_index=-1, projector_geometry=None
):
"""
Opens a projector for a specific output video mix.
The available mix types are:
OBS_WEBSOCKET_VIDEO_MIX_TYPE_PREVIEW
OBS_WEBSOCKET_VIDEO_MIX_TYPE_PROGRAM
OBS_WEBSOCKET_VIDEO_MIX_TYPE_MULTIVIEW
:param video_mix_type: Type of mix to open.
:type video_mix_type: str
:param monitor_index: Monitor index, use GetMonitorList to obtain index
:type monitor_index: int
:param projector_geometry:
Size/Position data for a windowed projector, in Qt Base64 encoded format.
Mutually exclusive with monitorIndex
:type projector_geometry: str
"""
warn(
"open_video_mix_projector request serves to provide feature parity with 4.x. "
"It is very likely to be changed/deprecated in a future release.",
DeprecationWarning,
stacklevel=2,
)
payload = {
"videoMixType": video_mix_type,
"monitorIndex": monitor_index,
"projectorGeometry": projector_geometry,
}
self.send("OpenVideoMixProjector", payload)
def open_source_projector(
self, source_name, monitor_index=-1, projector_geometry=None
):
"""
Opens a projector for a source.
:param source_name: Name of the source to open a projector for
:type source_name: str
:param monitor_index: Monitor index, use GetMonitorList to obtain index
:type monitor_index: int
:param projector_geometry:
Size/Position data for a windowed projector, in Qt Base64 encoded format.
Mutually exclusive with monitorIndex
:type projector_geometry: str
"""
warn(
"open_source_projector request serves to provide feature parity with 4.x. "
"It is very likely to be changed/deprecated in a future release.",
DeprecationWarning,
stacklevel=2,
)
payload = {
"sourceName": source_name,
"monitorIndex": monitor_index,
"projectorGeometry": projector_geometry,
}
self.send("OpenSourceProjector", payload)

View File

@ -1 +1 @@
version = "1.6.0" version = "1.6.1"

View File

@ -15,9 +15,9 @@ class TestRequests:
resp = req_cl.get_hot_key_list() resp = req_cl.get_hot_key_list()
obsbasic_hotkey_list = [ obsbasic_hotkey_list = [
"OBSBasic.SelectScene", "OBSBasic.SelectScene",
"OBSBasic.SelectScene", "OBSBasic.QuickTransition.1",
"OBSBasic.SelectScene", "OBSBasic.QuickTransition.2",
"OBSBasic.SelectScene", "OBSBasic.QuickTransition.3",
"OBSBasic.StartStreaming", "OBSBasic.StartStreaming",
"OBSBasic.StopStreaming", "OBSBasic.StopStreaming",
"OBSBasic.ForceStopStreaming", "OBSBasic.ForceStopStreaming",
@ -25,15 +25,17 @@ class TestRequests:
"OBSBasic.StopRecording", "OBSBasic.StopRecording",
"OBSBasic.PauseRecording", "OBSBasic.PauseRecording",
"OBSBasic.UnpauseRecording", "OBSBasic.UnpauseRecording",
"OBSBasic.SplitFile",
"OBSBasic.StartReplayBuffer", "OBSBasic.StartReplayBuffer",
"OBSBasic.StopReplayBuffer", "OBSBasic.StopReplayBuffer",
"OBSBasic.StartVirtualCam", "OBSBasic.StartVirtualCam",
"OBSBasic.StopVirtualCam", "OBSBasic.StopVirtualCam",
"OBSBasic.EnablePreview", "OBSBasic.EnablePreview",
"OBSBasic.DisablePreview", "OBSBasic.DisablePreview",
"OBSBasic.EnablePreviewProgram",
"OBSBasic.DisablePreviewProgram",
"OBSBasic.ShowContextBar", "OBSBasic.ShowContextBar",
"OBSBasic.HideContextBar", "OBSBasic.HideContextBar",
"OBSBasic.TogglePreviewProgram",
"OBSBasic.Transition", "OBSBasic.Transition",
"OBSBasic.ResetStats", "OBSBasic.ResetStats",
"OBSBasic.Screenshot", "OBSBasic.Screenshot",