From 0744d215c67a1927166ca7bc27732c7b4cd9ee66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 7 May 2019 13:33:02 +0200 Subject: [PATCH 01/17] utils(GetSceneItemData): add `isGroup` flag + move Source typedef here --- src/Utils.cpp | 22 ++++++++++++++++++++++ src/WSRequestHandler_SceneItems.cpp | 16 ---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 1215bf6a..cec56cd7 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -27,6 +27,23 @@ with this program. If not, see #include "Utils.h" #include "Config.h" +/** +* @typedef {Object} `Source` An OBS Scene Item. +* @property {Number} `cy` +* @property {Number} `cx` +* @property {String} `name` The name of this Scene Item. +* @property {int} `id` Scene item ID +* @property {Boolean} `render` Whether or not this Scene Item is set to "visible". +* @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around +* @property {Boolean} `isGroup` Whether or not this Scene Item is a group +* @property {Number} `source_cx` +* @property {Number} `source_cy` +* @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" +* @property {Number} `volume` +* @property {Number} `x` +* @property {Number} `y` +*/ + Q_DECLARE_METATYPE(OBSScene); const QHash boundTypeNames = { @@ -130,6 +147,7 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { obs_data_set_double(data, "cy", item_height * scale.y); obs_data_set_bool(data, "render", obs_sceneitem_visible(item)); obs_data_set_bool(data, "locked", obs_sceneitem_locked(item)); + obs_data_set_bool(data, "isGroup", obs_sceneitem_is_group(item)); return data; } @@ -180,6 +198,10 @@ obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, QString name) return false; } + if (obs_sceneitem_is_group(currentItem)) { + + } + return true; }, &search); diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index f30538e1..193c1324 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -2,22 +2,6 @@ #include "WSRequestHandler.h" -/** -* @typedef {Object} `Source` An OBS Scene Item. -* @property {Number} `cy` -* @property {Number} `cx` -* @property {String} `name` The name of this Scene Item. -* @property {int} `id` Scene item ID -* @property {Boolean} `render` Whether or not this Scene Item is set to "visible". -* @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around -* @property {Number} `source_cx` -* @property {Number} `source_cy` -* @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" -* @property {Number} `volume` -* @property {Number} `x` -* @property {Number} `y` -*/ - /** * Gets the scene specific properties of the specified source item. * From ab5dad7d91c11418ef0813d39943b77cb7987a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Tue, 7 May 2019 13:52:38 +0200 Subject: [PATCH 02/17] Utils: oops --- src/Utils.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index cec56cd7..ee829ca4 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -198,10 +198,6 @@ obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, QString name) return false; } - if (obs_sceneitem_is_group(currentItem)) { - - } - return true; }, &search); From 7c8292a88dafef767f6d11b381cf49423a731e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 11:00:29 +0200 Subject: [PATCH 03/17] Utils(GetSceneItemFromName): recurse into groups wip --- src/Utils.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index ee829ca4..a1648e75 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -172,23 +172,32 @@ obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, QString name) struct current_search { QString query; obs_sceneitem_t* result; + bool (*enumCallback)(obs_scene_t*, obs_sceneitem_t*, void*); }; current_search search; search.query = name; search.result = nullptr; + search.enumCallback = nullptr; OBSScene scene = obs_scene_from_source(source); if (!scene) return nullptr; - obs_scene_enum_items(scene, []( + search.enumCallback = []( obs_scene_t* scene, obs_sceneitem_t* currentItem, void* param) { current_search* search = reinterpret_cast(param); + if (obs_sceneitem_is_group(currentItem)) { + obs_sceneitem_group_enum_items(currentItem, search->enumCallback, search); + if (search->result) { + return false; + } + } + QString currentItemName = obs_source_get_name(obs_sceneitem_get_source(currentItem)); @@ -199,7 +208,9 @@ obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, QString name) } return true; - }, &search); + }; + + obs_scene_enum_items(scene, search.enumCallback, &search); return search.result; } From 033a6929c3287baf5f167e0ff55581860e014ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 11:03:32 +0200 Subject: [PATCH 04/17] Utils(GetSceneItemFromId): recurse into groups wip --- src/Utils.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index a1648e75..b1b656e0 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -215,27 +215,37 @@ obs_sceneitem_t* Utils::GetSceneItemFromName(obs_source_t* source, QString name) return search.result; } +// TODO refactor this to unify it with GetSceneItemFromName obs_sceneitem_t* Utils::GetSceneItemFromId(obs_source_t* source, size_t id) { struct current_search { size_t query; obs_sceneitem_t* result; + bool (*enumCallback)(obs_scene_t*, obs_sceneitem_t*, void*); }; current_search search; search.query = id; search.result = nullptr; + search.enumCallback = nullptr; OBSScene scene = obs_scene_from_source(source); if (!scene) return nullptr; - obs_scene_enum_items(scene, []( + search.enumCallback = []( obs_scene_t* scene, obs_sceneitem_t* currentItem, void* param) { current_search* search = reinterpret_cast(param); + if (obs_sceneitem_is_group(currentItem)) { + obs_sceneitem_group_enum_items(currentItem, search->enumCallback, param); + if (search->result) { + return false; + } + } + if (obs_sceneitem_get_id(currentItem) == search->query) { search->result = currentItem; obs_sceneitem_addref(search->result); @@ -243,7 +253,9 @@ obs_sceneitem_t* Utils::GetSceneItemFromId(obs_source_t* source, size_t id) { } return true; - }, &search); + }; + + obs_scene_enum_items(scene, search.enumCallback, &search); return search.result; } From ae0ffdc4d545b28333fd7c77d8577478e65cda21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:12:18 +0200 Subject: [PATCH 05/17] docs: rename typedef Source to SceneItem --- src/Utils.cpp | 4 ++-- src/WSEvents.cpp | 4 ++-- src/WSRequestHandler_Scenes.cpp | 4 ++-- src/WSRequestHandler_StudioMode.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index b1b656e0..38b457c2 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -28,14 +28,14 @@ with this program. If not, see #include "Config.h" /** -* @typedef {Object} `Source` An OBS Scene Item. +* @typedef {Object} `SceneItem` An OBS Scene Item. * @property {Number} `cy` * @property {Number} `cx` * @property {String} `name` The name of this Scene Item. * @property {int} `id` Scene item ID * @property {Boolean} `render` Whether or not this Scene Item is set to "visible". * @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around -* @property {Boolean} `isGroup` Whether or not this Scene Item is a group +* @property {Boolean} `isGroup` Whether or not this Scene Item is a group * @property {Number} `source_cx` * @property {Number} `source_cy` * @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" diff --git a/src/WSEvents.cpp b/src/WSEvents.cpp index 98169f2c..30cb99e0 100644 --- a/src/WSEvents.cpp +++ b/src/WSEvents.cpp @@ -344,7 +344,7 @@ const char* WSEvents::GetRecordingTimecode() { * Indicates a scene change. * * @return {String} `scene-name` The new scene. - * @return {Array} `sources` List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene). + * @return {Array} `sources` List of scene items in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene). * * @api events * @name SwitchScenes @@ -1435,7 +1435,7 @@ void WSEvents::OnSceneItemDeselected(void* param, calldata_t* data) { * The selected preview scene has changed (only available in Studio Mode). * * @return {String} `scene-name` Name of the scene being previewed. - * @return {Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). + * @return {Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). * * @api events * @name PreviewSceneChanged diff --git a/src/WSRequestHandler_Scenes.cpp b/src/WSRequestHandler_Scenes.cpp index 6b63d71d..6e8429c8 100644 --- a/src/WSRequestHandler_Scenes.cpp +++ b/src/WSRequestHandler_Scenes.cpp @@ -5,7 +5,7 @@ /** * @typedef {Object} `Scene` * @property {String} `name` Name of the currently active scene. -* @property {Array} `sources` Ordered list of the current scene's source items. +* @property {Array} `sources` Ordered list of the current scene's source items. */ /** @@ -38,7 +38,7 @@ HandlerResponse WSRequestHandler::HandleSetCurrentScene(WSRequestHandler* req) { * Get the current scene's name and source items. * * @return {String} `name` Name of the currently active scene. - * @return {Array} `sources` Ordered list of the current scene's source items. + * @return {Array} `sources` Ordered list of the current scene's source items. * * @api requests * @name GetCurrentScene diff --git a/src/WSRequestHandler_StudioMode.cpp b/src/WSRequestHandler_StudioMode.cpp index 57f54e4b..de64fc97 100644 --- a/src/WSRequestHandler_StudioMode.cpp +++ b/src/WSRequestHandler_StudioMode.cpp @@ -26,7 +26,7 @@ HandlerResponse WSRequestHandler::HandleGetStudioModeStatus(WSRequestHandler* re * Will return an `error` if Studio Mode is not enabled. * * @return {String} `name` The name of the active preview scene. - * @return {Array} `sources` + * @return {Array} `sources` * * @api requests * @name GetPreviewScene From 15610bb2969159c92dcd4c5090b54293ff2e32f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:37:04 +0200 Subject: [PATCH 06/17] Utils(GetSceneItemData): add children list --- src/Utils.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 38b457c2..8cb8ed8d 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -35,13 +35,14 @@ with this program. If not, see * @property {int} `id` Scene item ID * @property {Boolean} `render` Whether or not this Scene Item is set to "visible". * @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around -* @property {Boolean} `isGroup` Whether or not this Scene Item is a group * @property {Number} `source_cx` * @property {Number} `source_cy` * @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" * @property {Number} `volume` * @property {Number} `x` * @property {Number} `y` +* @property {Boolean} `isGroup` Whether or not this Scene Item is a group +* @property {Array (optional)} `children` List of children (if item is a group) */ Q_DECLARE_METATYPE(OBSScene); @@ -149,6 +150,19 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { obs_data_set_bool(data, "locked", obs_sceneitem_locked(item)); obs_data_set_bool(data, "isGroup", obs_sceneitem_is_group(item)); + if (obs_sceneitem_is_group(item)) { + OBSDataArrayAutoRelease children = obs_data_array_create(); + obs_sceneitem_group_enum_items(item, [](obs_scene_t*, obs_sceneitem_t* currentItem, void* param) { + obs_data_array_t* items = reinterpret_cast(param); + + OBSDataAutoRelease itemData = GetSceneItemData(currentItem); + obs_data_array_push_back(items, itemData); + + return true; + }, children); + obs_data_set_array(data, "children", children); + } + return data; } From 50bb6e72048385dcba087b7bcac86c3ca1ab49e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:50:24 +0200 Subject: [PATCH 07/17] Utils: add parent property to scene item info and transform data + refactor bits --- src/Utils.cpp | 71 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 8cb8ed8d..9ae1cf0d 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -27,24 +27,6 @@ with this program. If not, see #include "Utils.h" #include "Config.h" -/** -* @typedef {Object} `SceneItem` An OBS Scene Item. -* @property {Number} `cy` -* @property {Number} `cx` -* @property {String} `name` The name of this Scene Item. -* @property {int} `id` Scene item ID -* @property {Boolean} `render` Whether or not this Scene Item is set to "visible". -* @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around -* @property {Number} `source_cx` -* @property {Number} `source_cy` -* @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" -* @property {Number} `volume` -* @property {Number} `x` -* @property {Number} `y` -* @property {Boolean} `isGroup` Whether or not this Scene Item is a group -* @property {Array (optional)} `children` List of children (if item is a group) -*/ - Q_DECLARE_METATYPE(OBSScene); const QHash boundTypeNames = { @@ -115,6 +97,24 @@ obs_data_array_t* Utils::GetSceneItems(obs_source_t* source) { return items; } +/** + * @typedef {Object} `SceneItem` An OBS Scene Item. + * @property {Number} `cy` + * @property {Number} `cx` + * @property {String} `name` The name of this Scene Item. + * @property {int} `id` Scene item ID + * @property {Boolean} `render` Whether or not this Scene Item is set to "visible". + * @property {Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around + * @property {Number} `source_cx` + * @property {Number} `source_cy` + * @property {String} `type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" + * @property {Number} `volume` + * @property {Number} `x` + * @property {Number} `y` + * @property {Boolean} `isGroup` Whether or not this Scene Item is a group + * @property {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) + * @property {Array (optional)} `groupChildren` List of children (if this item is a group) + */ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { if (!item) { return nullptr; @@ -150,6 +150,15 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { obs_data_set_bool(data, "locked", obs_sceneitem_locked(item)); obs_data_set_bool(data, "isGroup", obs_sceneitem_is_group(item)); + obs_scene_t* parent = obs_sceneitem_get_scene(item); + if (parent) { + OBSSource parentSource = obs_scene_get_source(parent); + QString parentKind = obs_source_get_id(parentSource); + if (parentKind == "group") { + obs_data_set_string(data, "parentGroupName", obs_source_get_name(parentSource)); + } + } + if (obs_sceneitem_is_group(item)) { OBSDataArrayAutoRelease children = obs_data_array_create(); obs_sceneitem_group_enum_items(item, [](obs_scene_t*, obs_sceneitem_t* currentItem, void* param) { @@ -160,7 +169,7 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { return true; }, children); - obs_data_set_array(data, "children", children); + obs_data_set_array(data, "groupChildren", children); } return data; @@ -648,6 +657,8 @@ bool Utils::SetFilenameFormatting(const char* filenameFormatting) { * @property {int} `sourceHeight` Base source (without scaling) of the source * @property {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @property {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) + * @property {String} `parentGroupName` Name of the item's parent (if this item belongs to a group) + * @property {Array} `groupChildren` */ obs_data_t* Utils::GetSceneItemPropertiesData(obs_sceneitem_t* sceneItem) { if (!sceneItem) { @@ -710,6 +721,28 @@ obs_data_t* Utils::GetSceneItemPropertiesData(obs_sceneitem_t* sceneItem) { obs_data_set_double(data, "width", baseSourceWidth * scale.x); obs_data_set_double(data, "height", baseSourceHeight * scale.y); + obs_scene_t* parent = obs_sceneitem_get_scene(sceneItem); + if (parent) { + OBSSource parentSource = obs_scene_get_source(parent); + QString parentKind = obs_source_get_id(parentSource); + if (parentKind == "group") { + obs_data_set_string(data, "parentGroupName", obs_source_get_name(parentSource)); + } + } + + if (obs_sceneitem_is_group(sceneItem)) { + OBSDataArrayAutoRelease children = obs_data_array_create(); + obs_sceneitem_group_enum_items(sceneItem, [](obs_scene_t*, obs_sceneitem_t* subItem, void* param) { + obs_data_array_t* items = reinterpret_cast(param); + + OBSDataAutoRelease itemData = GetSceneItemPropertiesData(subItem); + obs_data_array_push_back(items, itemData); + + return true; + }, children); + obs_data_set_array(data, "groupChildren", children); + } + return data; } From eb7fbf011ff4cfdec9880345a13a6f3e247e5af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:54:06 +0200 Subject: [PATCH 08/17] utils + sceneitems: fix docs --- src/Utils.cpp | 2 +- src/WSRequestHandler_SceneItems.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 9ae1cf0d..f42a12fe 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -658,7 +658,7 @@ bool Utils::SetFilenameFormatting(const char* filenameFormatting) { * @property {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @property {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) * @property {String} `parentGroupName` Name of the item's parent (if this item belongs to a group) - * @property {Array} `groupChildren` + * @property {Array} `groupChildren` List of children (if this item is a group) */ obs_data_t* Utils::GetSceneItemPropertiesData(obs_sceneitem_t* sceneItem) { if (!sceneItem) { diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 193c1324..342f4e31 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -29,6 +29,9 @@ * @return {int} `sourceHeight` Base source (without scaling) of the source * @return {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @return {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) +* @property {Boolean} `isGroup` Whether or not this Scene Item is a group +* @property {String} `parentGroupName` Name of the item's parent (if this item belongs to a group) +* @property {Array} `groupChildren` List of children (if this item is a group) * * @api requests * @name GetSceneItemProperties From b0a35789f685f8ac3620dbae8c6b1ee4491db4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:55:33 +0200 Subject: [PATCH 09/17] utils + sceneitem: fix docs again --- src/Utils.cpp | 4 ++-- src/WSRequestHandler_SceneItems.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index f42a12fe..08040021 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -657,8 +657,8 @@ bool Utils::SetFilenameFormatting(const char* filenameFormatting) { * @property {int} `sourceHeight` Base source (without scaling) of the source * @property {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @property {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) - * @property {String} `parentGroupName` Name of the item's parent (if this item belongs to a group) - * @property {Array} `groupChildren` List of children (if this item is a group) + * @property {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) + * @property {Array (optional)} `groupChildren` List of children (if this item is a group) */ obs_data_t* Utils::GetSceneItemPropertiesData(obs_sceneitem_t* sceneItem) { if (!sceneItem) { diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 342f4e31..ca450bf4 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -30,8 +30,8 @@ * @return {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @return {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) * @property {Boolean} `isGroup` Whether or not this Scene Item is a group -* @property {String} `parentGroupName` Name of the item's parent (if this item belongs to a group) -* @property {Array} `groupChildren` List of children (if this item is a group) +* @property {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) +* @property {Array (optional)} `groupChildren` List of children (if this item is a group) * * @api requests * @name GetSceneItemProperties From 788f70d5f3be70883642de26407c04574e07be29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 13:57:38 +0200 Subject: [PATCH 10/17] Utils(GetSceneItemData): remove property isGroup --- src/Utils.cpp | 2 -- src/WSRequestHandler_SceneItems.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Utils.cpp b/src/Utils.cpp index 08040021..9212d993 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -111,7 +111,6 @@ obs_data_array_t* Utils::GetSceneItems(obs_source_t* source) { * @property {Number} `volume` * @property {Number} `x` * @property {Number} `y` - * @property {Boolean} `isGroup` Whether or not this Scene Item is a group * @property {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) * @property {Array (optional)} `groupChildren` List of children (if this item is a group) */ @@ -148,7 +147,6 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) { obs_data_set_double(data, "cy", item_height * scale.y); obs_data_set_bool(data, "render", obs_sceneitem_visible(item)); obs_data_set_bool(data, "locked", obs_sceneitem_locked(item)); - obs_data_set_bool(data, "isGroup", obs_sceneitem_is_group(item)); obs_scene_t* parent = obs_sceneitem_get_scene(item); if (parent) { diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index ca450bf4..cb179b25 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -29,7 +29,6 @@ * @return {int} `sourceHeight` Base source (without scaling) of the source * @return {double} `width` Scene item width (base source width multiplied by the horizontal scaling factor) * @return {double} `height` Scene item height (base source height multiplied by the vertical scaling factor) -* @property {Boolean} `isGroup` Whether or not this Scene Item is a group * @property {String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group) * @property {Array (optional)} `groupChildren` List of children (if this item is a group) * From de6bfdca0a292fd5907a150fbfde85f5ce55c814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Thu, 16 May 2019 14:30:39 +0200 Subject: [PATCH 11/17] SceneItems(docs): add comment about coordinates --- src/WSRequestHandler_SceneItems.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index cb179b25..5f5798be 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -4,6 +4,7 @@ /** * Gets the scene specific properties of the specified source item. +* Coordinates are relative to the item's parent (the scene or group it belongs to). * * @param {String (optional)} `scene-name` the name of the scene that the source item belongs to. Defaults to the current scene. * @param {String} `item` The name of the source. @@ -67,6 +68,7 @@ HandlerResponse WSRequestHandler::HandleGetSceneItemProperties(WSRequestHandler* /** * Sets the scene specific properties of a source. Unspecified properties will remain unchanged. +* Coordinates are relative to the item's parent (the scene or group it belongs to). * * @param {String (optional)} `scene-name` the name of the scene that the source item belongs to. Defaults to the current scene. * @param {String} `item` The name of the source. From c516e871803523c1d31291373b3675e7462eeb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lepin?= Date: Fri, 17 May 2019 12:59:43 +0200 Subject: [PATCH 12/17] text: rename settings dialog + dedup strings --- data/locale/en-US.ini | 9 ++++----- src/obs-websocket.cpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 0b69c742..8725e18d 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -1,6 +1,5 @@ -OBSWebsocket.Menu.SettingsItem="WebSocket server settings" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Enable WebSocket server" +OBSWebsocket.Settings.DialogTitle="WebSockets Server Settings" +OBSWebsocket.Settings.ServerEnable="Enable WebSockets server" OBSWebsocket.Settings.ServerPort="Server Port" OBSWebsocket.Settings.AuthRequired="Enable authentication" OBSWebsocket.Settings.Password="Password" @@ -10,8 +9,8 @@ OBSWebsocket.NotifyConnect.Title="New WebSocket connection" OBSWebsocket.NotifyConnect.Message="Client %1 connected" OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected" OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected" -OBSWebsocket.Server.StartFailed.Title="WebSocket Server failure" -OBSWebsocket.Server.StartFailed.Message="The obs-websocket server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - An unknown network error happened on your system. Try again by changing settings, restarting OBS or restarting your system." +OBSWebsocket.Server.StartFailed.Title="WebSockets Server failure" +OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - An unknown network error happened on your system. Try again by changing settings, restarting OBS or restarting your system." OBSWebsocket.ProfileChanged.Started="WebSockets server enabled in this profile. Server started." OBSWebsocket.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped." OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted." \ No newline at end of file diff --git a/src/obs-websocket.cpp b/src/obs-websocket.cpp index 924f83cc..b780f070 100644 --- a/src/obs-websocket.cpp +++ b/src/obs-websocket.cpp @@ -66,7 +66,7 @@ bool obs_module_load(void) { obs_frontend_pop_ui_translation(); const char* menuActionText = - obs_module_text("OBSWebsocket.Menu.SettingsItem"); + obs_module_text("OBSWebsocket.Settings.DialogTitle"); QAction* menuAction = (QAction*)obs_frontend_add_tools_menu_qaction(menuActionText); QObject::connect(menuAction, &QAction::triggered, [settingsDialog] { From 91fde777cfdad1037bdfbd0def3804e2b0787297 Mon Sep 17 00:00:00 2001 From: Travis CI <> Date: Sun, 19 May 2019 08:07:31 +0000 Subject: [PATCH 13/17] docs(travis): Update protocol.md - 061ab12 [skip ci] --- docs/generated/comments.json | 254 ++++++++++++++++++++--------------- docs/generated/protocol.md | 48 ++++--- 2 files changed, 174 insertions(+), 128 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index 0c6dd592..6789cdf2 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -1,5 +1,110 @@ { "typedefs": [ + { + "subheads": [], + "typedef": "{Object} `SceneItem` An OBS Scene Item.", + "property": [ + "{Number} `cy`", + "{Number} `cx`", + "{String} `name` The name of this Scene Item.", + "{int} `id` Scene item ID", + "{Boolean} `render` Whether or not this Scene Item is set to \"visible\".", + "{Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around", + "{Number} `source_cx`", + "{Number} `source_cy`", + "{String} `type` Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\"", + "{Number} `volume`", + "{Number} `x`", + "{Number} `y`", + "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", + "{Array (optional)} `groupChildren` List of children (if this item is a group)" + ], + "properties": [ + { + "type": "Number", + "name": "cy", + "description": "" + }, + { + "type": "Number", + "name": "cx", + "description": "" + }, + { + "type": "String", + "name": "name", + "description": "The name of this Scene Item." + }, + { + "type": "int", + "name": "id", + "description": "Scene item ID" + }, + { + "type": "Boolean", + "name": "render", + "description": "Whether or not this Scene Item is set to \"visible\"." + }, + { + "type": "Boolean", + "name": "locked", + "description": "Whether or not this Scene Item is locked and can't be moved around" + }, + { + "type": "Number", + "name": "source_cx", + "description": "" + }, + { + "type": "Number", + "name": "source_cy", + "description": "" + }, + { + "type": "String", + "name": "type", + "description": "Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\"" + }, + { + "type": "Number", + "name": "volume", + "description": "" + }, + { + "type": "Number", + "name": "x", + "description": "" + }, + { + "type": "Number", + "name": "y", + "description": "" + }, + { + "type": "String (optional)", + "name": "parentGroupName", + "description": "Name of the item's parent (if this item belongs to a group)" + }, + { + "type": "Array (optional)", + "name": "groupChildren", + "description": "List of children (if this item is a group)" + } + ], + "typedefs": [ + { + "type": "Object", + "name": "SceneItem", + "description": "An OBS Scene Item." + } + ], + "name": "", + "heading": { + "level": 2, + "text": "" + }, + "examples": [] + }, { "subheads": [], "typedef": "{Object} `SceneItemTransform`", @@ -23,7 +128,9 @@ "{int} `sourceWidth` Base width (without scaling) of the source", "{int} `sourceHeight` Base source (without scaling) of the source", "{double} `width` Scene item width (base source width multiplied by the horizontal scaling factor)", - "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)" + "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)", + "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", + "{Array (optional)} `groupChildren` List of children (if this item is a group)" ], "properties": [ { @@ -125,6 +232,16 @@ "type": "double", "name": "height", "description": "Scene item height (base source height multiplied by the vertical scaling factor)" + }, + { + "type": "String (optional)", + "name": "parentGroupName", + "description": "Name of the item's parent (if this item belongs to a group)" + }, + { + "type": "Array (optional)", + "name": "groupChildren", + "description": "List of children (if this item is a group)" } ], "typedefs": [ @@ -216,105 +333,12 @@ }, "examples": [] }, - { - "subheads": [], - "typedef": "{Object} `Source` An OBS Scene Item.", - "property": [ - "{Number} `cy`", - "{Number} `cx`", - "{String} `name` The name of this Scene Item.", - "{int} `id` Scene item ID", - "{Boolean} `render` Whether or not this Scene Item is set to \"visible\".", - "{Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around", - "{Number} `source_cx`", - "{Number} `source_cy`", - "{String} `type` Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\"", - "{Number} `volume`", - "{Number} `x`", - "{Number} `y`" - ], - "properties": [ - { - "type": "Number", - "name": "cy", - "description": "" - }, - { - "type": "Number", - "name": "cx", - "description": "" - }, - { - "type": "String", - "name": "name", - "description": "The name of this Scene Item." - }, - { - "type": "int", - "name": "id", - "description": "Scene item ID" - }, - { - "type": "Boolean", - "name": "render", - "description": "Whether or not this Scene Item is set to \"visible\"." - }, - { - "type": "Boolean", - "name": "locked", - "description": "Whether or not this Scene Item is locked and can't be moved around" - }, - { - "type": "Number", - "name": "source_cx", - "description": "" - }, - { - "type": "Number", - "name": "source_cy", - "description": "" - }, - { - "type": "String", - "name": "type", - "description": "Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\"" - }, - { - "type": "Number", - "name": "volume", - "description": "" - }, - { - "type": "Number", - "name": "x", - "description": "" - }, - { - "type": "Number", - "name": "y", - "description": "" - } - ], - "typedefs": [ - { - "type": "Object", - "name": "Source", - "description": "An OBS Scene Item." - } - ], - "name": "", - "heading": { - "level": 2, - "text": "" - }, - "examples": [] - }, { "subheads": [], "typedef": "{Object} `Scene`", "property": [ "{String} `name` Name of the currently active scene.", - "{Array} `sources` Ordered list of the current scene's source items." + "{Array} `sources` Ordered list of the current scene's source items." ], "properties": [ { @@ -323,7 +347,7 @@ "description": "Name of the currently active scene." }, { - "type": "Array", + "type": "Array", "name": "sources", "description": "Ordered list of the current scene's source items." } @@ -350,7 +374,7 @@ "description": "Indicates a scene change.", "return": [ "{String} `scene-name` The new scene.", - "{Array} `sources` List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." + "{Array} `sources` List of scene items in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." ], "api": "events", "name": "SwitchScenes", @@ -363,9 +387,9 @@ "description": "The new scene." }, { - "type": "Array", + "type": "Array", "name": "sources", - "description": "List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." + "description": "List of scene items in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." } ], "names": [ @@ -2415,7 +2439,7 @@ "description": "The selected preview scene has changed (only available in Studio Mode).", "return": [ "{String} `scene-name` Name of the scene being previewed.", - "{Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." + "{Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." ], "api": "events", "name": "PreviewSceneChanged", @@ -2428,7 +2452,7 @@ "description": "Name of the scene being previewed." }, { - "type": "Array", + "type": "Array", "name": "sources", "description": "List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)." } @@ -3487,7 +3511,7 @@ "scene items": [ { "subheads": [], - "description": "Gets the scene specific properties of the specified source item.", + "description": "Gets the scene specific properties of the specified source item.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", "param": [ "{String (optional)} `scene-name` the name of the scene that the source item belongs to. Defaults to the current scene.", "{String} `item` The name of the source." @@ -3515,6 +3539,10 @@ "{double} `width` Scene item width (base source width multiplied by the horizontal scaling factor)", "{double} `height` Scene item height (base source height multiplied by the vertical scaling factor)" ], + "property": [ + "{String (optional)} `parentGroupName` Name of the item's parent (if this item belongs to a group)", + "{Array (optional)} `groupChildren` List of children (if this item is a group)" + ], "api": "requests", "name": "GetSceneItemProperties", "category": "scene items", @@ -3638,6 +3666,18 @@ "description": "The name of the source." } ], + "properties": [ + { + "type": "String (optional)", + "name": "parentGroupName", + "description": "Name of the item's parent (if this item belongs to a group)" + }, + { + "type": "Array (optional)", + "name": "groupChildren", + "description": "List of children (if this item is a group)" + } + ], "names": [ { "name": "", @@ -3666,7 +3706,7 @@ }, { "subheads": [], - "description": "Sets the scene specific properties of a source. Unspecified properties will remain unchanged.", + "description": "Sets the scene specific properties of a source. Unspecified properties will remain unchanged.\nCoordinates are relative to the item's parent (the scene or group it belongs to).", "param": [ "{String (optional)} `scene-name` the name of the scene that the source item belongs to. Defaults to the current scene.", "{String} `item` The name of the source.", @@ -4346,7 +4386,7 @@ "description": "Get the current scene's name and source items.", "return": [ "{String} `name` Name of the currently active scene.", - "{Array} `sources` Ordered list of the current scene's source items." + "{Array} `sources` Ordered list of the current scene's source items." ], "api": "requests", "name": "GetCurrentScene", @@ -4359,7 +4399,7 @@ "description": "Name of the currently active scene." }, { - "type": "Array", + "type": "Array", "name": "sources", "description": "Ordered list of the current scene's source items." } @@ -7097,7 +7137,7 @@ "description": "Get the name of the currently previewed scene and its list of sources.\nWill return an `error` if Studio Mode is not enabled.", "return": [ "{String} `name` The name of the active preview scene.", - "{Array} `sources`" + "{Array} `sources`" ], "api": "requests", "name": "GetPreviewScene", @@ -7110,7 +7150,7 @@ "description": "The name of the active preview scene." }, { - "type": "Array", + "type": "Array", "name": "sources", "description": "" } diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 96af5b91..d5e803bd 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -43,9 +43,9 @@ auth_response = base64_encode(auth_response_hash) - [Typedefs](#typedefs) + * [SceneItem](#sceneitem) * [SceneItemTransform](#sceneitemtransform) * [OBSStats](#obsstats) - * [Source](#source) * [Scene](#scene) - [Events](#events) * [Scenes](#scenes) @@ -202,6 +202,23 @@ auth_response = base64_encode(auth_response_hash) These are complex types, such as `Source` and `Scene`, which are used as arguments or return values in multiple requests and/or events. +## SceneItem +| Name | Type | Description | +| ---- | :---: | ------------| +| `cy` | _Number_ | | +| `cx` | _Number_ | | +| `name` | _String_ | The name of this Scene Item. | +| `id` | _int_ | Scene item ID | +| `render` | _Boolean_ | Whether or not this Scene Item is set to "visible". | +| `locked` | _Boolean_ | Whether or not this Scene Item is locked and can't be moved around | +| `source_cx` | _Number_ | | +| `source_cy` | _Number_ | | +| `type` | _String_ | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" | +| `volume` | _Number_ | | +| `x` | _Number_ | | +| `y` | _Number_ | | +| `parentGroupName` | _String (optional)_ | Name of the item's parent (if this item belongs to a group) | +| `groupChildren` | _Array<SceneItem> (optional)_ | List of children (if this item is a group) | ## SceneItemTransform | Name | Type | Description | | ---- | :---: | ------------| @@ -225,6 +242,8 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen | `sourceHeight` | _int_ | Base source (without scaling) of the source | | `width` | _double_ | Scene item width (base source width multiplied by the horizontal scaling factor) | | `height` | _double_ | Scene item height (base source height multiplied by the vertical scaling factor) | +| `parentGroupName` | _String (optional)_ | Name of the item's parent (if this item belongs to a group) | +| `groupChildren` | _Array<SceneItemTransform> (optional)_ | List of children (if this item is a group) | ## OBSStats | Name | Type | Description | | ---- | :---: | ------------| @@ -237,26 +256,11 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen | `cpu-usage` | _double_ | Current CPU usage (percentage) | | `memory-usage` | _double_ | Current RAM usage (in megabytes) | | `free-disk-space` | _double_ | Free recording disk space (in megabytes) | -## Source -| Name | Type | Description | -| ---- | :---: | ------------| -| `cy` | _Number_ | | -| `cx` | _Number_ | | -| `name` | _String_ | The name of this Scene Item. | -| `id` | _int_ | Scene item ID | -| `render` | _Boolean_ | Whether or not this Scene Item is set to "visible". | -| `locked` | _Boolean_ | Whether or not this Scene Item is locked and can't be moved around | -| `source_cx` | _Number_ | | -| `source_cy` | _Number_ | | -| `type` | _String_ | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" | -| `volume` | _Number_ | | -| `x` | _Number_ | | -| `y` | _Number_ | | ## Scene | Name | Type | Description | | ---- | :---: | ------------| | `name` | _String_ | Name of the currently active scene. | -| `sources` | _Array<Source>_ | Ordered list of the current scene's source items. | +| `sources` | _Array<SceneItem>_ | Ordered list of the current scene's source items. | @@ -287,7 +291,7 @@ Indicates a scene change. | Name | Type | Description | | ---- | :---: | ------------| | `scene-name` | _String_ | The new scene. | -| `sources` | _Array<Source>_ | List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene). | +| `sources` | _Array<SceneItem>_ | List of scene items in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene). | --- @@ -999,7 +1003,7 @@ The selected preview scene has changed (only available in Studio Mode). | Name | Type | Description | | ---- | :---: | ------------| | `scene-name` | _String_ | Name of the scene being previewed. | -| `sources` | _Array<Source>_ | List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). | +| `sources` | _Array<SceneItem>_ | List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). | --- @@ -1520,6 +1524,7 @@ _No specified parameters._ - Added in v4.3.0 Gets the scene specific properties of the specified source item. +Coordinates are relative to the item's parent (the scene or group it belongs to). **Request Fields:** @@ -1564,6 +1569,7 @@ Gets the scene specific properties of the specified source item. - Added in v4.3.0 Sets the scene specific properties of a source. Unspecified properties will remain unchanged. +Coordinates are relative to the item's parent (the scene or group it belongs to). **Request Fields:** @@ -1805,7 +1811,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| | `name` | _String_ | Name of the currently active scene. | -| `sources` | _Array<Source>_ | Ordered list of the current scene's source items. | +| `sources` | _Array<SceneItem>_ | Ordered list of the current scene's source items. | --- @@ -2765,7 +2771,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| | `name` | _String_ | The name of the active preview scene. | -| `sources` | _Array<Source>_ | | +| `sources` | _Array<SceneItem>_ | | --- From 0d8999d64f39252ce4165fe9f6fb744ba03dafab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20L?= Date: Sun, 19 May 2019 13:41:23 +0200 Subject: [PATCH 14/17] GetVersion: bring back retrocompat version field --- src/WSRequestHandler_General.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WSRequestHandler_General.cpp b/src/WSRequestHandler_General.cpp index 5a8d69c7..0ca572af 100644 --- a/src/WSRequestHandler_General.cpp +++ b/src/WSRequestHandler_General.cpp @@ -80,6 +80,7 @@ HandlerResponse WSRequestHandler::HandleGetVersion(WSRequestHandler* req) { } OBSDataAutoRelease data = obs_data_create(); + obs_data_set_double(data, "version", 1.1); obs_data_set_string(data, "obs-websocket-version", OBS_WEBSOCKET_VERSION); obs_data_set_string(data, "obs-studio-version", obsVersion.toUtf8()); obs_data_set_string(data, "available-requests", requests.toUtf8()); From 1e19cf7ccc0805f58042613f6554ffe446cd8230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20L?= Date: Sun, 19 May 2019 15:43:27 +0200 Subject: [PATCH 15/17] server: don't reuse sockets on windows Other, conflicts with Port In Use detection --- src/WSServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WSServer.cpp b/src/WSServer.cpp index 45f3516e..5249fc87 100644 --- a/src/WSServer.cpp +++ b/src/WSServer.cpp @@ -44,7 +44,9 @@ WSServer::WSServer() _clMutex(QMutex::Recursive) { _server.init_asio(); +#ifndef _WIN32 _server.set_reuse_addr(true); +#endif _server.set_open_handler(bind(&WSServer::onOpen, this, ::_1)); _server.set_close_handler(bind(&WSServer::onClose, this, ::_1)); From bfb5570b7a8f995505ce4cd57c241de4f0fd8135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20L?= Date: Sun, 19 May 2019 15:50:44 +0200 Subject: [PATCH 16/17] scene item requests: defer updates to avoid triggering several transform events at once --- src/WSRequestHandler_SceneItems.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/WSRequestHandler_SceneItems.cpp b/src/WSRequestHandler_SceneItems.cpp index 5f5798be..fd5c138f 100644 --- a/src/WSRequestHandler_SceneItems.cpp +++ b/src/WSRequestHandler_SceneItems.cpp @@ -119,6 +119,8 @@ HandlerResponse WSRequestHandler::HandleSetSceneItemProperties(WSRequestHandler* bool badRequest = false; OBSDataAutoRelease errorMessage = obs_data_create(); + obs_sceneitem_defer_update_begin(sceneItem); + if (req->hasField("position")) { vec2 oldPosition; OBSDataAutoRelease positionError = obs_data_create(); @@ -248,6 +250,8 @@ HandlerResponse WSRequestHandler::HandleSetSceneItemProperties(WSRequestHandler* } } + obs_sceneitem_defer_update_end(sceneItem); + if (badRequest) { return req->SendErrorResponse(errorMessage); } @@ -430,8 +434,13 @@ HandlerResponse WSRequestHandler::HandleSetSceneItemTransform(WSRequestHandler* return req->SendErrorResponse("specified scene item doesn't exist"); } + obs_sceneitem_defer_update_begin(sceneItem); + obs_sceneitem_set_scale(sceneItem, &scale); obs_sceneitem_set_rot(sceneItem, rotation); + + obs_sceneitem_defer_update_end(sceneItem); + return req->SendOKResponse(); } From 95bbeb103e591f41293370d5f7970c665dc686dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20L?= Date: Sun, 19 May 2019 16:05:05 +0200 Subject: [PATCH 17/17] locale: update translations from Crowdin --- data/locale/ar-SA.ini | 0 data/locale/de-DE.ini | 22 ++++++++++++---------- data/locale/es-ES.ini | 10 ++++------ data/locale/fr-FR.ini | 9 ++++++--- data/locale/hi-IN.ini | 0 data/locale/it-IT.ini | 6 ++---- data/locale/ja-JP.ini | 11 +++++++---- data/locale/nl-NL.ini | 9 ++------- data/locale/pl-PL.ini | 16 ++++++---------- data/locale/pt-BR.ini | 5 ----- data/locale/pt-PT.ini | 4 +--- data/locale/ru-RU.ini | 11 +++++------ data/locale/zh-CN.ini | 14 ++++++++++---- data/locale/zh-TW.ini | 15 +++++++++------ 14 files changed, 64 insertions(+), 68 deletions(-) create mode 100644 data/locale/ar-SA.ini create mode 100644 data/locale/hi-IN.ini delete mode 100644 data/locale/pt-BR.ini diff --git a/data/locale/ar-SA.ini b/data/locale/ar-SA.ini new file mode 100644 index 00000000..e69de29b diff --git a/data/locale/de-DE.ini b/data/locale/de-DE.ini index f654e185..3cd6e23b 100644 --- a/data/locale/de-DE.ini +++ b/data/locale/de-DE.ini @@ -1,14 +1,16 @@ -OBSWebsocket.Menu.SettingsItem="Websocket-Server Einstellungen" -OBSWebsocket.Settings.DialogTitle="Websocket-Server Einstellungen" -OBSWebsocket.Settings.ServerEnable="Websocket-Server aktivieren" -OBSWebsocket.Settings.ServerPort="Server Port" -OBSWebsocket.Settings.AuthRequired="Authentifizierung erforderlich" +OBSWebsocket.Settings.DialogTitle="WebSockets-Servereinstellungen" +OBSWebsocket.Settings.ServerEnable="WebSockets-Server aktivieren" +OBSWebsocket.Settings.ServerPort="Server-Port" +OBSWebsocket.Settings.AuthRequired="Authentifizierung aktivieren" OBSWebsocket.Settings.Password="Passwort" OBSWebsocket.Settings.DebugEnable="Debug-Protokollierung aktivieren" -OBSWebsocket.Settings.AlertsEnable="Infobereich-Benachrichtigungen aktivieren" -OBSWebsocket.NotifyConnect.Title="Neue WebSocket Verbindung" +OBSWebsocket.Settings.AlertsEnable="Infobereichbenachrichtigungen aktivieren" +OBSWebsocket.NotifyConnect.Title="Neue Websocket-Verbindung" OBSWebsocket.NotifyConnect.Message="Client %1 verbunden" -OBSWebsocket.NotifyDisconnect.Title="WebSocket-Client getrennt" +OBSWebsocket.NotifyDisconnect.Title="Websocket-Client getrennt" OBSWebsocket.NotifyDisconnect.Message="Client %1 getrennt" -OBSWebsocket.Server.StartFailed.Title="WebSocket-Server Fehler" -OBSWebsocket.Server.StartFailed.Message="Der WebSocket-Server konnte nicht gestartet werden, mögliche Gründe:\n - TCP Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den WebSocket-Server Einstellungen zu setzten oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Ein unbekannter Netzwerkfehler ist aufgetreten. Versuchen Sie es erneut mit anderen Einstellungen, einem OBS neustart oder einem System neustart." +OBSWebsocket.Server.StartFailed.Title="Websocket-Serverfehler" +OBSWebsocket.Server.StartFailed.Message="Der WebSockets-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Ein unbekannter Netzwerkfehler ist aufgetreten. Versuchen Sie es mit anderen Einstellungen, einem OBS-Neustart oder einem Systemneustart erneut." +OBSWebsocket.ProfileChanged.Started="WebSockets-Server in diesem Profil aktiviert. Server gestartet." +OBSWebsocket.ProfileChanged.Stopped="WebSockets-Server in diesem Profil deaktiviert. Server gestoppt." +OBSWebsocket.ProfileChanged.Restarted="WebSockets-Server in diesem Profil geändert. Server startet neu." diff --git a/data/locale/es-ES.ini b/data/locale/es-ES.ini index b0a84f09..511d2f91 100644 --- a/data/locale/es-ES.ini +++ b/data/locale/es-ES.ini @@ -1,14 +1,12 @@ -OBSWebsocket.Menu.SettingsItem="Configuración del servidor obs-websocket" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Habilitar el servidor Websocket" +OBSWebsocket.Settings.ServerEnable="Habilitar el servidor WebSockets" OBSWebsocket.Settings.ServerPort="Puerto del Servidor" OBSWebsocket.Settings.AuthRequired="Habilitar autenticación" OBSWebsocket.Settings.Password="Contraseña" OBSWebsocket.Settings.DebugEnable="Habilitar registro de depuración" -OBSWebsocket.Settings.AlertsEnable="Habilitar alertas de la bandeja de sistema" +OBSWebsocket.Settings.AlertsEnable="Habilitar alertas en la bandeja de sistema" OBSWebsocket.NotifyConnect.Title="Nueva conexión WebSocket" OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado" OBSWebsocket.NotifyDisconnect.Title="Cliente WebSocket desconectado" OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado" -OBSWebsocket.Server.StartFailed.Title="Fallo del servidor WebSocket" -OBSWebsocket.Server.StartFailed.Message="El servidor obs-websocket no se pudo iniciar, tal vez porque: \n - el puerto TCP %1 podría estar actualmente en uso en este sistema, posiblemente por otra aplicación. Intente configurar un puerto TCP diferente en la configuración del servidor WebSocket, o detenga cualquier aplicación que pudiese estar utilizando este puerto \n - Un error de red desconocido ha ocurrido en su sistema. Inténtalo de nuevo cambiando la configuración, reiniciando OBS o reiniciando su sistema." +OBSWebsocket.Server.StartFailed.Title="Falla en el servidor WebSockets" +OBSWebsocket.Server.StartFailed.Message="El servidor obs-websocket no se pudo iniciar, tal vez porque: \n - el puerto TCP %1 podría estar actualmente siendo usado este sistema, posiblemente por otra aplicación. Intente configurar un puerto TCP diferente en la configuración del servidor WebSocket, o detenga cualquier aplicación que pudiese estar utilizando este puerto \n - Un error de red desconocido ha afectado su sistema. Inténtelo de nuevo cambiando la configuración, reiniciando OBS o reiniciando su sistema." diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini index 391ef512..b2ba9238 100644 --- a/data/locale/fr-FR.ini +++ b/data/locale/fr-FR.ini @@ -1,4 +1,4 @@ -OBSWebsocket.Menu.SettingsItem="Paramètres du serveur Websocket" +OBSWebsocket.Settings.DialogTitle="Paramètres du serveur WebSockets" OBSWebsocket.Settings.ServerEnable="Activer le serveur WebSocket" OBSWebsocket.Settings.ServerPort="Port du serveur" OBSWebsocket.Settings.AuthRequired="Activer l'authentification" @@ -9,5 +9,8 @@ OBSWebsocket.NotifyConnect.Title="Nouvelle connexion WebSocket" OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté" OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket" OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté" -OBSWebsocket.Server.StartFailed.Title="Impossible de démarrer le serveur WebSocket" -OBSWebsocket.Server.StartFailed.Message="Le serveur WebSocket n'a pas pu démarrer, peut-être parce que :\n - Le port TCP %1 est en cours d'utilisation sur ce système, certainement par un autre programme. Essayez un port différent dans les réglages du serveur WebSocket, ou arrêtez tout programme susceptible d'utiliser ce port.\n - Une erreur réseau inconnue est survenue. Essayez à nouveau en modifiant vos réglages, en redémarrant OBS ou en redémarrant votre ordinateur." +OBSWebsocket.Server.StartFailed.Title="Impossible de démarrer le serveur WebSockets" +OBSWebsocket.Server.StartFailed.Message="Le serveur WebSockets n'a pas pu démarrer, peut-être parce que :\n - Le port TCP %1 est en cours d'utilisation sur ce système, certainement par un autre programme. Essayez un port différent dans les réglages du serveur WebSocket, ou arrêtez tout programme susceptible d'utiliser ce port.\n - Une erreur réseau inconnue est survenue. Essayez à nouveau en modifiant vos réglages, en redémarrant OBS ou en redémarrant votre ordinateur." +OBSWebsocket.ProfileChanged.Started="Serveur WebSockets actif dans ce profil." +OBSWebsocket.ProfileChanged.Stopped="Serveur WebSockets désactivé dans ce profil." +OBSWebsocket.ProfileChanged.Restarted="Le port actuel diffère du port configuré dans ce profil. Serveur WebSockets redémarré." diff --git a/data/locale/hi-IN.ini b/data/locale/hi-IN.ini new file mode 100644 index 00000000..e69de29b diff --git a/data/locale/it-IT.ini b/data/locale/it-IT.ini index ac005c19..df133462 100644 --- a/data/locale/it-IT.ini +++ b/data/locale/it-IT.ini @@ -1,6 +1,4 @@ -OBSWebsocket.Menu.SettingsItem="Impostazioni del server di WebSocket" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Abilitare il server Websocket" +OBSWebsocket.Settings.ServerEnable="Abilitare il server WebSockets" OBSWebsocket.Settings.ServerPort="Porta del server" OBSWebsocket.Settings.AuthRequired="Abilitare l'autenticazione" OBSWebsocket.Settings.Password="Password" @@ -11,4 +9,4 @@ OBSWebsocket.NotifyConnect.Message="%1 cliente collegato" OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente disconnesso" OBSWebsocket.NotifyDisconnect.Message="%1 cliente disconnesso" OBSWebsocket.Server.StartFailed.Title="Errore del WebSocket Server" -OBSWebsocket.Server.StartFailed.Message="Impossibile avviare, forse perché il server di obs-websocket: \n - %1 porta TCP potrebbe essere attualmente in uso altrove su questo sistema, possibilmente da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server di WebSocket, o arrestare tutte le applicazioni che potrebbero utilizzare questa porta. \n - è verificato un errore di rete sconosciuto sul sistema. Riprova modificando le impostazioni, riavviare OBS o riavvio del sistema." +OBSWebsocket.Server.StartFailed.Message="Impossibile avviare, forse perché il server di WebSockets: \n - %1 porta TCP potrebbe essere attualmente in uso altrove su questo sistema, possibilmente da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server di WebSockets, o arrestare tutte le applicazioni che potrebbero utilizzare questa porta. \n - è verificato un errore di rete sconosciuto sul sistema. Riprova modificando le impostazioni, riavviare OBS o riavvio del sistema." diff --git a/data/locale/ja-JP.ini b/data/locale/ja-JP.ini index f166a095..e80892a1 100644 --- a/data/locale/ja-JP.ini +++ b/data/locale/ja-JP.ini @@ -1,8 +1,11 @@ -OBSWebsocket.Menu.SettingsItem="Websocket サーバー設定" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Websocket サーバーを有効にする" +OBSWebsocket.Settings.ServerEnable="WebSockets サーバーを有効にする" OBSWebsocket.Settings.ServerPort="サーバーポート" OBSWebsocket.Settings.AuthRequired="認証を有効にする" OBSWebsocket.Settings.Password="パスワード" OBSWebsocket.Settings.DebugEnable="デバッグログを有効にする" -OBSWebsocket.NotifyConnect.Title="新しいWebSocket接続" +OBSWebsocket.Settings.AlertsEnable="システムトレイ通知を有効にする" +OBSWebsocket.NotifyConnect.Title="新しい WebSocket 接続" +OBSWebsocket.NotifyConnect.Message="接続されているクライアント %1" +OBSWebsocket.NotifyDisconnect.Title="WebSocket クライアントが切断されました" +OBSWebsocket.NotifyDisconnect.Message="切断されたクライアント %1" +OBSWebsocket.Server.StartFailed.Title="WebSockets サーバー障害" diff --git a/data/locale/nl-NL.ini b/data/locale/nl-NL.ini index 339e8a02..f3151408 100644 --- a/data/locale/nl-NL.ini +++ b/data/locale/nl-NL.ini @@ -1,14 +1,9 @@ -OBSWebsocket.Menu.SettingsItem="Websocket server instellingen" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Activeer Websocket server" OBSWebsocket.Settings.ServerPort="Serverpoort" -OBSWebsocket.Settings.AuthRequired="Activeer authenticatie" -OBSWebsocket.Settings.Password="Wachtwoord" OBSWebsocket.Settings.DebugEnable="Activeer debug logs" OBSWebsocket.Settings.AlertsEnable="Systemvak waarschuwingen inschakelen" OBSWebsocket.NotifyConnect.Title="Nieuwe WebSocket verbinding" OBSWebsocket.NotifyConnect.Message="Client %1 verbonden" OBSWebsocket.NotifyDisconnect.Title="WebSocket client connectie verbroken" OBSWebsocket.NotifyDisconnect.Message="Client %1 losgekoppeld" -OBSWebsocket.Server.StartFailed.Title="WebSocket Server mislukt" -OBSWebsocket.Server.StartFailed.Message="De obs-websocket server kan niet worden gestart, misschien omdat: \n - TCP-poort %1 momenteel wordt gebruikt elders op dit systeem, eventueel door een andere toepassing. Probeer een andere TCP-poort instellen in de WebSocket Server-instellingen of stoppen van elke toepassing die deze poort zouden kunnen gebruiken.\n Een onbekende netwerkfout gebeurde op uw systeem. Probeer het opnieuw door de instellingen wijzigen, OBS herstarten of opnieuw opstarten van uw systeem." +OBSWebsocket.Server.StartFailed.Title="Fout in WebSocket server" +OBSWebsocket.Server.StartFailed.Message="De obs-websocket server kan niet worden gestart, misschien omdat: \n - TCP-poort %1 momenteel elders wordt gebruikt op dit systeem, eventueel door een andere toepassing. Probeer een andere TCP-poort in te stellen in de WebSocket Server-instellingen of stop elke toepassing die deze poort zou kunnen gebruiken.\n Een onbekende Netwerkfout op uw systeem. Probeer het opnieuw door de instellingen te wijzigen, OBS te herstarten of uw systeem te herstarten." diff --git a/data/locale/pl-PL.ini b/data/locale/pl-PL.ini index 5cd946c5..984b630d 100644 --- a/data/locale/pl-PL.ini +++ b/data/locale/pl-PL.ini @@ -1,14 +1,10 @@ -OBSWebsocket.Menu.SettingsItem="Ustawienia serwera zdalnego sterowania" -OBSWebsocket.Settings.DialogTitle="Serwer zdalnego sterowania" -OBSWebsocket.Settings.ServerEnable="Włącz serwer zdalnego sterowania (Websocket)" -OBSWebsocket.Settings.ServerPort="Port serwera" -OBSWebsocket.Settings.AuthRequired="Wymagaj hasła" -OBSWebsocket.Settings.Password="Hasło" +OBSWebsocket.Settings.ServerEnable="Włącz serwer WebSockets" +OBSWebsocket.Settings.AuthRequired="Wymagaj uwierzytelniania" OBSWebsocket.Settings.DebugEnable="Włącz rejestrowanie debugowania" -OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia o zasobniku systemowym" +OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia w zasobniku systemowym" OBSWebsocket.NotifyConnect.Title="Nowe połączenie WebSocket" OBSWebsocket.NotifyConnect.Message="Klient %1 połączony" OBSWebsocket.NotifyDisconnect.Title="Klient WebSocket odłączony" -OBSWebsocket.NotifyDisconnect.Message="Klient %1 połączony" -OBSWebsocket.Server.StartFailed.Title="Awaria serwera WebSocket" -OBSWebsocket.Server.StartFailed.Message="Nie udało się uruchomić serwera obs-websocket, może a powodu: \n - TCP port %1 może być obecnie używany gdzie indziej w tym systemie, możliwie przez inną aplikację. Spróbuj ustawić inny port TCP w ustawieniach serwera WebSocket, lub zatrzymać dowolną aplikację, która może używać tego portu \n -nieznany błąd sieci wydarzył się w systemie. Spróbuj ponownie, zmieniając ustawienia, ponownie uruchamiając OBS lub ponownie uruchamiając system." +OBSWebsocket.NotifyDisconnect.Message="Klient %1 rozłączony" +OBSWebsocket.Server.StartFailed.Title="Awaria serwera WebSockets" +OBSWebsocket.Server.StartFailed.Message="Nie udało się uruchomić serwera WebSockets, może a powodu: \n - TCP port %1 może być obecnie używany gdzie indziej w tym systemie, możliwie przez inną aplikację. Spróbuj ustawić inny port TCP w ustawieniach serwera WebSockets, lub zatrzymać dowolną aplikację, która może używać tego portu \n -nieznany błąd sieci wydarzył się w systemie. Spróbuj ponownie, zmieniając ustawienia, ponownie uruchamiając OBS lub ponownie uruchamiając system." diff --git a/data/locale/pt-BR.ini b/data/locale/pt-BR.ini deleted file mode 100644 index c957671f..00000000 --- a/data/locale/pt-BR.ini +++ /dev/null @@ -1,5 +0,0 @@ -OBSWebsocket.Menu.SettingsItem="Configuraçes do Servidor Websocket" -OBSWebsocket.Settings.ServerEnable="Habilitar o Servidor Websocket" -OBSWebsocket.Settings.ServerPort="Porta do Servidor" -OBSWebsocket.Settings.AuthRequired="Autenticação Requerida" -OBSWebsocket.Settings.Password="Senha" diff --git a/data/locale/pt-PT.ini b/data/locale/pt-PT.ini index 341da848..211d8547 100644 --- a/data/locale/pt-PT.ini +++ b/data/locale/pt-PT.ini @@ -1,5 +1,3 @@ -OBSWebsocket.Menu.SettingsItem="Configurações do servidor Websocket" -OBSWebsocket.Settings.DialogTitle="obs-websocket" OBSWebsocket.Settings.ServerEnable="Habilitar servidor de WebSockets" OBSWebsocket.Settings.ServerPort="Porta do Servidor" OBSWebsocket.Settings.AuthRequired="Activar autenticação" @@ -11,4 +9,4 @@ OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado" OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente desconectado" OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado" OBSWebsocket.Server.StartFailed.Title="Falha do servidor de WebSocket" -OBSWebsocket.Server.StartFailed.Message="O servidor obs-websocket falhou ao iniciar, talvez porque: \n - TCP port %1 pode estar atualmente em uso em outro lugar sobre este sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSocket, ou parar qualquer aplicativo que poderia estar usando este porto \n - um erro de rede desconhecido aconteceu no seu sistema. Tente novamente alterar configurações, reiniciando OBS ou reiniciando o sistema." +OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, talvez porque: \n - TCP port %1 pode estar atualmente em uso em outro lugar sobre este sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou parar qualquer aplicativo que poderia estar usando este porto \n - um erro de rede desconhecido aconteceu no seu sistema. Tente novamente alterar configurações, reiniciando OBS ou reiniciando o sistema." diff --git a/data/locale/ru-RU.ini b/data/locale/ru-RU.ini index dcd18704..782f33c0 100644 --- a/data/locale/ru-RU.ini +++ b/data/locale/ru-RU.ini @@ -1,8 +1,7 @@ -OBSWebsocket.Menu.SettingsItem="Параметры сервера Websocket" -OBSWebsocket.Settings.DialogTitle="obs-websocket" -OBSWebsocket.Settings.ServerEnable="Включить сервер Websocket" +OBSWebsocket.Settings.DialogTitle="Настройки сервера WebSockets" +OBSWebsocket.Settings.ServerEnable="Включить сервер WebSockets" OBSWebsocket.Settings.ServerPort="Порт сервера" -OBSWebsocket.Settings.AuthRequired="Включить аутентификацию" +OBSWebsocket.Settings.AuthRequired="Включить авторизацию" OBSWebsocket.Settings.Password="Пароль" OBSWebsocket.Settings.DebugEnable="Включить ведение журнала отладки" OBSWebsocket.Settings.AlertsEnable="Включить оповещения в системном трее" @@ -10,5 +9,5 @@ OBSWebsocket.NotifyConnect.Title="Новое соединение WebSocket" OBSWebsocket.NotifyConnect.Message="Клиент %1 подключен" OBSWebsocket.NotifyDisconnect.Title="Клиент WebSocket отключён" OBSWebsocket.NotifyDisconnect.Message="Клиент %1 отключен" -OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSocket" -OBSWebsocket.Server.StartFailed.Message="Сбой запуска сервера obs-websocket. Вероятные причины:\n - Возможно, TCP-порт %1 занят другим приложением в системе. Попробуйте задать другой TCP-порт в настройках сервера WebSocket или закройте приложение, которое может использовать данный порт.\n - Произошла неизвестная сетевая ошибка в системе. Попробуйте снова после изменения настроек, перезапуска OBS или перезапуска системы." +OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSockets" +OBSWebsocket.Server.StartFailed.Message="Ошибка запуска сервера WebSockets. Вероятные причины:\n - Возможно, TCP-порт %1 занят другим приложением в системе. Попробуйте задать другой TCP-порт в настройках сервера WebSockets или закройте приложение, которое может использовать данный порт.\n - Произошла неизвестная сетевая ошибка в системе. Попробуйте снова после изменения настроек, перезапуска OBS или системы." diff --git a/data/locale/zh-CN.ini b/data/locale/zh-CN.ini index 4b339c76..a40d3432 100644 --- a/data/locale/zh-CN.ini +++ b/data/locale/zh-CN.ini @@ -1,6 +1,12 @@ -OBSWebsocket.Menu.SettingsItem="Websocket 服务器设置" -OBSWebsocket.Settings.DialogTitle="obs-websocket 设置" -OBSWebsocket.Settings.ServerEnable="启用 Websocket 服务器" +OBSWebsocket.Settings.ServerEnable="启用 WebSockets 服务器" OBSWebsocket.Settings.ServerPort="服务器端口" -OBSWebsocket.Settings.AuthRequired="启用密码认证" +OBSWebsocket.Settings.AuthRequired="启用身份验证" OBSWebsocket.Settings.Password="密码" +OBSWebsocket.Settings.DebugEnable="启用调试日志" +OBSWebsocket.Settings.AlertsEnable="启用系统托盘通知" +OBSWebsocket.NotifyConnect.Title="新 WebSocket 连接" +OBSWebsocket.NotifyConnect.Message="客户端 %1 已连接" +OBSWebsocket.NotifyDisconnect.Title="WebSocket 客户端已断开" +OBSWebsocket.NotifyDisconnect.Message="客户端 %1 已断开连接" +OBSWebsocket.Server.StartFailed.Title="WebSockets 服务器错误" +OBSWebsocket.Server.StartFailed.Message="WebSockets 服务器启动失败,可能是因为:\n - TCP 端口 %1 可能被本机的另一个应用程序占用。尝试在 WebSockets 服务器设置中设置不同的 TCP 端口,或关闭任何可能使用此端口的应用程序。\n - 在您的系统上发生了未知的网络错误。请尝试更改设置、重新启动 OBS 或重新启动系统。" diff --git a/data/locale/zh-TW.ini b/data/locale/zh-TW.ini index fa6af0f5..e72077df 100644 --- a/data/locale/zh-TW.ini +++ b/data/locale/zh-TW.ini @@ -1,6 +1,9 @@ -OBSWebsocket.Menu.SettingsItem="Websocket 伺服器設定" -OBSWebsocket.Settings.DialogTitle="obs-websocket 設定" -OBSWebsocket.Settings.ServerEnable="啟用 Websocket 伺服器" -OBSWebsocket.Settings.ServerPort="伺服器端口" -OBSWebsocket.Settings.AuthRequired="啟用密碼認證" -OBSWebsocket.Settings.Password="密碼" +OBSWebsocket.Settings.ServerPort="伺服器連接埠" +OBSWebsocket.Settings.DebugEnable="啟用除錯日誌" +OBSWebsocket.Settings.AlertsEnable="啟用系統列通知" +OBSWebsocket.NotifyConnect.Title="新的 WebSocket 連線" +OBSWebsocket.NotifyConnect.Message="客戶端 %1 已連線" +OBSWebsocket.NotifyDisconnect.Title="WebSocket 客戶端已離線" +OBSWebsocket.NotifyDisconnect.Message="客戶端 %1 已離線" +OBSWebsocket.Server.StartFailed.Title="WebSocket 伺服器錯誤" +OBSWebsocket.Server.StartFailed.Message="WebSockets 伺服器啟動失敗,可能的原因有:\n - TCP 連接埠 %1 被系統的其他程式所使用,試著為 WebSockets 伺服器指定不同的 TCP 連接埠,或是關閉任何可能使用此連接埠的程式。\n - 發生的未知的網路錯誤,試著更改設定、重新啟動 OBS 或是重新啟動您的系統。"