mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Merge pull request #254 from Lange/typedefs
docs: improve consistency of array typings; introduce typedefs category
This commit is contained in:
commit
fc637eef6d
@ -30,6 +30,14 @@ const processComments = comments => {
|
|||||||
let errors = [];
|
let errors = [];
|
||||||
|
|
||||||
comments.forEach(comment => {
|
comments.forEach(comment => {
|
||||||
|
if (comment.typedef) {
|
||||||
|
comment.comment = undefined;
|
||||||
|
comment.context = undefined;
|
||||||
|
sorted['typedefs'] = sorted['typedefs'] || [];
|
||||||
|
sorted['typedefs'].push(comment);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof comment.api === 'undefined') return;
|
if (typeof comment.api === 'undefined') return;
|
||||||
let validationFailures = validateComment(comment);
|
let validationFailures = validateComment(comment);
|
||||||
|
|
||||||
@ -84,9 +92,7 @@ const validateComment = comment => {
|
|||||||
fullContext: Object.assign({}, comment)
|
fullContext: Object.assign({}, comment)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
};
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const files = glob.sync(config.srcGlob);
|
const files = glob.sync(config.srcGlob);
|
||||||
const comments = processComments(parseFiles(files));
|
const comments = processComments(parseFiles(files));
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"description": "Indicates a scene change.",
|
"description": "Indicates a scene change.",
|
||||||
"return": [
|
"return": [
|
||||||
"{String} `scene-name` The new scene.",
|
"{String} `scene-name` The new scene.",
|
||||||
"{Array} `sources` List of sources in the new scene."
|
"{Array<Source>} `sources` List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
||||||
],
|
],
|
||||||
"api": "events",
|
"api": "events",
|
||||||
"name": "SwitchScenes",
|
"name": "SwitchScenes",
|
||||||
@ -19,9 +19,9 @@
|
|||||||
"description": "The new scene."
|
"description": "The new scene."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Array",
|
"type": "Array<Source>",
|
||||||
"name": "sources",
|
"name": "sources",
|
||||||
"description": "List of sources in the new scene."
|
"description": "List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"names": [
|
"names": [
|
||||||
@ -1246,7 +1246,7 @@
|
|||||||
"description": "The selected preview scene has changed (only available in Studio Mode).",
|
"description": "The selected preview scene has changed (only available in Studio Mode).",
|
||||||
"return": [
|
"return": [
|
||||||
"{String} `scene-name` Name of the scene being previewed.",
|
"{String} `scene-name` Name of the scene being previewed.",
|
||||||
"{Source|Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
"{Array<Source>} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
||||||
],
|
],
|
||||||
"api": "events",
|
"api": "events",
|
||||||
"name": "PreviewSceneChanged",
|
"name": "PreviewSceneChanged",
|
||||||
@ -1259,7 +1259,7 @@
|
|||||||
"description": "Name of the scene being previewed."
|
"description": "Name of the scene being previewed."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Source|Array",
|
"type": "Array<Source>",
|
||||||
"name": "sources",
|
"name": "sources",
|
||||||
"description": "List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
"description": "List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene)."
|
||||||
}
|
}
|
||||||
@ -1702,14 +1702,14 @@
|
|||||||
{
|
{
|
||||||
"subheads": [],
|
"subheads": [],
|
||||||
"description": "Get a list of available profiles.",
|
"description": "Get a list of available profiles.",
|
||||||
"return": "{Object|Array} `profiles` List of available profiles.",
|
"return": "{Array<Object>} `profiles` List of available profiles.",
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "ListProfiles",
|
"name": "ListProfiles",
|
||||||
"category": "profiles",
|
"category": "profiles",
|
||||||
"since": "4.0.0",
|
"since": "4.0.0",
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"type": "Object|Array",
|
"type": "Array<Object>",
|
||||||
"name": "profiles",
|
"name": "profiles",
|
||||||
"description": "List of available profiles."
|
"description": "List of available profiles."
|
||||||
}
|
}
|
||||||
@ -2144,24 +2144,16 @@
|
|||||||
{
|
{
|
||||||
"subheads": [],
|
"subheads": [],
|
||||||
"description": "List available scene collections",
|
"description": "List available scene collections",
|
||||||
"return": [
|
"return": "{Array<String>} `scene-collections` Scene collections list",
|
||||||
"{Object|Array} `scene-collections` Scene collections list",
|
|
||||||
"{String} `scene-collections.*.`"
|
|
||||||
],
|
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "ListSceneCollections",
|
"name": "ListSceneCollections",
|
||||||
"category": "scene collections",
|
"category": "scene collections",
|
||||||
"since": "4.0.0",
|
"since": "4.0.0",
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"type": "Object|Array",
|
"type": "Array<String>",
|
||||||
"name": "scene-collections",
|
"name": "scene-collections",
|
||||||
"description": "Scene collections list"
|
"description": "Scene collections list"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "String",
|
|
||||||
"name": "scene-collections.*.",
|
|
||||||
"description": ""
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"names": [
|
"names": [
|
||||||
@ -2861,7 +2853,7 @@
|
|||||||
"description": "Get the current scene's name and source items.",
|
"description": "Get the current scene's name and source items.",
|
||||||
"return": [
|
"return": [
|
||||||
"{String} `name` Name of the currently active scene.",
|
"{String} `name` Name of the currently active scene.",
|
||||||
"{Source|Array} `sources` Ordered list of the current scene's source items."
|
"{Array<Source>} `sources` Ordered list of the current scene's source items."
|
||||||
],
|
],
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "GetCurrentScene",
|
"name": "GetCurrentScene",
|
||||||
@ -2874,7 +2866,7 @@
|
|||||||
"description": "Name of the currently active scene."
|
"description": "Name of the currently active scene."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Source|Array",
|
"type": "Array<Source>",
|
||||||
"name": "sources",
|
"name": "sources",
|
||||||
"description": "Ordered list of the current scene's source items."
|
"description": "Ordered list of the current scene's source items."
|
||||||
}
|
}
|
||||||
@ -2910,7 +2902,7 @@
|
|||||||
"description": "Get a list of scenes in the currently active profile.",
|
"description": "Get a list of scenes in the currently active profile.",
|
||||||
"return": [
|
"return": [
|
||||||
"{String} `current-scene` Name of the currently active scene.",
|
"{String} `current-scene` Name of the currently active scene.",
|
||||||
"{Scene|Array} `scenes` Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information)."
|
"{Array<Scene>} `scenes` Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information)."
|
||||||
],
|
],
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "GetSceneList",
|
"name": "GetSceneList",
|
||||||
@ -2923,7 +2915,7 @@
|
|||||||
"description": "Name of the currently active scene."
|
"description": "Name of the currently active scene."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Scene|Array",
|
"type": "Array<Scene>",
|
||||||
"name": "scenes",
|
"name": "scenes",
|
||||||
"description": "Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information)."
|
"description": "Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information)."
|
||||||
}
|
}
|
||||||
@ -2960,7 +2952,7 @@
|
|||||||
"subheads": [],
|
"subheads": [],
|
||||||
"description": "List all sources available in the running OBS instance",
|
"description": "List all sources available in the running OBS instance",
|
||||||
"return": [
|
"return": [
|
||||||
"{Array of Objects} `sources` Array of sources as objects",
|
"{Array<Object>} `sources` Array of sources",
|
||||||
"{String} `sources.*.name` Unique source name",
|
"{String} `sources.*.name` Unique source name",
|
||||||
"{String} `sources.*.typeId` Non-unique source internal type (a.k.a type id)",
|
"{String} `sources.*.typeId` Non-unique source internal type (a.k.a type id)",
|
||||||
"{String} `sources.*.type` Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\""
|
"{String} `sources.*.type` Source type. Value is one of the following: \"input\", \"filter\", \"transition\", \"scene\" or \"unknown\""
|
||||||
@ -2971,9 +2963,9 @@
|
|||||||
"since": "4.3.0",
|
"since": "4.3.0",
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"type": "Array of Objects",
|
"type": "Array<Object>",
|
||||||
"name": "sources",
|
"name": "sources",
|
||||||
"description": "Array of sources as objects"
|
"description": "Array of sources"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "String",
|
"type": "String",
|
||||||
@ -3021,7 +3013,7 @@
|
|||||||
"subheads": [],
|
"subheads": [],
|
||||||
"description": "Get a list of all available sources types",
|
"description": "Get a list of all available sources types",
|
||||||
"return": [
|
"return": [
|
||||||
"{Array of Objects} `ids` Array of sources as objects",
|
"{Array<Object>} `ids` Array of source types",
|
||||||
"{String} `ids.*.typeId` Non-unique internal source type ID",
|
"{String} `ids.*.typeId` Non-unique internal source type ID",
|
||||||
"{String} `ids.*.displayName` Display name of the source type",
|
"{String} `ids.*.displayName` Display name of the source type",
|
||||||
"{String} `ids.*.type` Type. Value is one of the following: \"input\", \"filter\", \"transition\" or \"other\"",
|
"{String} `ids.*.type` Type. Value is one of the following: \"input\", \"filter\", \"transition\" or \"other\"",
|
||||||
@ -3041,9 +3033,9 @@
|
|||||||
"since": "4.3.0",
|
"since": "4.3.0",
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"type": "Array of Objects",
|
"type": "Array<Object>",
|
||||||
"name": "ids",
|
"name": "ids",
|
||||||
"description": "Array of sources as objects"
|
"description": "Array of source types"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "String",
|
"type": "String",
|
||||||
@ -4493,7 +4485,7 @@
|
|||||||
"description": "List filters applied to a source",
|
"description": "List filters applied to a source",
|
||||||
"param": "{String} `sourceName` Source name",
|
"param": "{String} `sourceName` Source name",
|
||||||
"return": [
|
"return": [
|
||||||
"{Array of Objects} `filters` List of filters for the specified source",
|
"{Array<Object>} `filters` List of filters for the specified source",
|
||||||
"{String} `filters.*.type` Filter type",
|
"{String} `filters.*.type` Filter type",
|
||||||
"{String} `filters.*.name` Filter name",
|
"{String} `filters.*.name` Filter name",
|
||||||
"{Object} `filters.*.settings` Filter settings"
|
"{Object} `filters.*.settings` Filter settings"
|
||||||
@ -4504,7 +4496,7 @@
|
|||||||
"since": "unreleased",
|
"since": "unreleased",
|
||||||
"returns": [
|
"returns": [
|
||||||
{
|
{
|
||||||
"type": "Array of Objects",
|
"type": "Array<Object>",
|
||||||
"name": "filters",
|
"name": "filters",
|
||||||
"description": "List of filters for the specified source"
|
"description": "List of filters for the specified source"
|
||||||
},
|
},
|
||||||
@ -5303,7 +5295,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.",
|
"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": [
|
"return": [
|
||||||
"{String} `name` The name of the active preview scene.",
|
"{String} `name` The name of the active preview scene.",
|
||||||
"{Source|Array} `sources`"
|
"{Array<Source>} `sources`"
|
||||||
],
|
],
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "GetPreviewScene",
|
"name": "GetPreviewScene",
|
||||||
@ -5316,7 +5308,7 @@
|
|||||||
"description": "The name of the active preview scene."
|
"description": "The name of the active preview scene."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Source|Array",
|
"type": "Array<Source>",
|
||||||
"name": "sources",
|
"name": "sources",
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
@ -5549,8 +5541,8 @@
|
|||||||
"description": "List of all transitions available in the frontend's dropdown menu.",
|
"description": "List of all transitions available in the frontend's dropdown menu.",
|
||||||
"return": [
|
"return": [
|
||||||
"{String} `current-transition` Name of the currently active transition.",
|
"{String} `current-transition` Name of the currently active transition.",
|
||||||
"{Object|Array} `transitions` List of transitions.",
|
"{Array<Object>} `transitions` List of transitions.",
|
||||||
"{String} `transitions[].name` Name of the transition."
|
"{String} `transitions.*.name` Name of the transition."
|
||||||
],
|
],
|
||||||
"api": "requests",
|
"api": "requests",
|
||||||
"name": "GetTransitionList",
|
"name": "GetTransitionList",
|
||||||
@ -5563,13 +5555,13 @@
|
|||||||
"description": "Name of the currently active transition."
|
"description": "Name of the currently active transition."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "Object|Array",
|
"type": "Array<Object>",
|
||||||
"name": "transitions",
|
"name": "transitions",
|
||||||
"description": "List of transitions."
|
"description": "List of transitions."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "String",
|
"type": "String",
|
||||||
"name": "transitions[].name",
|
"name": "transitions.*.name",
|
||||||
"description": "Name of the transition."
|
"description": "Name of the transition."
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -5772,5 +5764,121 @@
|
|||||||
"examples": []
|
"examples": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"subheads": [],
|
||||||
|
"typedef": "{Object} `Scene`",
|
||||||
|
"property": [
|
||||||
|
"{String} `name` Name of the currently active scene.",
|
||||||
|
"{Array<Source>} `sources` Ordered list of the current scene's source items."
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"type": "String",
|
||||||
|
"name": "name",
|
||||||
|
"description": "Name of the currently active scene."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Array<Source>",
|
||||||
|
"name": "sources",
|
||||||
|
"description": "Ordered list of the current scene's source items."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"typedefs": [
|
||||||
|
{
|
||||||
|
"type": "Object",
|
||||||
|
"name": "Scene",
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "",
|
||||||
|
"heading": {
|
||||||
|
"level": 2,
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
"examples": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"subheads": [],
|
||||||
|
"typedef": "{Object} `Source` An OBS Scene Item.",
|
||||||
|
"property": [
|
||||||
|
"{Number} `cy`",
|
||||||
|
"{Number} `cx`",
|
||||||
|
"{String} `name` The name of this Scene Item.",
|
||||||
|
"{Boolean} `render` Whether or not this Scene Item is set to \"visible\".",
|
||||||
|
"{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": "Boolean",
|
||||||
|
"name": "render",
|
||||||
|
"description": "Whether or not this Scene Item is set to \"visible\"."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
@ -43,6 +43,9 @@ auth_response = base64_encode(auth_response_hash)
|
|||||||
|
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
|
- [Typedefs](#typedefs)
|
||||||
|
* [Scene](#scene)
|
||||||
|
* [Source](#source)
|
||||||
- [Events](#events)
|
- [Events](#events)
|
||||||
* [Scenes](#scenes)
|
* [Scenes](#scenes)
|
||||||
+ [SwitchScenes](#switchscenes)
|
+ [SwitchScenes](#switchscenes)
|
||||||
@ -174,6 +177,31 @@ auth_response = base64_encode(auth_response_hash)
|
|||||||
|
|
||||||
<!-- tocstop -->
|
<!-- tocstop -->
|
||||||
|
|
||||||
|
# Typedefs
|
||||||
|
These are complex types, such as `Source` and `Scene`, which are used as arguments or return values in multiple requests and/or events.
|
||||||
|
|
||||||
|
|
||||||
|
## Scene
|
||||||
|
| Name | Type | Description |
|
||||||
|
| ---- | :---: | ------------|
|
||||||
|
| `name` | _String_ | Name of the currently active scene. |
|
||||||
|
| `sources` | _Array<Source>_ | Ordered list of the current scene's source items. |
|
||||||
|
## Source
|
||||||
|
| Name | Type | Description |
|
||||||
|
| ---- | :---: | ------------|
|
||||||
|
| `cy` | _Number_ | |
|
||||||
|
| `cx` | _Number_ | |
|
||||||
|
| `name` | _String_ | The name of this Scene Item. |
|
||||||
|
| `render` | _Boolean_ | Whether or not this Scene Item is set to "visible". |
|
||||||
|
| `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_ | |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Events
|
# Events
|
||||||
Events are broadcast by the server to each connected client when a recognized action occurs within OBS.
|
Events are broadcast by the server to each connected client when a recognized action occurs within OBS.
|
||||||
|
|
||||||
@ -201,7 +229,7 @@ Indicates a scene change.
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `scene-name` | _String_ | The new scene. |
|
| `scene-name` | _String_ | The new scene. |
|
||||||
| `sources` | _Array_ | List of sources in the new scene. |
|
| `sources` | _Array<Source>_ | List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene). |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -661,7 +689,7 @@ The selected preview scene has changed (only available in Studio Mode).
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `scene-name` | _String_ | Name of the scene being previewed. |
|
| `scene-name` | _String_ | Name of the scene being previewed. |
|
||||||
| `sources` | _Source\|Array_ | List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). |
|
| `sources` | _Array<Source>_ | List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene). |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -883,7 +911,7 @@ _No specified parameters._
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `profiles` | _Object\|Array_ | List of available profiles. |
|
| `profiles` | _Array<Object>_ | List of available profiles. |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1117,8 +1145,7 @@ _No specified parameters._
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `scene-collections` | _Object\|Array_ | Scene collections list |
|
| `scene-collections` | _Array<String>_ | Scene collections list |
|
||||||
| `scene-collections.*.` | _String_ | |
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1357,7 +1384,7 @@ _No specified parameters._
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `name` | _String_ | Name of the currently active scene. |
|
| `name` | _String_ | Name of the currently active scene. |
|
||||||
| `sources` | _Source\|Array_ | Ordered list of the current scene's source items. |
|
| `sources` | _Array<Source>_ | Ordered list of the current scene's source items. |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1378,7 +1405,7 @@ _No specified parameters._
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `current-scene` | _String_ | Name of the currently active scene. |
|
| `current-scene` | _String_ | Name of the currently active scene. |
|
||||||
| `scenes` | _Scene\|Array_ | Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information). |
|
| `scenes` | _Array<Scene>_ | Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information). |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -1400,7 +1427,7 @@ _No specified parameters._
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `sources` | _Array of Objects_ | Array of sources as objects |
|
| `sources` | _Array<Object>_ | Array of sources |
|
||||||
| `sources.*.name` | _String_ | Unique source name |
|
| `sources.*.name` | _String_ | Unique source name |
|
||||||
| `sources.*.typeId` | _String_ | Non-unique source internal type (a.k.a type id) |
|
| `sources.*.typeId` | _String_ | Non-unique source internal type (a.k.a type id) |
|
||||||
| `sources.*.type` | _String_ | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" |
|
| `sources.*.type` | _String_ | Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown" |
|
||||||
@ -1423,7 +1450,7 @@ _No specified parameters._
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `ids` | _Array of Objects_ | Array of sources as objects |
|
| `ids` | _Array<Object>_ | Array of source types |
|
||||||
| `ids.*.typeId` | _String_ | Non-unique internal source type ID |
|
| `ids.*.typeId` | _String_ | Non-unique internal source type ID |
|
||||||
| `ids.*.displayName` | _String_ | Display name of the source type |
|
| `ids.*.displayName` | _String_ | Display name of the source type |
|
||||||
| `ids.*.type` | _String_ | Type. Value is one of the following: "input", "filter", "transition" or "other" |
|
| `ids.*.type` | _String_ | Type. Value is one of the following: "input", "filter", "transition" or "other" |
|
||||||
@ -1900,7 +1927,7 @@ List filters applied to a source
|
|||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `filters` | _Array of Objects_ | List of filters for the specified source |
|
| `filters` | _Array<Object>_ | List of filters for the specified source |
|
||||||
| `filters.*.type` | _String_ | Filter type |
|
| `filters.*.type` | _String_ | Filter type |
|
||||||
| `filters.*.name` | _String_ | Filter name |
|
| `filters.*.name` | _String_ | Filter name |
|
||||||
| `filters.*.settings` | _Object_ | Filter settings |
|
| `filters.*.settings` | _Object_ | Filter settings |
|
||||||
@ -2217,7 +2244,7 @@ _No specified parameters._
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `name` | _String_ | The name of the active preview scene. |
|
| `name` | _String_ | The name of the active preview scene. |
|
||||||
| `sources` | _Source\|Array_ | |
|
| `sources` | _Array<Source>_ | |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -2335,8 +2362,8 @@ _No specified parameters._
|
|||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---- | :---: | ------------|
|
| ---- | :---: | ------------|
|
||||||
| `current-transition` | _String_ | Name of the currently active transition. |
|
| `current-transition` | _String_ | Name of the currently active transition. |
|
||||||
| `transitions` | _Object\|Array_ | List of transitions. |
|
| `transitions` | _Array<Object>_ | List of transitions. |
|
||||||
| `transitions[].name` | _String_ | Name of the transition. |
|
| `transitions.*.name` | _String_ | Name of the transition. |
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
2
docs/partials/typedefsHeader.md
Normal file
2
docs/partials/typedefsHeader.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Typedefs
|
||||||
|
These are complex types, such as `Source` and `Scene`, which are used as arguments or return values in multiple requests and/or events.
|
@ -7,6 +7,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{{#read "partials/typedefsHeader.md"}}{{/read}}
|
||||||
|
|
||||||
|
{{#each typedefs}}
|
||||||
|
## {{typedefs.0.name}}
|
||||||
|
| Name | Type | Description |
|
||||||
|
| ---- | :---: | ------------|
|
||||||
|
{{#each properties}}
|
||||||
|
| `{{name}}` | _{{depipe type}}_ | {{{depipe description}}} |
|
||||||
|
{{/each}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{#read "partials/eventsHeader.md"}}{{/read}}
|
{{#read "partials/eventsHeader.md"}}{{/read}}
|
||||||
|
|
||||||
{{#each events}}
|
{{#each events}}
|
||||||
|
@ -292,7 +292,7 @@ const char* WSEvents::GetRecordingTimecode() {
|
|||||||
* Indicates a scene change.
|
* Indicates a scene change.
|
||||||
*
|
*
|
||||||
* @return {String} `scene-name` The new scene.
|
* @return {String} `scene-name` The new scene.
|
||||||
* @return {Array} `sources` List of sources in the new scene.
|
* @return {Array<Source>} `sources` List of sources in the new scene. Same specification as [`GetCurrentScene`](#getcurrentscene).
|
||||||
*
|
*
|
||||||
* @api events
|
* @api events
|
||||||
* @name SwitchScenes
|
* @name SwitchScenes
|
||||||
@ -907,7 +907,7 @@ void WSEvents::OnSceneItemVisibilityChanged(void* param, calldata_t* data) {
|
|||||||
* The selected preview scene has changed (only available in Studio Mode).
|
* The selected preview scene has changed (only available in Studio Mode).
|
||||||
*
|
*
|
||||||
* @return {String} `scene-name` Name of the scene being previewed.
|
* @return {String} `scene-name` Name of the scene being previewed.
|
||||||
* @return {Source|Array} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene).
|
* @return {Array<Source>} `sources` List of sources composing the scene. Same specification as [`GetCurrentScene`](#getcurrentscene).
|
||||||
*
|
*
|
||||||
* @api events
|
* @api events
|
||||||
* @name PreviewSceneChanged
|
* @name PreviewSceneChanged
|
||||||
|
@ -50,7 +50,7 @@ void WSRequestHandler::HandleGetCurrentProfile(WSRequestHandler* req) {
|
|||||||
/**
|
/**
|
||||||
* Get a list of available profiles.
|
* Get a list of available profiles.
|
||||||
*
|
*
|
||||||
* @return {Object|Array} `profiles` List of available profiles.
|
* @return {Array<Object>} `profiles` List of available profiles.
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name ListProfiles
|
* @name ListProfiles
|
||||||
|
@ -50,8 +50,7 @@ void WSRequestHandler::HandleGetCurrentSceneCollection(WSRequestHandler* req) {
|
|||||||
/**
|
/**
|
||||||
* List available scene collections
|
* List available scene collections
|
||||||
*
|
*
|
||||||
* @return {Object|Array} `scene-collections` Scene collections list
|
* @return {Array<String>} `scene-collections` Scene collections list
|
||||||
* @return {String} `scene-collections.*.`
|
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name ListSceneCollections
|
* @name ListSceneCollections
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
#include "WSRequestHandler.h"
|
#include "WSRequestHandler.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} `Scene`
|
||||||
|
* @property {String} `name` Name of the currently active scene.
|
||||||
|
* @property {Array<Source>} `sources` Ordered list of the current scene's source items.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switch to the specified scene.
|
* Switch to the specified scene.
|
||||||
*
|
*
|
||||||
@ -34,7 +40,7 @@
|
|||||||
* Get the current scene's name and source items.
|
* Get the current scene's name and source items.
|
||||||
*
|
*
|
||||||
* @return {String} `name` Name of the currently active scene.
|
* @return {String} `name` Name of the currently active scene.
|
||||||
* @return {Source|Array} `sources` Ordered list of the current scene's source items.
|
* @return {Array<Source>} `sources` Ordered list of the current scene's source items.
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name GetCurrentScene
|
* @name GetCurrentScene
|
||||||
@ -56,7 +62,7 @@ void WSRequestHandler::HandleGetCurrentScene(WSRequestHandler* req) {
|
|||||||
* Get a list of scenes in the currently active profile.
|
* Get a list of scenes in the currently active profile.
|
||||||
*
|
*
|
||||||
* @return {String} `current-scene` Name of the currently active scene.
|
* @return {String} `current-scene` Name of the currently active scene.
|
||||||
* @return {Scene|Array} `scenes` Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information).
|
* @return {Array<Scene>} `scenes` Ordered list of the current profile's scenes (See `[GetCurrentScene](#getcurrentscene)` for more information).
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name GetSceneList
|
* @name GetSceneList
|
||||||
|
@ -3,10 +3,24 @@
|
|||||||
|
|
||||||
#include "WSRequestHandler.h"
|
#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 {Boolean} `render` Whether or not this Scene Item is set to "visible".
|
||||||
|
* @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`
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List all sources available in the running OBS instance
|
* List all sources available in the running OBS instance
|
||||||
*
|
*
|
||||||
* @return {Array of Objects} `sources` Array of sources as objects
|
* @return {Array<Object>} `sources` Array of sources
|
||||||
* @return {String} `sources.*.name` Unique source name
|
* @return {String} `sources.*.name` Unique source name
|
||||||
* @return {String} `sources.*.typeId` Non-unique source internal type (a.k.a type id)
|
* @return {String} `sources.*.typeId` Non-unique source internal type (a.k.a type id)
|
||||||
* @return {String} `sources.*.type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown"
|
* @return {String} `sources.*.type` Source type. Value is one of the following: "input", "filter", "transition", "scene" or "unknown"
|
||||||
@ -64,7 +78,7 @@ void WSRequestHandler::HandleGetSourcesList(WSRequestHandler* req) {
|
|||||||
/**
|
/**
|
||||||
* Get a list of all available sources types
|
* Get a list of all available sources types
|
||||||
*
|
*
|
||||||
* @return {Array of Objects} `ids` Array of sources as objects
|
* @return {Array<Object>} `ids` Array of source types
|
||||||
* @return {String} `ids.*.typeId` Non-unique internal source type ID
|
* @return {String} `ids.*.typeId` Non-unique internal source type ID
|
||||||
* @return {String} `ids.*.displayName` Display name of the source type
|
* @return {String} `ids.*.displayName` Display name of the source type
|
||||||
* @return {String} `ids.*.type` Type. Value is one of the following: "input", "filter", "transition" or "other"
|
* @return {String} `ids.*.type` Type. Value is one of the following: "input", "filter", "transition" or "other"
|
||||||
@ -1119,7 +1133,7 @@ void WSRequestHandler::HandleDuplicateSceneItem(WSRequestHandler* req) {
|
|||||||
*
|
*
|
||||||
* @param {String} `sourceName` Source name
|
* @param {String} `sourceName` Source name
|
||||||
*
|
*
|
||||||
* @return {Array of Objects} `filters` List of filters for the specified source
|
* @return {Array<Object>} `filters` List of filters for the specified source
|
||||||
* @return {String} `filters.*.type` Filter type
|
* @return {String} `filters.*.type` Filter type
|
||||||
* @return {String} `filters.*.name` Filter name
|
* @return {String} `filters.*.name` Filter name
|
||||||
* @return {Object} `filters.*.settings` Filter settings
|
* @return {Object} `filters.*.settings` Filter settings
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* Will return an `error` if Studio Mode is not enabled.
|
* Will return an `error` if Studio Mode is not enabled.
|
||||||
*
|
*
|
||||||
* @return {String} `name` The name of the active preview scene.
|
* @return {String} `name` The name of the active preview scene.
|
||||||
* @return {Source|Array} `sources`
|
* @return {Array<Source>} `sources`
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name GetPreviewScene
|
* @name GetPreviewScene
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
* List of all transitions available in the frontend's dropdown menu.
|
* List of all transitions available in the frontend's dropdown menu.
|
||||||
*
|
*
|
||||||
* @return {String} `current-transition` Name of the currently active transition.
|
* @return {String} `current-transition` Name of the currently active transition.
|
||||||
* @return {Object|Array} `transitions` List of transitions.
|
* @return {Array<Object>} `transitions` List of transitions.
|
||||||
* @return {String} `transitions[].name` Name of the transition.
|
* @return {String} `transitions.*.name` Name of the transition.
|
||||||
*
|
*
|
||||||
* @api requests
|
* @api requests
|
||||||
* @name GetTransitionList
|
* @name GetTransitionList
|
||||||
|
Loading…
x
Reference in New Issue
Block a user