From 740a8a8d06e8e8312cdc522a1dbd4be83e2bbd5e Mon Sep 17 00:00:00 2001 From: Valter Minute Date: Wed, 20 Jan 2021 09:00:14 +0100 Subject: [PATCH] General: Add ScenesCollection object Adds a ScenesCollection object in the protocol definition, replacing the current Array return with Array, keeping it more coherent with other requests that return objects in the same format. This will help automated code generation from comment.json that otherwise would require ad-hoc handling for that specific request. Signed-off-by: Valter Minute --- docs/generated/comments.json | 37 +++++++++++++++++------ docs/generated/protocol.md | 8 +++-- src/WSRequestHandler_SceneCollections.cpp | 8 +++-- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/docs/generated/comments.json b/docs/generated/comments.json index cc02464d..c61bea27 100644 --- a/docs/generated/comments.json +++ b/docs/generated/comments.json @@ -474,6 +474,31 @@ }, "examples": [] }, + { + "subheads": [], + "typedef": "{Object} `ScenesCollection`", + "property": "{String} `sc-name` Name of the scene collection", + "properties": [ + { + "type": "String", + "name": "sc-name", + "description": "Name of the scene collection" + } + ], + "typedefs": [ + { + "type": "Object", + "name": "ScenesCollection", + "description": "" + } + ], + "name": "", + "heading": { + "level": 2, + "text": "" + }, + "examples": [] + }, { "subheads": [], "typedef": "{Object} `Scene`", @@ -8218,24 +8243,16 @@ { "subheads": [], "description": "List available scene collections", - "return": [ - "{Array} `scene-collections` Scene collections list", - "{String} `scene-collections.*.sc-name` Scene collection name" - ], + "return": "{Array} `scene-collections` Scene collections list", "api": "requests", "name": "ListSceneCollections", "category": "scene collections", "since": "4.0.0", "returns": [ { - "type": "Array", + "type": "Array", "name": "scene-collections", "description": "Scene collections list" - }, - { - "type": "String", - "name": "scene-collections.*.sc-name", - "description": "Scene collection name" } ], "names": [ diff --git a/docs/generated/protocol.md b/docs/generated/protocol.md index 9d9bd8a7..d3007b24 100644 --- a/docs/generated/protocol.md +++ b/docs/generated/protocol.md @@ -49,6 +49,7 @@ You can also refer to any of the client libraries listed on the [README](README. * [SceneItemTransform](#sceneitemtransform) * [OBSStats](#obsstats) * [Output](#output) + * [ScenesCollection](#scenescollection) * [Scene](#scene) - [Events](#events) * [Scenes](#scenes) @@ -344,6 +345,10 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen | `totalFrames` | _int_ | Number of frames sent | | `droppedFrames` | _int_ | Number of frames dropped | | `totalBytes` | _int_ | Total bytes sent | +## ScenesCollection +| Name | Type | Description | +| ---- | :---: | ------------| +| `sc-name` | _String_ | Name of the scene collection | ## Scene | Name | Type | Description | | ---- | :---: | ------------| @@ -3308,8 +3313,7 @@ _No specified parameters._ | Name | Type | Description | | ---- | :---: | ------------| -| `scene-collections` | _Array<String>_ | Scene collections list | -| `scene-collections.*.sc-name` | _String_ | Scene collection name | +| `scene-collections` | _Array<ScenesCollection>_ | Scene collections list | --- diff --git a/src/WSRequestHandler_SceneCollections.cpp b/src/WSRequestHandler_SceneCollections.cpp index 77ce5d0a..8fc0ef42 100644 --- a/src/WSRequestHandler_SceneCollections.cpp +++ b/src/WSRequestHandler_SceneCollections.cpp @@ -2,6 +2,11 @@ #include "WSRequestHandler.h" +/** +* @typedef {Object} `ScenesCollection` +* @property {String} `sc-name` Name of the scene collection +*/ + /** * Change the active scene collection. * @@ -59,8 +64,7 @@ RpcResponse WSRequestHandler::GetCurrentSceneCollection(const RpcRequest& reques /** * List available scene collections * - * @return {Array} `scene-collections` Scene collections list - * @return {String} `scene-collections.*.sc-name` Scene collection name + * @return {Array} `scene-collections` Scene collections list * * @api requests * @name ListSceneCollections