Skip to content

Commit 78e3c93

Browse files
committed
Update SyncStatus handling in Synchronizer
1 parent 4b9adfc commit 78e3c93

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

Source/Processors/Parameter/ParameterEditor.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -849,24 +849,15 @@ void SyncControlButton::paintButton (Graphics& g, bool isMouseOver, bool isButto
849849
{
850850
case SyncStatus::OFF:
851851
{
852-
Colour offColour;
853-
854-
// If the stream generates timestamps, use a transparent blue colour
855-
if (node->synchronizer.streamGeneratesTimestamps (streamKey))
856-
offColour = Colour (30, 112, 255).withAlpha (0.4f);
857-
else
858-
// If the stream does not generate timestamps, use the default fill colour
859-
offColour = findColour (ThemeColours::defaultFill);
860-
861852
if (isMouseOver)
862853
{
863854
//LIGHT GREY
864-
g.setColour (offColour.contrasting (0.2f));
855+
g.setColour (findColour (ThemeColours::defaultFill).contrasting (0.2f));
865856
}
866857
else
867858
{
868859
//DARK GREY
869-
g.setColour (offColour);
860+
g.setColour (findColour (ThemeColours::defaultFill));
870861
}
871862
break;
872863
}
@@ -900,15 +891,21 @@ void SyncControlButton::paintButton (Graphics& g, bool isMouseOver, bool isButto
900891
}
901892
case SyncStatus::HARDWARE_SYNCED:
902893
{
894+
Colour hwSyncColour = Colour (30, 112, 255);
895+
896+
// If the acquisition is not running, use a muted colour
897+
if (! CoreServices::getAcquisitionStatus())
898+
hwSyncColour = hwSyncColour.withAlpha (0.4f);
899+
903900
if (isMouseOver)
904901
{
905902
// SPECIAL BLUE - slightly contrasting
906-
g.setColour (Colour (30, 112, 255).contrasting (0.1f));
903+
g.setColour (hwSyncColour.contrasting (0.1f));
907904
}
908905
else
909906
{
910907
// SPECIAL BLUE
911-
g.setColour (Colour (30, 112, 255));
908+
g.setColour (hwSyncColour);
912909
}
913910
break;
914911
}

Source/Processors/Synchronizer/Synchronizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,12 @@ bool Synchronizer::streamGeneratesTimestamps (String streamKey)
530530

531531
SyncStatus Synchronizer::getStatus (String streamKey)
532532
{
533-
if (! streamKey.length() || ! acquisitionIsActive)
534-
return SyncStatus::OFF;
535-
536533
if (streamGeneratesTimestamps (streamKey))
537534
return SyncStatus::HARDWARE_SYNCED;
538535

536+
if (! streamKey.length() || ! acquisitionIsActive)
537+
return SyncStatus::OFF;
538+
539539
if (isStreamSynced (streamKey))
540540
return SyncStatus::SYNCED;
541541
else

0 commit comments

Comments
 (0)