mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-22 05:57:53 -05:00
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:
19
cli.cpp
19
cli.cpp
@@ -865,7 +865,7 @@ bool OptionSize(std::vector<DeviceOptions>* current_devices, std::string argumen
|
||||
/*---------------------------------------------------------*\
|
||||
| Save the profile |
|
||||
\*---------------------------------------------------------*/
|
||||
ResourceManager::get()->GetProfileManager()->SaveProfile("sizes", true);
|
||||
ResourceManager::get()->GetProfileManager()->SaveSizes();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -880,23 +880,6 @@ bool OptionProfile(std::string argument, std::vector<RGBController *>& rgb_contr
|
||||
\*---------------------------------------------------------*/
|
||||
if(ResourceManager::get()->GetProfileManager()->LoadProfile(argument))
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Change device mode if profile loading was successful |
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t controller_idx = 0; controller_idx < rgb_controllers.size(); controller_idx++)
|
||||
{
|
||||
RGBController* device = rgb_controllers[controller_idx];
|
||||
|
||||
device->DeviceUpdateMode();
|
||||
LOG_DEBUG("[CLI] Updating mode for %s to %i", device->GetName().c_str(), device->GetActiveMode());
|
||||
|
||||
if(device->GetModeColorMode(device->GetActiveMode()) == MODE_COLORS_PER_LED)
|
||||
{
|
||||
device->DeviceUpdateLEDs();
|
||||
LOG_DEBUG("[CLI] Mode uses per-LED color, also updating LEDs");
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "Profile loaded successfully" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user