MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / ResourceManager

Method ResourceManager

ResourceManager.cpp:54–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54ResourceManager::ResourceManager()
55{
56 /*-------------------------------------------------------------------------*\
57 | Initialize Detection Variables |
58 \*-------------------------------------------------------------------------*/
59 detection_enabled = true;
60 detection_percent = 100;
61 detection_string = "";
62 detection_is_required = false;
63 DetectDevicesThread = nullptr;
64 dynamic_detectors_processed = false;
65
66 SetupConfigurationDirectory();
67
68 /*-------------------------------------------------------------------------*\
69 | Load settings from file |
70 \*-------------------------------------------------------------------------*/
71 settings_manager = new SettingsManager();
72
73 settings_manager->LoadSettings(GetConfigurationDirectory() / "OpenRGB.json");
74
75 /*-------------------------------------------------------------------------*\
76 | Configure the log manager |
77 \*-------------------------------------------------------------------------*/
78 LogManager::get()->configure(settings_manager->GetSettings("LogManager"), GetConfigurationDirectory());
79
80 /*-------------------------------------------------------------------------*\
81 | Initialize Server Instance |
82 | If configured, pass through full controller list including clients |
83 | Otherwise, pass only local hardware controllers |
84 \*-------------------------------------------------------------------------*/
85 json server_settings = settings_manager->GetSettings("Server");
86 bool all_controllers = false;
87
88 if(server_settings.contains("all_controllers"))
89 {
90 all_controllers = server_settings["all_controllers"];
91 }
92
93 if(all_controllers)
94 {
95 server = new NetworkServer(rgb_controllers);
96 }
97 else
98 {
99 server = new NetworkServer(rgb_controllers_hw);
100 }
101
102 /*-------------------------------------------------------------------------*\
103 | Initialize Saved Client Connections |
104 \*-------------------------------------------------------------------------*/
105 json client_settings = settings_manager->GetSettings("Client");
106
107 if(client_settings.contains("clients"))
108 {
109 for(unsigned int client_idx = 0; client_idx < client_settings["clients"].size(); client_idx++)
110 {
111 NetworkClient * client = new NetworkClient(rgb_controllers);

Callers

nothing calls this directly

Calls 15

LoadSettingsMethod · 0.80
configureMethod · 0.80
GetSettingsMethod · 0.80
containsMethod · 0.80
SetIPMethod · 0.80
StartClientMethod · 0.80
GetConnectedMethod · 0.80
SetProfileManagerMethod · 0.80
LoadProfileToListMethod · 0.80
getFunction · 0.50
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected