From ebfb50d70aff9cb31c793c079468f4529a3e011e Mon Sep 17 00:00:00 2001 From: Exeldro Date: Mon, 15 Jul 2024 13:58:18 +0200 Subject: [PATCH] Fix duplicating vertical outputs --- multistream.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/multistream.cpp b/multistream.cpp index 9150d4c..0711639 100644 --- a/multistream.cpp +++ b/multistream.cpp @@ -384,10 +384,21 @@ void MultistreamDock::LoadSettings() void MultistreamDock::LoadOutput(obs_data_t *data, bool vertical) { auto name = QString::fromUtf8(obs_data_get_string(data, "name")); - for (int i = 1; i < mainCanvasLayout->count(); i++) { - auto item = mainCanvasLayout->itemAt(i); - if (item->widget()->objectName() == name) { - return; + if (vertical) { + for (int i = 1; i < verticalCanvasLayout->count(); i++) { + auto item = verticalCanvasLayout->itemAt(i); + auto oName = item->widget()->objectName(); + if (oName == name) { + return; + } + } + } else { + for (int i = 1; i < mainCanvasLayout->count(); i++) { + auto item = mainCanvasLayout->itemAt(i); + auto oName = item->widget()->objectName(); + if (oName == name) { + return; + } } } auto streamGroup = new QGroupBox; @@ -683,8 +694,8 @@ bool MultistreamDock::StartOutput(obs_data_t *settings, QPushButton *streamButto } signal_handler_t *signal = obs_output_get_signal_handler(output); - //signal_handler_disconnect(signal, "start", stream_output_start, streamButton); - //signal_handler_disconnect(signal, "stop", stream_output_stop, streamButton); + signal_handler_disconnect(signal, "start", stream_output_start, streamButton); + signal_handler_disconnect(signal, "stop", stream_output_stop, streamButton); signal_handler_connect(signal, "start", stream_output_start, streamButton); signal_handler_connect(signal, "stop", stream_output_stop, streamButton);