2013-08-13 20:10:19 +02:00
// stl includes
2014-01-28 00:39:04 +01:00
# include <clocale>
2013-08-11 21:49:11 +02:00
# include <initializer_list>
2016-08-06 08:28:42 +02:00
# include <limits>
2016-10-11 19:51:20 +02:00
# include <iostream>
2017-03-21 17:55:46 +01:00
# include <stdlib.h>
2013-08-11 21:49:11 +02:00
2013-08-13 20:10:19 +02:00
// Qt includes
2013-08-11 11:54:16 +02:00
# include <QCoreApplication>
2014-01-28 22:27:02 +01:00
# include <QLocale>
2013-08-11 11:54:16 +02:00
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
# include <utils/Logger.h>
2021-11-17 21:30:43 +01:00
# include "HyperionConfig.h"
# include <commandline/Parser.h>
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
# ifdef ENABLE_MDNS
// mDNS discover
# include <mdns/MdnsBrowser.h>
# include <mdns/MdnsServiceRegister.h>
# else
2019-08-17 09:44:57 +02:00
// ssdp discover
# include <ssdp/SSDPDiscover.h>
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
# endif
2021-11-17 21:30:43 +01:00
# include <utils/NetUtils.h>
2019-08-17 09:44:57 +02:00
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
// hyperion-remote include
# include "JsonConnection.h"
2020-07-12 18:27:24 +02:00
# include <utils/DefaultSignalHandler.h>
2016-03-10 12:01:10 +01:00
2016-08-28 15:10:43 +02:00
using namespace commandline ;
2013-08-11 11:54:16 +02:00
2013-08-13 20:10:19 +02:00
/// Count the number of true values in a list of booleans
2013-08-11 21:49:11 +02:00
int count ( std : : initializer_list < bool > values )
{
2013-08-13 20:10:19 +02:00
int count = 0 ;
for ( bool value : values ) {
if ( value )
2020-11-14 17:58:56 +01:00
{
2013-08-13 20:10:19 +02:00
count + + ;
2020-11-14 17:58:56 +01:00
}
2013-08-13 20:10:19 +02:00
}
return count ;
2013-08-11 21:49:11 +02:00
}
2016-08-28 15:10:43 +02:00
void showHelp ( Option & option ) {
QString shortOption ;
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
QString longOption = QString ( " --%1 " ) . arg ( option . names ( ) . constLast ( ) ) ;
2016-08-28 15:10:43 +02:00
if ( option . names ( ) . size ( ) = = 2 ) {
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
shortOption = QString ( " -%1 " ) . arg ( option . names ( ) . constFirst ( ) ) ;
2016-08-28 15:10:43 +02:00
}
qWarning ( ) < < qPrintable ( QString ( " \t %1 \t %2 \t %3 " ) . arg ( shortOption , longOption , option . description ( ) ) ) ;
}
2020-11-14 17:58:56 +01:00
int getInstaneIdbyName ( const QJsonObject & reply , const QString & name ) {
2019-08-13 23:22:06 +02:00
if ( reply . contains ( " instance " ) ) {
2023-10-01 21:56:53 +02:00
const QJsonArray list = reply . value ( " instance " ) . toArray ( ) ;
2019-08-13 23:22:06 +02:00
2023-10-01 21:56:53 +02:00
for ( const auto & entry : list ) {
2019-08-13 23:22:06 +02:00
const QJsonObject obj = entry . toObject ( ) ;
if ( obj [ " friendly_name " ] = = name & & obj [ " running " ] . toBool ( ) )
2020-11-14 17:58:56 +01:00
{
2019-08-13 23:22:06 +02:00
return obj [ " instance " ] . toInt ( ) ;
2020-11-14 17:58:56 +01:00
}
2019-08-13 23:22:06 +02:00
}
}
std : : cout < < " Can't find a running instance with name ' " < < name . toStdString ( ) < < " ' at this Hyperion server, will use first instance " < < std : : endl ;
return 0 ;
}
2013-08-13 19:31:56 +02:00
int main ( int argc , char * argv [ ] )
2013-08-11 11:54:16 +02:00
{
2021-11-17 21:30:43 +01:00
Logger * log = Logger : : getInstance ( " REMOTE " ) ;
Logger : : setLogLevel ( Logger : : INFO ) ;
2016-03-10 12:01:10 +01:00
std : : cout
< < " hyperion-remote: " < < std : : endl
2016-06-24 23:22:31 +02:00
< < " \t Version : " < < HYPERION_VERSION < < " ( " < < HYPERION_BUILD_ID < < " ) " < < std : : endl
2016-03-10 12:01:10 +01:00
< < " \t build time: " < < __DATE__ < < " " < < __TIME__ < < std : : endl ;
2020-07-12 18:27:24 +02:00
DefaultSignalHandler : : install ( ) ;
2013-08-13 20:10:19 +02:00
QCoreApplication app ( argc , argv ) ;
2014-01-28 22:27:02 +01:00
// force the locale
setlocale ( LC_ALL , " C " ) ;
QLocale : : setDefault ( QLocale : : c ( ) ) ;
2013-08-13 20:10:19 +02:00
try
{
// create the option parser and initialize all parameters
2020-11-14 17:58:56 +01:00
Parser parser ( " Application to send a command to hyperion using the JSON interface " ) ;
2013-08-13 20:10:19 +02:00
2019-07-12 16:54:26 +02:00
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// art variable definition append art to Parser short-, long option description, optional default value //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2022-01-07 14:47:51 +01:00
Option & argAddress = parser . add < Option > ( ' a ' , " address " , " The hostname or IP-address (IPv4 or IPv6) of the hyperion server. \n Default port: 19444. \n Sample addresses: \n Host : hyperion.fritz.box \n IPv4 : 127.0.0.1:19444 \n IPv6 : [2001:1:2:3:4:5:6:7] " , " 127.0.0.1 " ) ;
2021-11-17 21:30:43 +01:00
Option & argToken = parser . add < Option > ( ' t ' , " token " , " If authorization tokens are required, this token is used " ) ;
2020-11-14 17:58:56 +01:00
Option & argInstance = parser . add < Option > ( ' I ' , " instance " , " Select a specific target instance by name for your command. By default it uses always the first instance " ) ;
2019-07-12 16:54:26 +02:00
IntOption & argPriority = parser . add < IntOption > ( ' p ' , " priority " , " Used to the provided priority channel (suggested 2-99) [default: %1] " , " 50 " ) ;
2020-11-14 17:58:56 +01:00
IntOption & argDuration = parser . add < IntOption > ( ' d ' , " duration " , " Specify how long the LEDs should be switched on in milliseconds [default: infinity] " ) ;
ColorsOption & argColor = parser . add < ColorsOption > ( ' c ' , " color " , " Set all LEDs to a constant color (either RRGGBB hex getColors or a color name. The color may be repeated multiple time like: RRGGBBRRGGBB) " ) ;
ImageOption & argImage = parser . add < ImageOption > ( ' i ' , " image " , " Set the LEDs to the colors according to the given image file " ) ;
2022-02-11 20:36:15 +01:00
# if defined(ENABLE_EFFECTENGINE)
2019-07-12 16:54:26 +02:00
Option & argEffect = parser . add < Option > ( ' e ' , " effect " , " Enable the effect with the given name " ) ;
Option & argEffectFile = parser . add < Option > ( 0x0 , " effectFile " , " Arguments to use in combination with --createEffect " ) ;
2020-11-14 17:58:56 +01:00
Option & argEffectArgs = parser . add < Option > ( 0x0 , " effectArgs " , " Arguments to use in combination with the specified effect. Should be a JSON object string. " , " " ) ;
Option & argCreateEffect = parser . add < Option > ( 0x0 , " createEffect " , " Write a new JSON Effect configuration file. \n First parameter = Effect name. \n Second parameter = Effect file (--effectFile). \n Last parameter = Effect arguments (--effectArgs.) " , " " ) ;
Option & argDeleteEffect = parser . add < Option > ( 0x0 , " deleteEffect " , " Delete a custom created JSON Effect configuration file. " ) ;
2022-02-11 20:36:15 +01:00
# endif
2019-07-12 16:54:26 +02:00
BooleanOption & argClear = parser . add < BooleanOption > ( ' x ' , " clear " , " Clear data for the priority channel provided by the -p option " ) ;
BooleanOption & argClearAll = parser . add < BooleanOption > ( 0x0 , " clearall " , " Clear data for all active priority channels " ) ;
2023-02-19 09:36:39 +01:00
Option & argEnableComponent = parser . add < Option > ( ' E ' , " enable " , " Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, FORWARDER, BOBLIGHTSERVER, GRABBER, V4L, AUDIO, LEDDEVICE] " ) ;
Option & argDisableComponent = parser . add < Option > ( ' D ' , " disable " , " Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, FORWARDER, BOBLIGHTSERVER, GRABBER, V4L, AUDIO, LEDDEVICE] " ) ;
2019-07-12 16:54:26 +02:00
Option & argId = parser . add < Option > ( ' q ' , " qualifier " , " Identifier(qualifier) of the adjustment to set " ) ;
2020-11-14 17:58:56 +01:00
IntOption & argBrightness = parser . add < IntOption > ( ' L ' , " brightness " , " Set the brightness gain of the LEDs " ) ;
2019-07-12 16:54:26 +02:00
IntOption & argBrightnessC = parser . add < IntOption > ( 0x0 , " brightnessCompensation " , " Set the brightness compensation " ) ;
IntOption & argBacklightThreshold = parser . add < IntOption > ( ' n ' , " backlightThreshold " , " threshold for activating backlight (minimum brightness) " ) ;
IntOption & argBacklightColored = parser . add < IntOption > ( 0x0 , " backlightColored " , " 0 = white backlight; 1 = colored backlight " ) ;
2020-11-14 17:58:56 +01:00
DoubleOption & argGamma = parser . add < DoubleOption > ( ' g ' , " gamma " , " Set the overall gamma of the LEDs " ) ;
2019-07-12 16:54:26 +02:00
ColorOption & argRAdjust = parser . add < ColorOption > ( ' R ' , " redAdjustment " , " Set the adjustment of the red color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argGAdjust = parser . add < ColorOption > ( ' G ' , " greenAdjustment " , " Set the adjustment of the green color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argBAdjust = parser . add < ColorOption > ( ' B ' , " blueAdjustment " , " Set the adjustment of the blue color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argCAdjust = parser . add < ColorOption > ( ' C ' , " cyanAdjustment " , " Set the adjustment of the cyan color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argMAdjust = parser . add < ColorOption > ( ' M ' , " magentaAdjustment " , " Set the adjustment of the magenta color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argYAdjust = parser . add < ColorOption > ( ' Y ' , " yellowAdjustment " , " Set the adjustment of the yellow color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argWAdjust = parser . add < ColorOption > ( ' W ' , " whiteAdjustment " , " Set the adjustment of the white color (requires colors in hex format as RRGGBB) " ) ;
ColorOption & argbAdjust = parser . add < ColorOption > ( ' b ' , " blackAdjustment " , " Set the adjustment of the black color (requires colors in hex format as RRGGBB) " ) ;
2020-11-14 17:58:56 +01:00
Option & argMapping = parser . add < Option > ( ' m ' , " ledMapping " , " Set the method for image to led mapping valid values: multi color_mean, uni-color_mean " ) ;
2019-07-12 16:54:26 +02:00
Option & argVideoMode = parser . add < Option > ( ' V ' , " videoMode " , " Set the video mode valid values: 2D, 3DSBS, 3DTAB " ) ;
IntOption & argSource = parser . add < IntOption > ( 0x0 , " sourceSelect " , " Set current active priority channel and deactivate auto source switching " ) ;
BooleanOption & argSourceAuto = parser . add < BooleanOption > ( 0x0 , " sourceAutoSelect " , " Enables auto source, if disabled prio by manual selecting input source " ) ;
BooleanOption & argOff = parser . add < BooleanOption > ( 0x0 , " off " , " Deactivates hyperion " ) ;
BooleanOption & argOn = parser . add < BooleanOption > ( 0x0 , " on " , " Activates hyperion " ) ;
BooleanOption & argConfigGet = parser . add < BooleanOption > ( 0x0 , " configGet " , " Print the current loaded Hyperion configuration file " ) ;
2020-11-14 17:58:56 +01:00
BooleanOption & argSchemaGet = parser . add < BooleanOption > ( 0x0 , " schemaGet " , " Print the JSON schema for Hyperion configuration " ) ;
Option & argConfigSet = parser . add < Option > ( 0x0 , " configSet " , " Write to the actual loaded configuration file. Should be a JSON object string. " ) ;
2022-12-22 12:40:39 +01:00
BooleanOption & argServerInfo = parser . add < BooleanOption > ( ' l ' , " list " , " List server info and active effects with priority and duration " ) ;
BooleanOption & argSysInfo = parser . add < BooleanOption > ( ' s ' , " sysinfo " , " Show system info " ) ;
BooleanOption & argSystemSuspend = parser . add < BooleanOption > ( 0x0 , " suspend " , " Suspend Hyperion. Stop all instances and components " ) ;
BooleanOption & argSystemResume = parser . add < BooleanOption > ( 0x0 , " resume " , " Resume Hyperion. Start all instances and components " ) ;
BooleanOption & argSystemToggleSuspend = parser . add < BooleanOption > ( 0x0 , " toggleSuspend " , " Toggle between Suspend and Resume. First request will trigger suspend " ) ;
BooleanOption & argSystemIdle = parser . add < BooleanOption > ( 0x0 , " idle " , " Put Hyperion in Idle mode, i.e. all instances, components will be disabled besides the output processing (LED-devices, smoothing). " ) ;
BooleanOption & argSystemToggleIdle = parser . add < BooleanOption > ( 0x0 , " toggleIdle " , " Toggle between Idle and Working mode. First request will trigger Idle mode " ) ;
BooleanOption & argSystemRestart = parser . add < BooleanOption > ( 0x0 , " restart " , " Restart Hyperion " ) ;
2013-08-13 20:10:19 +02:00
2021-11-17 21:30:43 +01:00
BooleanOption & argPrint = parser . add < BooleanOption > ( 0x0 , " print " , " Print the JSON input and output messages on stdout " ) ;
BooleanOption & argDebug = parser . add < BooleanOption > ( 0x0 , " debug " , " Enable debug logging " ) ;
BooleanOption & argHelp = parser . add < BooleanOption > ( ' h ' , " help " , " Show this help message and exit " ) ;
2016-08-28 15:10:43 +02:00
// parse all _options
2016-10-24 23:52:53 +02:00
parser . process ( app ) ;
2013-08-13 20:10:19 +02:00
2021-11-17 21:30:43 +01:00
// check if debug logging is required
if ( parser . isSet ( argDebug ) )
{
Logger : : setLogLevel ( Logger : : DEBUG ) ;
}
2013-08-13 20:10:19 +02:00
// check if we need to display the usage. exit if we do.
2016-08-28 15:10:43 +02:00
if ( parser . isSet ( argHelp ) )
2013-08-13 20:10:19 +02:00
{
2016-10-24 23:52:53 +02:00
parser . showHelp ( 0 ) ;
2013-08-13 20:10:19 +02:00
}
// check if at least one of the available color transforms is set
2017-01-06 14:25:55 +01:00
bool colorAdjust = parser . isSet ( argRAdjust ) | | parser . isSet ( argGAdjust ) | | parser . isSet ( argBAdjust ) | | parser . isSet ( argCAdjust ) | | parser . isSet ( argMAdjust )
2017-04-03 05:19:05 +02:00
| | parser . isSet ( argYAdjust ) | | parser . isSet ( argWAdjust ) | | parser . isSet ( argbAdjust ) | | parser . isSet ( argGamma ) | | parser . isSet ( argBrightness ) | | parser . isSet ( argBrightnessC )
2017-02-11 22:52:47 +01:00
| | parser . isSet ( argBacklightThreshold ) | | parser . isSet ( argBacklightColored ) ;
2017-11-22 00:52:55 +01:00
2013-08-13 20:10:19 +02:00
// check that exactly one command was given
2022-02-11 20:36:15 +01:00
int commandCount = count ( { parser . isSet ( argColor ) , parser . isSet ( argImage ) ,
# if defined(ENABLE_EFFECTENGINE)
parser . isSet ( argEffect ) , parser . isSet ( argCreateEffect ) , parser . isSet ( argDeleteEffect ) ,
# endif
2022-12-22 12:40:39 +01:00
parser . isSet ( argServerInfo ) , parser . isSet ( argSysInfo ) ,
parser . isSet ( argSystemSuspend ) , parser . isSet ( argSystemResume ) , parser . isSet ( argSystemToggleSuspend ) ,
parser . isSet ( argSystemIdle ) , parser . isSet ( argSystemToggleIdle ) ,
parser . isSet ( argSystemRestart ) ,
parser . isSet ( argClear ) , parser . isSet ( argClearAll ) , parser . isSet ( argEnableComponent ) , parser . isSet ( argDisableComponent ) , colorAdjust ,
parser . isSet ( argSource ) , parser . isSet ( argSourceAuto ) , parser . isSet ( argOff ) , parser . isSet ( argOn ) , parser . isSet ( argConfigGet ) , parser . isSet ( argSchemaGet ) , parser . isSet ( argConfigSet ) ,
parser . isSet ( argMapping ) , parser . isSet ( argVideoMode ) } ) ;
2013-08-13 20:10:19 +02:00
if ( commandCount ! = 1 )
{
2016-08-28 15:10:43 +02:00
qWarning ( ) < < ( commandCount = = 0 ? " No command found. " : " Multiple commands found. " ) < < " Provide exactly one of the following options: " ;
showHelp ( argColor ) ;
showHelp ( argImage ) ;
2022-02-11 20:36:15 +01:00
# if defined(ENABLE_EFFECTENGINE)
2016-10-24 23:52:53 +02:00
showHelp ( argEffect ) ;
showHelp ( argCreateEffect ) ;
2016-11-18 18:39:21 +01:00
showHelp ( argDeleteEffect ) ;
2022-02-11 20:36:15 +01:00
# endif
2016-08-28 15:10:43 +02:00
showHelp ( argServerInfo ) ;
2017-03-04 22:17:42 +01:00
showHelp ( argSysInfo ) ;
2022-12-22 12:40:39 +01:00
showHelp ( argSystemSuspend ) ;
showHelp ( argSystemResume ) ;
showHelp ( argSystemToggleSuspend ) ;
showHelp ( argSystemIdle ) ;
showHelp ( argSystemToggleIdle ) ;
showHelp ( argSystemRestart ) ;
2016-08-28 15:10:43 +02:00
showHelp ( argClear ) ;
showHelp ( argClearAll ) ;
showHelp ( argEnableComponent ) ;
showHelp ( argDisableComponent ) ;
showHelp ( argSource ) ;
showHelp ( argSourceAuto ) ;
showHelp ( argConfigGet ) ;
2017-09-03 13:48:16 +02:00
showHelp ( argVideoMode ) ;
2016-08-28 15:10:43 +02:00
qWarning ( ) < < " or one or more of the available color modding operations: " ;
showHelp ( argId ) ;
2017-01-06 14:25:55 +01:00
showHelp ( argBrightness ) ;
2017-04-03 05:19:05 +02:00
showHelp ( argBrightnessC ) ;
2017-02-11 22:52:47 +01:00
showHelp ( argBacklightThreshold ) ;
showHelp ( argBacklightColored ) ;
2016-08-28 15:10:43 +02:00
showHelp ( argGamma ) ;
showHelp ( argRAdjust ) ;
showHelp ( argGAdjust ) ;
showHelp ( argBAdjust ) ;
2017-01-06 14:25:55 +01:00
showHelp ( argCAdjust ) ;
showHelp ( argMAdjust ) ;
showHelp ( argYAdjust ) ;
2013-08-13 20:10:19 +02:00
return 1 ;
}
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
QString host ;
QString serviceName { QHostInfo : : localHostName ( ) } ;
int port { JSONAPI_DEFAULT_PORT } ;
// Split hostname and port (or use default port)
QString givenAddress = argAddress . value ( parser ) ;
if ( ! NetUtils : : resolveHostPort ( givenAddress , host , port ) )
{
throw std : : runtime_error ( QString ( " Wrong address: unable to parse address (%1) " ) . arg ( givenAddress ) . toStdString ( ) ) ;
}
2013-08-13 20:10:19 +02:00
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
// Search available Hyperion services via mDNS, if default/localhost IP is given
if ( host = = " 127.0.0.1 " | | host = = " ::1 " )
2019-08-17 09:44:57 +02:00
{
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
# ifndef ENABLE_MDNS
2019-08-17 09:44:57 +02:00
SSDPDiscover discover ;
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
host = discover . getFirstService ( searchType : : STY_FLATBUFSERVER ) ;
# endif
QHostAddress address ;
if ( ! NetUtils : : resolveHostToAddress ( log , host , address , port ) )
2019-08-17 09:44:57 +02:00
{
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
throw std : : runtime_error ( QString ( " Address could not be resolved for hostname: %2 " ) . arg ( QSTRING_CSTR ( host ) ) . toStdString ( ) ) ;
2019-08-17 09:44:57 +02:00
}
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
host = address . toString ( ) ;
2019-08-17 09:44:57 +02:00
}
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
Info ( log , " Connecting to Hyperion host: %s, port: %u using service: %s " , QSTRING_CSTR ( host ) , port , QSTRING_CSTR ( serviceName ) ) ;
2021-11-17 21:30:43 +01:00
2013-08-13 20:10:19 +02:00
// create the connection to the hyperion server
2021-11-17 21:30:43 +01:00
JsonConnection connection ( host , parser . isSet ( argPrint ) , port ) ;
2013-08-13 20:10:19 +02:00
2019-07-12 16:54:26 +02:00
// authorization token specified. Use it first
if ( parser . isSet ( argToken ) )
2020-11-14 17:58:56 +01:00
{
2019-07-12 16:54:26 +02:00
connection . setToken ( argToken . value ( parser ) ) ;
2020-11-14 17:58:56 +01:00
}
2019-07-12 16:54:26 +02:00
2019-08-13 23:22:06 +02:00
// If a specific Hyperion instance is given, set it
if ( parser . isSet ( argInstance ) )
{
QJsonObject reply = connection . getServerInfo ( ) ;
int val = getInstaneIdbyName ( reply , argInstance . value ( parser ) ) ;
connection . setInstance ( val ) ;
}
2013-08-13 20:10:19 +02:00
// now execute the given command
2016-08-28 15:10:43 +02:00
if ( parser . isSet ( argColor ) )
{
2017-01-06 14:25:55 +01:00
// TODO: make sure setColor accepts a QList<QColor>
2020-05-25 21:51:11 +02:00
QVector < QColor > _cQV = argColor . getColors ( parser ) . toVector ( ) ;
connection . setColor ( std : : vector < QColor > ( _cQV . begin ( ) , _cQV . end ( ) ) , argPriority . getInt ( parser ) , argDuration . getInt ( parser ) ) ;
2016-08-28 15:10:43 +02:00
}
else if ( parser . isSet ( argImage ) )
2013-08-13 20:10:19 +02:00
{
2022-02-22 20:58:59 +01:00
QFileInfo imageFile { argImage . getCString ( parser ) } ;
connection . setImage ( argImage . getImage ( parser ) , argPriority . getInt ( parser ) , argDuration . getInt ( parser ) , imageFile . fileName ( ) ) ;
2013-08-13 20:10:19 +02:00
}
2022-02-11 20:36:15 +01:00
# if defined(ENABLE_EFFECTENGINE)
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argEffect ) )
2013-08-13 20:10:19 +02:00
{
2016-08-28 15:10:43 +02:00
connection . setEffect ( argEffect . value ( parser ) , argEffectArgs . value ( parser ) , argPriority . getInt ( parser ) , argDuration . getInt ( parser ) ) ;
2013-08-13 20:10:19 +02:00
}
2016-10-24 23:52:53 +02:00
else if ( parser . isSet ( argCreateEffect ) )
{
connection . createEffect ( argCreateEffect . value ( parser ) , argEffectFile . value ( parser ) , argEffectArgs . value ( parser ) ) ;
}
2016-11-18 18:39:21 +01:00
else if ( parser . isSet ( argDeleteEffect ) )
{
connection . deleteEffect ( argDeleteEffect . value ( parser ) ) ;
}
2022-02-11 20:36:15 +01:00
# endif
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argServerInfo ) )
2013-08-13 20:10:19 +02:00
{
2019-08-13 23:22:06 +02:00
std : : cout < < " Server info: \n " < < connection . getServerInfoString ( ) . toStdString ( ) < < std : : endl ;
2017-03-04 22:17:42 +01:00
}
else if ( parser . isSet ( argSysInfo ) )
{
std : : cout < < " System info: \n " < < connection . getSysInfo ( ) . toStdString ( ) < < std : : endl ;
2013-08-13 20:10:19 +02:00
}
2022-12-22 12:40:39 +01:00
else if ( parser . isSet ( argSystemSuspend ) )
{
connection . suspend ( ) ;
}
else if ( parser . isSet ( argSystemResume ) )
{
connection . resume ( ) ;
}
else if ( parser . isSet ( argSystemToggleSuspend ) )
{
connection . toggleSuspend ( ) ;
}
else if ( parser . isSet ( argSystemIdle ) )
{
connection . idle ( ) ;
}
else if ( parser . isSet ( argSystemToggleIdle ) )
{
connection . toggleIdle ( ) ;
}
else if ( parser . isSet ( argSystemRestart ) )
{
connection . restart ( ) ;
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argClear ) )
2013-08-13 20:10:19 +02:00
{
2016-08-28 15:10:43 +02:00
connection . clear ( argPriority . getInt ( parser ) ) ;
2013-08-13 20:10:19 +02:00
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argClearAll ) )
2013-08-13 20:10:19 +02:00
{
connection . clearAll ( ) ;
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argEnableComponent ) )
2016-08-04 13:10:53 +02:00
{
2016-08-28 15:10:43 +02:00
connection . setComponentState ( argEnableComponent . value ( parser ) , true ) ;
2016-08-04 13:10:53 +02:00
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argDisableComponent ) )
2016-08-04 13:10:53 +02:00
{
2016-08-28 15:10:43 +02:00
connection . setComponentState ( argDisableComponent . value ( parser ) , false ) ;
2016-08-04 13:10:53 +02:00
}
2017-03-23 17:11:07 +01:00
else if ( parser . isSet ( argOn ) )
2016-08-06 08:28:42 +02:00
{
2017-03-23 17:11:07 +01:00
connection . setComponentState ( " ALL " , true ) ;
}
else if ( parser . isSet ( argOff ) )
{
connection . setComponentState ( " ALL " , false ) ;
2016-08-06 08:28:42 +02:00
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argSource ) )
2016-07-31 22:21:35 +02:00
{
2016-08-28 15:10:43 +02:00
connection . setSource ( argSource . getInt ( parser ) ) ;
2016-07-31 22:21:35 +02:00
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argSourceAuto ) )
2016-07-31 22:21:35 +02:00
{
connection . setSourceAutoSelect ( ) ;
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argConfigGet ) )
2016-08-03 22:03:19 +02:00
{
2016-08-15 22:32:01 +02:00
QString info = connection . getConfig ( " config " ) ;
std : : cout < < " Configuration: \n " < < info . toStdString ( ) < < std : : endl ;
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argSchemaGet ) )
2016-08-15 22:32:01 +02:00
{
QString info = connection . getConfig ( " schema " ) ;
std : : cout < < " Configuration Schema \n " < < info . toStdString ( ) < < std : : endl ;
2016-08-03 22:03:19 +02:00
}
2016-08-28 15:10:43 +02:00
else if ( parser . isSet ( argConfigSet ) )
2016-08-14 20:17:12 +02:00
{
2016-10-09 22:22:17 +02:00
connection . setConfig ( argConfigSet . value ( parser ) ) ;
2016-08-14 20:17:12 +02:00
}
2016-12-19 23:59:50 +01:00
else if ( parser . isSet ( argMapping ) )
{
connection . setLedMapping ( argMapping . value ( parser ) ) ;
}
2017-08-04 23:08:15 +02:00
else if ( parser . isSet ( argVideoMode ) )
{
connection . setVideoMode ( argVideoMode . value ( parser ) ) ;
}
2017-01-06 14:25:55 +01:00
else if ( colorAdjust )
{
connection . setAdjustment (
argId . value ( parser ) ,
argRAdjust . getColor ( parser ) ,
argGAdjust . getColor ( parser ) ,
argBAdjust . getColor ( parser ) ,
argCAdjust . getColor ( parser ) ,
argMAdjust . getColor ( parser ) ,
argYAdjust . getColor ( parser ) ,
argWAdjust . getColor ( parser ) ,
argbAdjust . getColor ( parser ) ,
argGamma . getDoublePtr ( parser ) ,
argGamma . getDoublePtr ( parser ) ,
argGamma . getDoublePtr ( parser ) ,
2017-04-03 05:19:05 +02:00
argBacklightThreshold . getIntPtr ( parser ) ,
2017-02-11 22:52:47 +01:00
argBacklightColored . getIntPtr ( parser ) ,
2017-04-03 05:19:05 +02:00
argBrightness . getIntPtr ( parser ) ,
argBrightnessC . getIntPtr ( parser )
2017-01-06 14:25:55 +01:00
) ;
2016-03-11 12:20:59 +01:00
}
2013-08-13 20:10:19 +02:00
}
catch ( const std : : runtime_error & e )
{
2020-11-14 17:58:56 +01:00
// An error occurred. Display error and quit
2021-11-17 21:30:43 +01:00
Error ( log , " %s " , e . what ( ) ) ;
2013-08-13 20:10:19 +02:00
return 1 ;
}
return 0 ;
2013-08-11 11:54:16 +02:00
}