2022-10-22 22:30:40 +01:00
|
|
|
module OBSWS
|
|
|
|
module Requests
|
|
|
|
class Client
|
2023-07-26 14:37:35 +01:00
|
|
|
include Logging
|
2022-10-22 22:30:40 +01:00
|
|
|
include Mixin::TearDown
|
|
|
|
include Mixin::OPCodes
|
|
|
|
|
|
|
|
def initialize(**kwargs)
|
|
|
|
@base_client = Base.new(**kwargs)
|
2023-08-11 22:05:01 +01:00
|
|
|
unless @base_client.identified.state == :identified
|
|
|
|
err_msg = @base_client.identified.error_message
|
|
|
|
logger.error(err_msg)
|
|
|
|
raise OBSWSConnectionError.new(err_msg)
|
|
|
|
end
|
2023-07-26 16:15:43 +01:00
|
|
|
logger.info("#{self} successfully identified with server")
|
2023-08-11 02:22:14 +01:00
|
|
|
rescue Errno::ECONNREFUSED, WaitUtil::TimeoutError => e
|
2023-08-11 14:41:09 +01:00
|
|
|
logger.error("#{e.class.name}: #{e.message}")
|
|
|
|
raise OBSWSConnectionError.new(e.message)
|
2023-08-11 02:22:14 +01:00
|
|
|
else
|
2023-07-26 10:51:38 +01:00
|
|
|
@base_client.updater = ->(op_code, data) {
|
2023-07-26 14:37:35 +01:00
|
|
|
logger.debug("response received: #{data}")
|
2023-07-26 10:51:38 +01:00
|
|
|
@response = data if op_code == Mixin::OPCodes::REQUESTRESPONSE
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
@response = {requestId: 0}
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
2022-10-25 00:03:43 +01:00
|
|
|
def to_s
|
2023-07-19 15:12:25 +01:00
|
|
|
self.class.name.split("::").last(2).join("::")
|
2022-10-25 00:03:43 +01:00
|
|
|
end
|
|
|
|
|
2022-10-22 22:30:40 +01:00
|
|
|
def run
|
2023-07-19 15:12:25 +01:00
|
|
|
yield(self)
|
2022-10-22 22:30:40 +01:00
|
|
|
ensure
|
2023-07-26 10:51:38 +01:00
|
|
|
stop_driver
|
2022-10-22 22:30:40 +01:00
|
|
|
WaitUtil.wait_for_condition(
|
2022-11-25 17:57:56 +00:00
|
|
|
"driver to close",
|
2022-10-22 22:30:40 +01:00
|
|
|
delay_sec: 0.01,
|
|
|
|
timeout_sec: 1
|
|
|
|
) { @base_client.closed }
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(req, data = nil)
|
2023-08-11 17:04:38 +01:00
|
|
|
uuid = SecureRandom.uuid
|
|
|
|
@base_client.req(uuid, req, data)
|
2022-10-22 22:30:40 +01:00
|
|
|
WaitUtil.wait_for_condition(
|
2022-11-25 17:57:56 +00:00
|
|
|
"reponse id to match request id",
|
2022-10-22 22:30:40 +01:00
|
|
|
delay_sec: 0.001,
|
|
|
|
timeout_sec: 3
|
2023-08-11 17:04:38 +01:00
|
|
|
) { @response[:requestId] == uuid }
|
2023-07-28 19:05:28 +01:00
|
|
|
unless @response[:requestStatus][:result]
|
2023-08-11 17:10:17 +01:00
|
|
|
raise OBSWSRequestError.new(@response[:requestType], @response[:requestStatus][:code], @response[:requestStatus][:comment])
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
@response[:responseData]
|
2023-08-11 17:10:17 +01:00
|
|
|
rescue OBSWSRequestError => e
|
|
|
|
logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n"))
|
|
|
|
raise
|
2023-08-11 02:22:14 +01:00
|
|
|
rescue WaitUtil::TimeoutError => e
|
2023-08-11 14:41:09 +01:00
|
|
|
logger.error(["#{e.class.name}: #{e.message}", *e.backtrace].join("\n"))
|
|
|
|
raise OBSWSError.new([e.message, *e.backtrace].join("\n"))
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_version
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetVersion)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_stats
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetStats)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def broadcast_custom_event(data)
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:BroadcastCustomEvent, data)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
2023-07-19 15:12:25 +01:00
|
|
|
def call_vendor_request(vendor_name, request_type, data = nil)
|
|
|
|
payload = {vendorName: vendor_name, requestType: request_type}
|
2022-11-18 14:52:28 +00:00
|
|
|
payload[:requestData] = data if data
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:CallVendorRequest, payload)
|
2022-11-18 14:52:28 +00:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_hotkey_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetHotkeyList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger_hotkey_by_name(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {hotkeyName: name}
|
|
|
|
call(:TriggerHotkeyByName, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def trigger_hotkey_by_key_sequence(
|
|
|
|
key_id,
|
|
|
|
press_shift,
|
|
|
|
press_ctrl,
|
|
|
|
press_alt,
|
|
|
|
press_cmd
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
keyId: key_id,
|
|
|
|
keyModifiers: {
|
|
|
|
shift: press_shift,
|
|
|
|
control: press_ctrl,
|
|
|
|
alt: press_alt,
|
|
|
|
cmd: press_cmd
|
|
|
|
}
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:TriggerHotkeyByKeySequence, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def sleep(sleep_millis = nil, sleep_frames = nil)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sleepMillis: sleep_millis, sleepFrames: sleep_frames}
|
|
|
|
call(:Sleep, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_persistent_data(realm, slot_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {realm: realm, slotName: slot_name}
|
|
|
|
resp = call(:GetPersistentData, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_persistent_data(realm, slot_name, slot_value)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {realm: realm, slotName: slot_name, slotValue: slot_value}
|
|
|
|
call(:SetPersistentData, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_collection_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSceneCollectionList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_scene_collection(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneCollectionName: name}
|
|
|
|
call(:SetCurrentSceneCollection, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_scene_collection(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneCollectionName: name}
|
|
|
|
call(:CreateSceneCollection, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_profile_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetProfileList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_profile(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {profileName: name}
|
|
|
|
call(:SetCurrentProfile, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_profile(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {profileName: name}
|
|
|
|
call(:CreateProfile, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def remove_profile(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {profileName: name}
|
|
|
|
call(:RemoveProfile, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_profile_parameter(category, name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {parameterCategory: category, parameterName: name}
|
|
|
|
resp = call(:GetProfileParameter, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_profile_parameter(category, name, value)
|
|
|
|
payload = {
|
|
|
|
parameterCategory: category,
|
|
|
|
parameterName: name,
|
|
|
|
parameterValue: value
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetProfileParameter, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_video_settings
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetVideoSettings)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_video_settings(
|
|
|
|
numerator,
|
|
|
|
denominator,
|
|
|
|
base_width,
|
|
|
|
base_height,
|
|
|
|
out_width,
|
|
|
|
out_height
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
fpsNumerator: numerator,
|
|
|
|
fpsDenominator: denominator,
|
|
|
|
baseWidth: base_width,
|
|
|
|
baseHeight: base_height,
|
|
|
|
outputWidth: out_width,
|
|
|
|
outputHeight: out_height
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetVideoSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_stream_service_settings
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetStreamServiceSettings)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_stream_service_settings(ss_type, ss_settings)
|
|
|
|
payload = {
|
|
|
|
streamServiceType: ss_type,
|
|
|
|
streamServiceSettings: ss_settings
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetStreamServiceSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_record_directory
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetRecordDirectory)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_source_active(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sourceName: name}
|
|
|
|
resp = call(:GetSourceActive, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_source_screenshot(name, img_format, width, height, quality)
|
|
|
|
payload = {
|
|
|
|
sourceName: name,
|
|
|
|
imageFormat: img_format,
|
|
|
|
imageWidth: width,
|
|
|
|
imageHeight: height,
|
|
|
|
imageCompressionQuality: quality
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSourceScreenshot, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def save_source_screenshot(
|
|
|
|
name,
|
|
|
|
img_format,
|
|
|
|
file_path,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
quality
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
sourceName: name,
|
|
|
|
imageFormat: img_format,
|
|
|
|
imageFilePath: file_path,
|
|
|
|
imageWidth: width,
|
|
|
|
imageHeight: height,
|
|
|
|
imageCompressionQuality: quality
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:SaveSourceScreenshot, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSceneList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_group_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetGroupList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_current_program_scene
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetCurrentProgramScene)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_program_scene(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
call(:SetCurrentProgramScene, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_current_preview_scene
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetCurrentPreviewScene)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_preview_scene(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
call(:SetCurrentPreviewScene, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_scene(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
call(:CreateScene, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def remove_scene(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
call(:RemoveScene, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_name(old_name, new_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: old_name, newSceneName: new_name}
|
|
|
|
call(:SetSceneName, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_scene_transition_override(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
resp = call(:GetSceneSceneTransitionOverride, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_scene_transition_override(scene_name, tr_name, tr_duration)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
transitionName: tr_name,
|
|
|
|
transitionDuration: tr_duration
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneSceneTransitionOverride, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_list(kind = nil)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputKind: kind}
|
|
|
|
resp = call(:GetInputList, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_kind_list(unversioned)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {unversioned: unversioned}
|
|
|
|
resp = call(:GetInputKindList, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_special_inputs
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSpecialInputs)
|
2022-11-03 04:11:59 +00:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def create_input(
|
|
|
|
scene_name,
|
|
|
|
input_name,
|
|
|
|
input_kind,
|
|
|
|
input_settings,
|
|
|
|
scene_item_enabled
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
inputName: input_name,
|
|
|
|
inputKind: input_kind,
|
|
|
|
inputSettings: input_settings,
|
|
|
|
sceneItemEnabled: scene_item_enabled
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:CreateInput, payload)
|
2022-11-03 04:11:59 +00:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def remove_input(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
call(:RemoveInput, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_name(old_name, new_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: old_name, newInputName: new_name}
|
|
|
|
call(:SetInputName, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_default_settings(kind)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputKind: kind}
|
|
|
|
resp = call(:GetInputDefaultSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_settings(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_settings(name, settings, overlay)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, inputSettings: settings, overlay: overlay}
|
|
|
|
call(:SetInputSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_mute(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputMute, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_mute(name, muted)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, inputMuted: muted}
|
|
|
|
call(:SetInputMute, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_input_mute(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:ToggleInputMute, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_volume(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputVolume, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_volume(name, vol_mul = nil, vol_db = nil)
|
|
|
|
payload = {
|
|
|
|
inputName: name,
|
|
|
|
inputVolumeMul: vol_mul,
|
|
|
|
inputVolumeDb: vol_db
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetInputVolume, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_audio_balance(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputAudioBalance, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_audio_balance(name, balance)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, inputAudioBalance: balance}
|
|
|
|
call(:SetInputAudioBalance, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_audio_sync_offset(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputAudioSyncOffset, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_audio_sync_offset(name, offset)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, inputAudioSyncOffset: offset}
|
|
|
|
call(:SetInputAudioSyncOffset, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_audio_monitor_type(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputAudioMonitorType, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_audio_monitor_type(name, mon_type)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, monitorType: mon_type}
|
|
|
|
call(:SetInputAudioMonitorType, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_audio_tracks(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetInputAudioTracks, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_input_audio_tracks(name, track)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, inputAudioTracks: track}
|
|
|
|
call(:SetInputAudioTracks, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_input_properties_list_property_items(input_name, prop_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: input_name, propertyName: prop_name}
|
|
|
|
resp = call(:GetInputPropertiesListPropertyItems, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def press_input_properties_button(input_name, prop_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: input_name, propertyName: prop_name}
|
|
|
|
call(:PressInputPropertiesButton, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_transition_kind_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetTransitionKindList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_transition_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSceneTransitionList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_current_scene_transition
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetCurrentSceneTransition)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_scene_transition(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {transitionName: name}
|
|
|
|
call(:SetCurrentSceneTransition, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_scene_transition_duration(duration)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {transitionDuration: duration}
|
|
|
|
call(:SetCurrentSceneTransitionDuration, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_current_scene_transition_settings(settings, overlay = nil)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {transitionSettings: settings, overlay: overlay}
|
|
|
|
call(:SetCurrentSceneTransitionSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_current_scene_transition_cursor
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetCurrentSceneTransitionCursor)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger_studio_mode_transition
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:TriggerStudioModeTransition)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_t_bar_position(pos, release = nil)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {position: pos, release: release}
|
|
|
|
call(:SetTBarPosition, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_source_filter_list(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sourceName: name}
|
|
|
|
resp = call(:GetSourceFilterList, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_source_filter_default_settings(kind)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {filterKind: kind}
|
|
|
|
resp = call(:GetSourceFilterDefaultSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create_source_filter(
|
|
|
|
source_name,
|
|
|
|
filter_name,
|
|
|
|
filter_kind,
|
|
|
|
filter_settings = nil
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
sourceName: source_name,
|
|
|
|
filterName: filter_name,
|
|
|
|
filterKind: filter_kind,
|
|
|
|
filterSettings: filter_settings
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:CreateSourceFilter, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def remove_source_filter(source_name, filter_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sourceName: source_name, filterName: filter_name}
|
|
|
|
call(:RemoveSourceFilter, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_source_filter_name(source_name, old_filter_name, new_filter_name)
|
|
|
|
payload = {
|
|
|
|
sourceName: source_name,
|
|
|
|
filterName: old_filter_name,
|
|
|
|
newFilterName: new_filter_name
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSourceFilterName, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_source_filter(source_name, filter_name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sourceName: source_name, filterName: filter_name}
|
|
|
|
resp = call(:GetSourceFilter, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_source_filter_index(source_name, filter_name, filter_index)
|
|
|
|
payload = {
|
|
|
|
sourceName: source_name,
|
|
|
|
filterName: filter_name,
|
|
|
|
filterIndex: filter_index
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSourceFilterIndex, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_source_filter_settings(
|
|
|
|
source_name,
|
|
|
|
filter_name,
|
|
|
|
settings,
|
|
|
|
overlay = nil
|
|
|
|
)
|
|
|
|
payload = {
|
|
|
|
sourceName: source_name,
|
|
|
|
filterName: filter_name,
|
|
|
|
filterSettings: settings,
|
|
|
|
overlay: overlay
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSourceFilterSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def set_source_filter_enabled(source_name, filter_name, enabled)
|
|
|
|
payload = {
|
|
|
|
sourceName: source_name,
|
|
|
|
filterName: filter_name,
|
|
|
|
filterEnabled: enabled
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSourceFilterEnabled, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_list(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
resp = call(:GetSceneItemList, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_group_scene_item_list(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: name}
|
|
|
|
resp = call(:GetGroupSceneItemList, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_id(scene_name, source_name, offset = nil)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sourceName: source_name,
|
|
|
|
searchOffset: offset
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetSceneItemId, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create_scene_item(scene_name, source_name, enabled = nil)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sourceName: source_name,
|
|
|
|
sceneItemEnabled: enabled
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:CreateSceneItem, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def remove_scene_item(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
call(:RemoveSceneItem, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def duplicate_scene_item(scene_name, item_id, dest_scene_name = nil)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
|
|
|
destinationSceneName: dest_scene_name
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:DuplicateSceneItem, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_transform(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
resp = call(:GetSceneItemTransform, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_item_transform(scene_name, item_id, transform)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
|
|
|
sceneItemTransform: transform
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneItemTransform, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_enabled(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
resp = call(:GetSceneItemEnabled, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_item_enabled(scene_name, item_id, enabled)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
|
|
|
sceneItemEnabled: enabled
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneItemEnabled, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_locked(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
resp = call(:GetSceneItemLocked, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_item_locked(scene_name, item_id, locked)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
|
|
|
sceneItemLocked: locked
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneItemLocked, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_index(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
resp = call(:GetSceneItemIndex, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_item_index(scene_name, item_id, item_index)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
2023-07-19 15:12:25 +01:00
|
|
|
sceneItemIndex: item_index
|
2022-10-22 22:30:40 +01:00
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneItemIndex, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_scene_item_blend_mode(scene_name, item_id)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {sceneName: scene_name, sceneItemId: item_id}
|
|
|
|
resp = call(:GetSceneItemBlendMode, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_scene_item_blend_mode(scene_name, item_id, blend)
|
|
|
|
payload = {
|
|
|
|
sceneName: scene_name,
|
|
|
|
sceneItemId: item_id,
|
|
|
|
sceneItemBlendMode: blend
|
|
|
|
}
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SetSceneItemBlendMode, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_virtual_cam_status
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetVirtualCamStatus)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_virtual_cam
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:ToggleVirtualCam)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_virtual_cam
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StartVirtualCam)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop_virtual_cam
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StopVirtualCam)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_replay_buffer_status
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetReplayBufferStatus)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_replay_buffer
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:ToggleReplayBuffer)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_replay_buffer
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StartReplayBuffer)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop_replay_buffer
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StopReplayBuffer)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def save_replay_buffer
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SaveReplayBuffer)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_last_replay_buffer_replay
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetLastReplayBufferReplay)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_output_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetOutputList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get_output_status(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name}
|
|
|
|
resp = call(:GetOutputStatus, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_output(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name}
|
|
|
|
resp = call(:ToggleOutput, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_output(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name}
|
|
|
|
call(:StartOutput, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop_output(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name}
|
|
|
|
call(:StopOutput, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_output_settings(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name}
|
|
|
|
resp = call(:GetOutputSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_output_settings(name, settings)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {outputName: name, outputSettings: settings}
|
|
|
|
call(:SetOutputSettings, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_stream_status
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetStreamStatus)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_stream
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:ToggleStream)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def start_stream
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StartStream)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop_stream
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StopStream)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def send_stream_caption(caption)
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:SendStreamCaption)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_record_status
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetRecordStatus)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_record
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:ToggleRecord)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def start_record
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:StartRecord)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def stop_record
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:StopRecord)
|
2022-11-03 04:11:59 +00:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def toggle_record_pause
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:ToggleRecordPause)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def pause_record
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:PauseRecord)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def resume_record
|
2023-07-19 15:12:25 +01:00
|
|
|
call(:ResumeRecord)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_media_input_status(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
resp = call(:GetMediaInputStatus, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_media_input_cursor(name, cursor)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, mediaCursor: cursor}
|
|
|
|
call(:SetMediaInputCursor, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def offset_media_input_cursor(name, offset)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, mediaCursorOffset: offset}
|
|
|
|
call(:OffsetMediaInputCursor, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def trigger_media_input_action(name, action)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name, mediaAction: action}
|
|
|
|
call(:TriggerMediaInputAction, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_studio_mode_enabled
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetStudioModeEnabled)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_studio_mode_enabled(enabled)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {studioModeEnabled: enabled}
|
|
|
|
call(:SetStudioModeEnabled, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def open_input_properties_dialog(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
call(:OpenInputPropertiesDialog, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def open_input_filters_dialog(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
call(:OpenInputFiltersDialog, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def open_input_interact_dialog(name)
|
2023-07-19 15:12:25 +01:00
|
|
|
payload = {inputName: name}
|
|
|
|
call(:OpenInputInteractDialog, payload)
|
2022-10-22 22:30:40 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def get_monitor_list
|
2023-07-19 15:12:25 +01:00
|
|
|
resp = call(:GetMonitorList)
|
2022-10-22 22:30:40 +01:00
|
|
|
Mixin::Response.new(resp, resp.keys)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|