mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-26 16:58:21 -04:00
Add new CLI option, separate auto-detect and auto-connect
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -37,6 +37,7 @@ enum
|
||||
RET_FLAG_NO_DETECT = 16,
|
||||
RET_FLAG_CLI_POST_DETECTION = 32,
|
||||
RET_FLAG_START_SERVER = 64,
|
||||
RET_FLAG_NO_AUTO_CONNECT = 128,
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
@@ -173,15 +174,13 @@ int main(int argc, char* argv[])
|
||||
| Perform local connection and/or hardware detection if not |
|
||||
| disabled from CLI |
|
||||
\*---------------------------------------------------------*/
|
||||
if(!(ret_flags & RET_FLAG_NO_DETECT))
|
||||
if(!(ret_flags & RET_FLAG_NO_AUTO_CONNECT))
|
||||
{
|
||||
printf("Attempting to connect to local OpenRGB server.\r\n");
|
||||
|
||||
if(!AttemptLocalConnection())
|
||||
{
|
||||
printf("Local OpenRGB server unavailable, running standalone.\r\n");
|
||||
|
||||
ResourceManager::get()->DetectDevices();
|
||||
printf("Local OpenRGB server unavailable.\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -191,6 +190,15 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Perform hardware detection if not disabled from CLI |
|
||||
\*---------------------------------------------------------*/
|
||||
if(!(ret_flags & RET_FLAG_NO_DETECT))
|
||||
{
|
||||
printf("Running standalone.\r\n");
|
||||
ResourceManager::get()->DetectDevices();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Start the server if requested from CLI (this must be done |
|
||||
| after attempting local connection!) |
|
||||
|
||||
Reference in New Issue
Block a user