diff --git a/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.cpp b/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.cpp index 68ec333bd..74cc71f49 100644 --- a/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.cpp +++ b/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.cpp @@ -122,6 +122,19 @@ void DecklinkOutputUI::PropertiesChanged() SaveSettings(); } +void DecklinkOutputUI::OutputStateChanged(bool active) +{ + QString text; + if (active) { + text = QString(obs_module_text("OutputState.Active")); + } else { + text = QString(obs_module_text("OutputState.Idle")); + } + + QMetaObject::invokeMethod(ui->outputStatus, "setText", + Q_ARG(QString, text)); +} + void DecklinkOutputUI::StartPreviewOutput() { SavePreviewSettings(); @@ -136,4 +149,17 @@ void DecklinkOutputUI::StopPreviewOutput() void DecklinkOutputUI::PreviewPropertiesChanged() { SavePreviewSettings(); -} \ No newline at end of file +} + +void DecklinkOutputUI::PreviewOutputStateChanged(bool active) +{ + QString text; + if (active) { + text = QString(obs_module_text("OutputState.Active")); + } else { + text = QString(obs_module_text("OutputState.Idle")); + } + + QMetaObject::invokeMethod(ui->previewOutputStatus, "setText", + Q_ARG(QString, text)); +} diff --git a/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.h b/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.h index c8942e0f3..f0a7133ac 100644 --- a/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.h +++ b/UI/frontend-plugins/decklink-output-ui/DecklinkOutputUI.h @@ -16,10 +16,14 @@ public slots: void StopOutput(); void PropertiesChanged(); + void OutputStateChanged(bool); + void StartPreviewOutput(); void StopPreviewOutput(); void PreviewPropertiesChanged(); + void PreviewOutputStateChanged(bool); + public: std::unique_ptr ui; DecklinkOutputUI(QWidget *parent); diff --git a/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp b/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp index f9f89b5f7..3b85d72c9 100644 --- a/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp +++ b/UI/frontend-plugins/decklink-output-ui/decklink-ui-main.cpp @@ -65,6 +65,8 @@ void output_start() obs_data_release(settings); main_output_running = true; + + doUI->OutputStateChanged(true); } } } @@ -75,6 +77,7 @@ void output_stop() obs_output_stop(output); obs_output_release(output); main_output_running = false; + doUI->OutputStateChanged(false); } } @@ -153,6 +156,7 @@ void preview_output_start() obs_output_start(context.output); preview_output_running = true; + doUI->PreviewOutputStateChanged(true); } } } @@ -178,6 +182,7 @@ void preview_output_stop() video_output_close(context.video_queue); preview_output_running = false; + doUI->PreviewOutputStateChanged(false); } } diff --git a/UI/frontend-plugins/decklink-output-ui/forms/output.ui b/UI/frontend-plugins/decklink-output-ui/forms/output.ui index db8de92e8..0b6048c9b 100644 --- a/UI/frontend-plugins/decklink-output-ui/forms/output.ui +++ b/UI/frontend-plugins/decklink-output-ui/forms/output.ui @@ -42,7 +42,7 @@ - -1 + 6 @@ -57,6 +57,13 @@ + + + + OutputState.Idle + + + @@ -98,6 +105,13 @@ + + + + OutputState.Idle + + +