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

@@ -12,6 +12,7 @@
#pragma once
#include <string>
#include "nlohmann/json.hpp"
class PluginManagerInterface
{
@@ -25,5 +26,8 @@ public:
virtual void LoadPlugins() = 0;
virtual void UnloadPlugins() = 0;
virtual void OnProfileAboutToLoad() = 0;
virtual void OnProfileLoad(nlohmann::json profile_data) = 0;
virtual nlohmann::json OnProfileSave() = 0;
virtual unsigned char * OnSDKCommand(unsigned int plugin_idx, unsigned int pkt_id, unsigned char * pkt_data, unsigned int * pkt_size) = 0;
};