Merge branch '4.x-current' into feature/setsourcename

This commit is contained in:
tt2468
2020-05-26 01:41:11 -07:00
6 changed files with 17 additions and 7 deletions

View File

@ -2198,7 +2198,8 @@
"description": "A source has been renamed.",
"return": [
"{String} `previousName` Previous source name",
"{String} `newName` New source name"
"{String} `newName` New source name",
"{String} `sourceType` Type of source (input, scene, filter, transition)"
],
"api": "events",
"name": "SourceRenamed",
@ -2214,6 +2215,11 @@
"type": "String",
"name": "newName",
"description": "New source name"
},
{
"type": "String",
"name": "sourceType",
"description": "Type of source (input, scene, filter, transition)"
}
],
"names": [

View File

@ -930,6 +930,7 @@ A source has been renamed.
| ---- | :---: | ------------|
| `previousName` | _String_ | Previous source name |
| `newName` | _String_ | New source name |
| `sourceType` | _String_ | Type of source (input, scene, filter, transition) |
---

View File

@ -348,7 +348,7 @@ void WSEvents::hookTransitionPlaybackEvents() {
obs_frontend_source_list transitions = {};
obs_frontend_get_transitions(&transitions);
for (int i = 0; i < transitions.sources.num; i++) {
for (uint i = 0; i < transitions.sources.num; i++) {
obs_source_t* transition = transitions.sources.array[i];
signal_handler_t* sh = obs_source_get_signal_handler(transition);
signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this);
@ -366,7 +366,7 @@ void WSEvents::unhookTransitionPlaybackEvents() {
obs_frontend_source_list transitions = {};
obs_frontend_get_transitions(&transitions);
for (int i = 0; i < transitions.sources.num; i++) {
for (uint i = 0; i < transitions.sources.num; i++) {
obs_source_t* transition = transitions.sources.array[i];
signal_handler_t* sh = obs_source_get_signal_handler(transition);
signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this);
@ -1177,6 +1177,7 @@ void WSEvents::OnSourceAudioMixersChanged(void* param, calldata_t* data) {
*
* @return {String} `previousName` Previous source name
* @return {String} `newName` New source name
* @return {String} `sourceType` Type of source (input, scene, filter, transition)
*
* @api events
* @name SourceRenamed
@ -1201,6 +1202,8 @@ void WSEvents::OnSourceRename(void* param, calldata_t* data) {
OBSDataAutoRelease fields = obs_data_create();
obs_data_set_string(fields, "previousName", previousName);
obs_data_set_string(fields, "newName", newName);
obs_data_set_string(fields, "sourceType",
sourceTypeToString(obs_source_get_type(source))); // TODO: Split into dedicated events for source/scene. Only doing it this way for backwards compatability until 5.0
self->broadcastUpdate("SourceRenamed", fields);
}

View File

@ -121,7 +121,7 @@ RpcResponse WSRequestHandler::ReorderSceneItems(const RpcRequest& request) {
struct obs_sceneitem_order_info info;
size_t itemCount = obs_data_array_count(ctx->items);
for (int i = 0; i < itemCount; i++) {
for (uint i = 0; i < itemCount; i++) {
OBSDataAutoRelease item = obs_data_array_item(ctx->items, i);
OBSSceneItemAutoRelease sceneItem = Utils::GetSceneItemFromItem(scene, item);

View File

@ -1673,7 +1673,7 @@ RpcResponse WSRequestHandler::TakeSourceScreenshot(const RpcRequest& request) {
gs_stage_texture(stagesurface, gs_texrender_get_texture(texrender));
if (gs_stagesurface_map(stagesurface, &videoData, &videoLinesize)) {
int linesize = sourceImage.bytesPerLine();
for (int y = 0; y < imgHeight; y++) {
for (uint y = 0; y < imgHeight; y++) {
memcpy(sourceImage.scanLine(y), videoData + (y * videoLinesize), linesize);
}
gs_stagesurface_unmap(stagesurface);

View File

@ -103,10 +103,10 @@ RpcResponse WSRequestHandler::StartStreaming(const RpcRequest& request) {
&& obs_data_has_user_value(newSettings, "key"))
{
const char* key = obs_data_get_string(newSettings, "key");
int keylen = strlen(key);
size_t keylen = strlen(key);
bool hasQuestionMark = false;
for (int i = 0; i < keylen; i++) {
for (size_t i = 0; i < keylen; i++) {
if (key[i] == '?') {
hasQuestionMark = true;
break;