Merge pull request #428 from Rosuav/add-muted-flag

Add a 'muted' flag to GetSceneItems
This commit is contained in:
Stéphane Lepin 2020-03-11 14:06:12 +01:00 committed by GitHub
commit e78f26e9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 0 deletions

View File

@ -6,9 +6,11 @@
"property": [
"{Number} `cy`",
"{Number} `cx`",
"{Number} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.",
"{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} `muted` Whether or not this Scene Item is muted.",
"{Boolean} `locked` Whether or not this Scene Item is locked and can't be moved around",
"{Number} `source_cx`",
"{Number} `source_cy`",
@ -30,6 +32,11 @@
"name": "cx",
"description": ""
},
{
"type": "Number",
"name": "alignment",
"description": "The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis."
},
{
"type": "String",
"name": "name",
@ -45,6 +52,11 @@
"name": "render",
"description": "Whether or not this Scene Item is set to \"visible\"."
},
{
"type": "Boolean",
"name": "muted",
"description": "Whether or not this Scene Item is muted."
},
{
"type": "Boolean",
"name": "locked",
@ -4253,6 +4265,7 @@
"{int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.",
"{int} `crop.left` The number of pixels cropped off the left of the source before scaling.",
"{bool} `visible` If the source is visible.",
"{bool} `muted` If the source is muted.",
"{bool} `locked` If the source's transform is locked.",
"{String} `bounds.type` Type of bounding box. Can be \"OBS_BOUNDS_STRETCH\", \"OBS_BOUNDS_SCALE_INNER\", \"OBS_BOUNDS_SCALE_OUTER\", \"OBS_BOUNDS_SCALE_TO_WIDTH\", \"OBS_BOUNDS_SCALE_TO_HEIGHT\", \"OBS_BOUNDS_MAX_ONLY\" or \"OBS_BOUNDS_NONE\".",
"{int} `bounds.alignment` Alignment of the bounding box.",
@ -4331,6 +4344,11 @@
"name": "visible",
"description": "If the source is visible."
},
{
"type": "bool",
"name": "muted",
"description": "If the source is muted."
},
{
"type": "bool",
"name": "locked",

View File

@ -224,9 +224,11 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen
| ---- | :---: | ------------|
| `cy` | _Number_ | |
| `cx` | _Number_ | |
| `alignment` | _Number_ | The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis. |
| `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". |
| `muted` | _Boolean_ | Whether or not this Scene Item is muted. |
| `locked` | _Boolean_ | Whether or not this Scene Item is locked and can't be moved around |
| `source_cx` | _Number_ | |
| `source_cy` | _Number_ | |
@ -1835,6 +1837,7 @@ Coordinates are relative to the item's parent (the scene or group it belongs to)
| `crop.bottom` | _int_ | The number of pixels cropped off the bottom of the source before scaling. |
| `crop.left` | _int_ | The number of pixels cropped off the left of the source before scaling. |
| `visible` | _bool_ | If the source is visible. |
| `muted` | _bool_ | If the source is muted. |
| `locked` | _bool_ | If the source's transform is locked. |
| `bounds.type` | _String_ | Type of bounding box. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE". |
| `bounds.alignment` | _int_ | Alignment of the bounding box. |

View File

@ -104,9 +104,11 @@ obs_data_array_t* Utils::GetSceneItems(obs_source_t* source) {
* @typedef {Object} `SceneItem` An OBS Scene Item.
* @property {Number} `cy`
* @property {Number} `cx`
* @property {Number} `alignment` The point on the source that the item is manipulated from. The sum of 1=Left or 2=Right, and 4=Top or 8=Bottom, or omit to center on that axis.
* @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} `muted` Whether or not this Scene Item is muted.
* @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`
@ -146,6 +148,7 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) {
obs_data_set_double(data, "y", pos.y);
obs_data_set_int(data, "source_cx", (int)item_width);
obs_data_set_int(data, "source_cy", (int)item_height);
obs_data_set_bool(data, "muted", obs_source_muted(itemSource));
obs_data_set_int(data, "alignment", (int)obs_sceneitem_get_alignment(item));
obs_data_set_double(data, "cx", item_width * scale.x);
obs_data_set_double(data, "cy", item_height * scale.y);

View File

@ -21,6 +21,7 @@
* @return {int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.
* @return {int} `crop.left` The number of pixels cropped off the left of the source before scaling.
* @return {bool} `visible` If the source is visible.
* @return {bool} `muted` If the source is muted.
* @return {bool} `locked` If the source's transform is locked.
* @return {String} `bounds.type` Type of bounding box. Can be "OBS_BOUNDS_STRETCH", "OBS_BOUNDS_SCALE_INNER", "OBS_BOUNDS_SCALE_OUTER", "OBS_BOUNDS_SCALE_TO_WIDTH", "OBS_BOUNDS_SCALE_TO_HEIGHT", "OBS_BOUNDS_MAX_ONLY" or "OBS_BOUNDS_NONE".
* @return {int} `bounds.alignment` Alignment of the bounding box.