From 99aa6be8878ecbbacb1fd50402356c312ade1770 Mon Sep 17 00:00:00 2001 From: Palakis Date: Fri, 17 Feb 2017 17:01:25 +0100 Subject: [PATCH] Updated PROTOCOL.md and fixed some types --- PROTOCOL.md | 31 +++++++++++++++++++++++++++++++ Utils.cpp | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index 94b18252..e3f81d7a 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -139,6 +139,8 @@ Objects in the "sources" array have the following fields : - **"volume"** (double) : audio volume of the source, ranging from 0.0 to 1.0 - **"x"** (double) : X coordinate of the top-left corner of the item in the scene - **"y"** (double) : Y coordinate of the top-left corner of the item in the scene +- **"source_cx"** (integer) : width of the item (without scale applied) +- **"source_cy"** (integer) : height of the item (without scale applied) - **"cx"** (double) : width of the item (with scale applied) - **"cy"** (double) : height of the item (with scale applied) @@ -228,6 +230,8 @@ __Request fields__ : __Response__ : OK if specified source exists, error otherwise. +*Updated for OBS Studio* + #### "GetVolume" Get the volume of a specific source. @@ -239,6 +243,8 @@ __Response__ : OK if source exists, with these additional fields : - **"volume"** (double) : volume of the requested source, on a linear scale (0.0 to 1.0) - **"muted"** (bool) : mute status of the requested source +*Update for OBS Studio* + #### "SetMute" Mutes or unmutes a specific source. @@ -248,6 +254,8 @@ __Request fields__ : __Response__ : OK if specified source exists, error otherwise. +*Updated for OBS Studio* + #### "ToggleMute" Inverts the mute status of a specific source. @@ -256,6 +264,29 @@ __Request fields__ : __Response__ : OK if specified source exists, error otherwise. +*Updated for OBS Studio* + +#### "SetSceneItemPosition" +__Request fields__ : +- **"item"** (string) : The name of the scene item. +- **"x"** (float) : x coordinate +- **"y"** (float) : y coordinate + +__Response__ : OK if specified item exists, error otherwise. + +*New in OBS Studio* + +#### "SetSceneItemTransform" +__Request fields__ : +- **"item"** (string) : The name of the scene item. +- **"x-scale"** (float) : width scale factor +- **"y-scale"** (float) : height scale factor +- **"rotation"** (float) : item rotation (in degrees) + +__Response__ : OK if specified item exists, error otherwise. + +*New in OBS Studio* + ### Authentication A call to `GetAuthRequired` gives the client two elements : - A challenge : a random string that will be used to generate the auth response diff --git a/Utils.cpp b/Utils.cpp index 27eeba17..5fe88142 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -59,8 +59,8 @@ obs_data_t* Utils::GetSceneItemData(obs_sceneitem_t *item) { obs_data_set_double(data, "volume", obs_source_get_volume(obs_sceneitem_get_source(item))); obs_data_set_double(data, "x", pos.x); obs_data_set_double(data, "y", pos.y); - obs_data_set_double(data, "source_cx", item_width); - obs_data_set_double(data, "source_cy", item_height); + obs_data_set_int(data, "source_cx", item_width); + obs_data_set_int(data, "source_cy", item_height); obs_data_set_double(data, "cx", item_width * scale.x); obs_data_set_double(data, "cy", item_height * scale.y); obs_data_set_bool(data, "render", obs_sceneitem_visible(item));