| 237 | \******************************************************************************************/ |
| 238 | |
| 239 | int main(int argc, char* argv[]) |
| 240 | { |
| 241 | #ifdef _WIN32 |
| 242 | /*---------------------------------------------------------*\ |
| 243 | | Windows only - Attach console output | |
| 244 | \*---------------------------------------------------------*/ |
| 245 | if (AttachConsole(ATTACH_PARENT_PROCESS)) |
| 246 | { |
| 247 | /*---------------------------------------------------------*\ |
| 248 | | We are running under some terminal context; otherwise | |
| 249 | | leave the GUI and CRT alone | |
| 250 | \*---------------------------------------------------------*/ |
| 251 | freopen("CONIN$", "r", stdin); |
| 252 | freopen("CONOUT$", "w", stdout); |
| 253 | freopen("CONOUT$", "w", stderr); |
| 254 | } |
| 255 | |
| 256 | /*---------------------------------------------------------*\ |
| 257 | | Windows only - Start timer resolution correction thread | |
| 258 | \*---------------------------------------------------------*/ |
| 259 | std::thread * InitializeTimerResolutionThread; |
| 260 | InitializeTimerResolutionThread = new std::thread(InitializeTimerResolutionThreadFunction); |
| 261 | InitializeTimerResolutionThread->detach(); |
| 262 | |
| 263 | /*---------------------------------------------------------*\ |
| 264 | | Windows only - Install SMBus Driver WinRing0 | |
| 265 | \*---------------------------------------------------------*/ |
| 266 | InstallWinRing0(); |
| 267 | #endif |
| 268 | |
| 269 | /*---------------------------------------------------------*\ |
| 270 | | Mac x86/x64 only - Install SMBus Driver macUSPCIO | |
| 271 | \*---------------------------------------------------------*/ |
| 272 | #ifdef _MACOSX_X86_X64 |
| 273 | InitMacUSPCIODriver(); |
| 274 | #endif |
| 275 | |
| 276 | /*---------------------------------------------------------*\ |
| 277 | | Process command line arguments before detection | |
| 278 | \*---------------------------------------------------------*/ |
| 279 | unsigned int ret_flags = cli_pre_detection(argc, argv); |
| 280 | |
| 281 | /*---------------------------------------------------------*\ |
| 282 | | Perform local connection and/or hardware detection if not | |
| 283 | | disabled from CLI | |
| 284 | \*---------------------------------------------------------*/ |
| 285 | if(!(ret_flags & RET_FLAG_NO_AUTO_CONNECT)) |
| 286 | { |
| 287 | printf("Attempting to connect to local OpenRGB server.\r\n"); |
| 288 | |
| 289 | if(!AttemptLocalConnection()) |
| 290 | { |
| 291 | printf("Local OpenRGB server unavailable.\r\n"); |
| 292 | } |
| 293 | else |
| 294 | { |
| 295 | printf("Local OpenRGB server connected, running in client mode\r\n"); |
| 296 |
nothing calls this directly
no test coverage detected