Merge pull request #1974 from DDRBoxman/state
decklink-ui: Show the state of outputs in the decklink dialog
This commit is contained in:
commit
fc54a3b708
@ -122,6 +122,19 @@ void DecklinkOutputUI::PropertiesChanged()
|
|||||||
SaveSettings();
|
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()
|
void DecklinkOutputUI::StartPreviewOutput()
|
||||||
{
|
{
|
||||||
SavePreviewSettings();
|
SavePreviewSettings();
|
||||||
@ -136,4 +149,17 @@ void DecklinkOutputUI::StopPreviewOutput()
|
|||||||
void DecklinkOutputUI::PreviewPropertiesChanged()
|
void DecklinkOutputUI::PreviewPropertiesChanged()
|
||||||
{
|
{
|
||||||
SavePreviewSettings();
|
SavePreviewSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
@ -16,10 +16,14 @@ public slots:
|
|||||||
void StopOutput();
|
void StopOutput();
|
||||||
void PropertiesChanged();
|
void PropertiesChanged();
|
||||||
|
|
||||||
|
void OutputStateChanged(bool);
|
||||||
|
|
||||||
void StartPreviewOutput();
|
void StartPreviewOutput();
|
||||||
void StopPreviewOutput();
|
void StopPreviewOutput();
|
||||||
void PreviewPropertiesChanged();
|
void PreviewPropertiesChanged();
|
||||||
|
|
||||||
|
void PreviewOutputStateChanged(bool);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::unique_ptr<Ui_Output> ui;
|
std::unique_ptr<Ui_Output> ui;
|
||||||
DecklinkOutputUI(QWidget *parent);
|
DecklinkOutputUI(QWidget *parent);
|
||||||
|
@ -65,6 +65,8 @@ void output_start()
|
|||||||
obs_data_release(settings);
|
obs_data_release(settings);
|
||||||
|
|
||||||
main_output_running = true;
|
main_output_running = true;
|
||||||
|
|
||||||
|
doUI->OutputStateChanged(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,6 +77,7 @@ void output_stop()
|
|||||||
obs_output_stop(output);
|
obs_output_stop(output);
|
||||||
obs_output_release(output);
|
obs_output_release(output);
|
||||||
main_output_running = false;
|
main_output_running = false;
|
||||||
|
doUI->OutputStateChanged(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +156,7 @@ void preview_output_start()
|
|||||||
obs_output_start(context.output);
|
obs_output_start(context.output);
|
||||||
|
|
||||||
preview_output_running = true;
|
preview_output_running = true;
|
||||||
|
doUI->PreviewOutputStateChanged(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,6 +182,7 @@ void preview_output_stop()
|
|||||||
video_output_close(context.video_queue);
|
video_output_close(context.video_queue);
|
||||||
|
|
||||||
preview_output_running = false;
|
preview_output_running = false;
|
||||||
|
doUI->PreviewOutputStateChanged(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>-1</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
@ -57,6 +57,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="outputStatus">
|
||||||
|
<property name="text">
|
||||||
|
<string>OutputState.Idle</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="startOutput">
|
<widget class="QPushButton" name="startOutput">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -98,6 +105,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="previewOutputStatus">
|
||||||
|
<property name="text">
|
||||||
|
<string>OutputState.Idle</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="startPreviewOutput">
|
<widget class="QPushButton" name="startPreviewOutput">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user