Skip to content

Commit

Permalink
If inputs are enabled, make the default warn if data received and seq…
Browse files Browse the repository at this point in the history
…uence is running. Advanced users can select a different option.
  • Loading branch information
dkulp committed Dec 17, 2023
1 parent 7638be7 commit 2843f28
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/Sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ Sequence::Sequence() :

m_blankBetweenSequences = getSettingInt("blankBetweenSequences");
m_prioritize_sequence_over_bridge = false;
std::string bridgeDataPriority = getSetting("bridgeDataPriority", "Prioritize Bridge");
m_warn_if_bridging = false;
std::string bridgeDataPriority = getSetting("bridgeDataPriority", "Warn If Sequence Running");
if (bridgeDataPriority == "Prioritize Sequence") {
m_prioritize_sequence_over_bridge = true;
} else if (bridgeDataPriority == "Warn If Sequence Running") {
m_prioritize_sequence_over_bridge = true;
m_warn_if_bridging = true;
}
}

Expand Down Expand Up @@ -792,8 +796,13 @@ void Sequence::CloseSequenceFile(void) {
}

void Sequence::SetBridgeData(uint8_t* data, int startChannel, int len, uint64_t expireMS) {
if (m_prioritize_sequence_over_bridge && this->IsSequenceRunning()) {
return;
if (this->IsSequenceRunning()) {
if (m_warn_if_bridging) {
WarningHolder::AddWarningTimeout("Received bridging data while sequence is running.", 60);
}
if (m_prioritize_sequence_over_bridge) {
return;
}
}

if (!m_bridgeData) {
Expand Down
1 change: 1 addition & 0 deletions src/Sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Sequence {
void ProcessVariableHeaders();
void SetLastFrameData(FSEQFile::FrameData* data);
bool m_prioritize_sequence_over_bridge;
bool m_warn_if_bridging = false;

class BridgeRangeData {
public:
Expand Down
3 changes: 2 additions & 1 deletion www/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,9 @@
"restart": 1,
"reloadUI": 0,
"type": "select",
"default": "Prioritize Bridge",
"default": "Warn If Sequence Running",
"options": {
"Warn If Sequence Running": "Warn If Sequence Running",
"Prioritize Bridge": "Prioritize Bridge",
"Prioritize Sequence": "Prioritize Sequence"
}
Expand Down

3 comments on commit 2843f28

@derwin12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a setting in preferences then?

@ghormann
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a setting in preferences then?

@derwin12 Yes. On the Input/Output tab.

@derwin12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See it..
image

Please sign in to comment.