Rework Profiles to use JSON format

* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
    * Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
    * Update ProfileManager to store profiles in "profiles" folder in .json format
    * Update ProfileManager to store size profile in sizes.json
    * Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
    * Code cleanup of ProfileManager and profile-related code
This commit is contained in:
Adam Honse
2025-11-09 15:12:11 -06:00
parent bfe5a97f0c
commit f565956495
15 changed files with 1154 additions and 855 deletions

View File

@@ -693,7 +693,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
memcpy(&new_size, data + sizeof(int), sizeof(int));
controllers[header.pkt_dev_idx]->ResizeZone(zone, new_size);
profile_manager->SaveProfile("sizes", true);
profile_manager->SaveSizes();
}
break;
@@ -898,11 +898,6 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
profile_manager->LoadProfile(profile_name);
}
for(RGBController* controller : controllers)
{
controller->UpdateLEDs();
}
break;
case NET_PACKET_ID_REQUEST_DELETE_PROFILE:
@@ -953,7 +948,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
memcpy(&zone, data, sizeof(int));
controllers[header.pkt_dev_idx]->ClearSegments(zone);
profile_manager->SaveProfile("sizes", true);
profile_manager->SaveSizes();
}
break;
@@ -968,7 +963,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
if(header.pkt_dev_idx < controllers.size())
{
controllers[header.pkt_dev_idx]->SetSegmentDescription((unsigned char *)data);
profile_manager->SaveProfile("sizes", true);
profile_manager->SaveSizes();
}
}
}