@@ -1507,7 +1507,7 @@ void Visualizer::UpdateClientSettings()
1507
1507
{
1508
1508
bool found_match = false ;
1509
1509
1510
- for (unsigned int search_controller_idx = controller_idx; search_controller_idx < controllers .size (); search_controller_idx++)
1510
+ for (unsigned int search_controller_idx = controller_idx; search_controller_idx < controller_settings .size (); search_controller_idx++)
1511
1511
{
1512
1512
/* -----------------------------------------------------*\
1513
1513
| If the client settings at this index matches the |
@@ -1536,6 +1536,15 @@ void Visualizer::UpdateClientSettings()
1536
1536
ControllerSettingsType* new_settings = new ControllerSettingsType ();
1537
1537
1538
1538
new_settings->controller_ptr = controllers[controller_idx];
1539
+ new_settings->enabled = false ;
1540
+
1541
+ for (int mode_idx = 0 ; mode_idx < controllers[controller_idx]->modes .size (); mode_idx++)
1542
+ {
1543
+ if (controllers[controller_idx]->modes [mode_idx].name == " Direct" )
1544
+ {
1545
+ new_settings->enabled = true ;
1546
+ }
1547
+ }
1539
1548
1540
1549
controller_settings.insert (controller_settings.begin () + controller_idx, new_settings);
1541
1550
}
@@ -1693,6 +1702,8 @@ void Visualizer::LEDUpdateThreadFunction()
1693
1702
{
1694
1703
for (unsigned int client_idx = 0 ; client_idx < rgb_clients.size (); client_idx++)
1695
1704
{
1705
+ rgb_clients[client_idx]->ControllerListMutex .lock ();
1706
+
1696
1707
if (client_idx < rgb_client_settings.size ())
1697
1708
{
1698
1709
if (rgb_client_settings[client_idx]->client_ptr == rgb_clients[client_idx])
@@ -1810,6 +1821,8 @@ void Visualizer::LEDUpdateThreadFunction()
1810
1821
}
1811
1822
}
1812
1823
}
1824
+
1825
+ rgb_clients[client_idx]->ControllerListMutex .unlock ();
1813
1826
}
1814
1827
Sleep (delay);
1815
1828
}
0 commit comments