Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate in dock that a source wasn't selected #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/ui/CaptionDock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ void CaptionDock::handle_source_capture_status_change(shared_ptr<SourceCaptioner
status_text);

this->statusTextLabel->setText(QString::fromStdString(status_text));
if (status->settings.scene_collection_settings.caption_source_settings.caption_source_name.empty()) {
this->captionLinesPlainTextEdit->setStyleSheet("background-color: salmon; font-weight: bold;");
this->captionLinesPlainTextEdit->setPlainText("No source selected! Nothing to caption.");
} else {
this->captionLinesPlainTextEdit->setStyleSheet("background-color: white; font-weight: normal;");
this->captionLinesPlainTextEdit->clear();
}
}

void CaptionDock::handle_caption_data_cb(
Expand Down
10 changes: 7 additions & 3 deletions src/ui/uiutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ static bool captioning_status_string(
if (!enabled) {
output = "CC Disabled";
} else {
const string source_name = corrected_streaming_audio_output_capture_source_name(
status.settings.scene_collection_settings.caption_source_settings.caption_source_name);

if (status.event_type == SOURCE_CAPTIONER_STATUS_EVENT_STOPPED
|| status.event_type == SOURCE_CAPTIONER_STATUS_EVENT_NEW_SETTINGS_STOPPED) {
if (streaming_output_enabled && recording_output_enabled)
Expand All @@ -148,12 +151,13 @@ static bool captioning_status_string(
output = "Offline";

} else if (status.event_type == SOURCE_CAPTIONER_STATUS_EVENT_STARTED_ERROR) {
output = "Off";
if (source_name.empty())
output = "Source not selected!";
else
output = "Off";
} else if (status.event_type == SOURCE_CAPTIONER_STATUS_EVENT_STARTED_OK
|| status.event_type == SOURCE_CAPTIONER_STATUS_EVENT_AUDIO_CAPTURE_STATUS_CHANGE) {

const string source_name = corrected_streaming_audio_output_capture_source_name(
status.settings.scene_collection_settings.caption_source_settings.caption_source_name);
const string mute_source_name = status.settings.scene_collection_settings.caption_source_settings.active_mute_source_name();

const string source_name_use = "(" + source_name + ")";
Expand Down
Loading