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 1403f91b3a
commit 29285a2f1e
17 changed files with 1201 additions and 865 deletions

View File

@@ -704,7 +704,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;
@@ -909,11 +909,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:
@@ -964,7 +959,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;
@@ -979,7 +974,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();
}
}
}