4 Star 8 Fork 6

Gitee 极速下载/OpenRGB

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://gitlab.com/CalcProgrammer1/OpenRGB.git
克隆/下载
ProfileManager.h 3.26 KB
一键复制 编辑 原始数据 按行查看 历史
/*---------------------------------------------------------*\
| ProfileManager.h |
| |
| OpenRGB profile manager |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-only |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "filesystem.h"
class ProfileManagerInterface
{
public:
virtual bool SaveProfile
(
std::string profile_name,
bool sizes = false
) = 0;
virtual bool LoadProfile(std::string profile_name) = 0;
virtual bool LoadSizeFromProfile(std::string profile_name) = 0;
virtual void DeleteProfile(std::string profile_name) = 0;
virtual unsigned char * GetProfileListDescription() = 0;
std::vector<std::string> profile_list;
virtual bool LoadDeviceFromListWithOptions
(
std::vector<RGBController*>& temp_controllers,
std::vector<bool>& temp_controller_used,
RGBController* load_controller,
bool load_size,
bool load_settings
) = 0;
virtual std::vector<RGBController*> LoadProfileToList
(
std::string profile_name,
bool sizes = false
) = 0;
virtual void SetConfigurationDirectory(const filesystem::path& directory) = 0;
protected:
virtual ~ProfileManagerInterface() {};
};
class ProfileManager: public ProfileManagerInterface
{
public:
ProfileManager(const filesystem::path& config_dir);
~ProfileManager();
bool SaveProfile
(
std::string profile_name,
bool sizes = false
);
bool LoadProfile(std::string profile_name);
bool LoadSizeFromProfile(std::string profile_name);
void DeleteProfile(std::string profile_name);
unsigned char * GetProfileListDescription();
std::vector<std::string> profile_list;
bool LoadDeviceFromListWithOptions
(
std::vector<RGBController*>& temp_controllers,
std::vector<bool>& temp_controller_used,
RGBController* load_controller,
bool load_size,
bool load_settings
);
std::vector<RGBController*> LoadProfileToList
(
std::string profile_name,
bool sizes = false
);
void SetConfigurationDirectory(const filesystem::path& directory);
private:
filesystem::path configuration_directory;
void UpdateProfileList();
bool LoadProfileWithOptions
(
std::string profile_name,
bool load_size,
bool load_settings
);
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mirrors/OpenRGB.git
git@gitee.com:mirrors/OpenRGB.git
mirrors
OpenRGB
OpenRGB
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385