requests: add "id" to scene item data and fix docs

This commit is contained in:
Stéphane L 2019-04-22 19:45:32 +02:00
parent 89fe6d57c9
commit ea28d217e0
3 changed files with 21 additions and 17 deletions

View File

@ -115,11 +115,13 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t* item) {
obs_data_t* data = obs_data_create();
obs_data_set_string(data, "name",
obs_source_get_name(obs_sceneitem_get_source(item)));
obs_source_get_name(itemSource));
obs_data_set_int(data, "id",
obs_sceneitem_get_id(item));
obs_data_set_string(data, "type",
obs_source_get_id(obs_sceneitem_get_source(item)));
obs_source_get_id(itemSource));
obs_data_set_double(data, "volume",
obs_source_get_volume(obs_sceneitem_get_source(item)));
obs_source_get_volume(itemSource));
obs_data_set_double(data, "x", pos.x);
obs_data_set_double(data, "y", pos.y);
obs_data_set_int(data, "source_cx", (int)item_width);

View File

@ -2,6 +2,22 @@
#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.
*

View File

@ -2,20 +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 {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
*