mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Doxygen comments added
This commit is contained in:
@@ -12,25 +12,48 @@
|
||||
|
||||
class JsonClientConnection;
|
||||
|
||||
///
|
||||
/// This class creates a TCP server which accepts connections wich can then send
|
||||
/// in JSON encoded commands. This interface to Hyperion is used by hyperion-remote
|
||||
/// to control the leds
|
||||
///
|
||||
class JsonServer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
///
|
||||
/// \brief JsonServer constructor
|
||||
/// \param hyperion Hyperion instance
|
||||
/// \param port port number on which to start listening for connections
|
||||
///
|
||||
JsonServer(Hyperion * hyperion, uint16_t port = 19444);
|
||||
~JsonServer();
|
||||
|
||||
///
|
||||
/// \return the port number on which this TCP listens for incoming connections
|
||||
///
|
||||
uint16_t getPort() const;
|
||||
|
||||
private slots:
|
||||
///
|
||||
/// \brief Slot which is called when a client tries to create a new connection
|
||||
///
|
||||
void newConnection();
|
||||
|
||||
///
|
||||
/// \brief Slot which is called when a client closes a connection
|
||||
/// \param The Connection object which is being closed
|
||||
///
|
||||
void closedConnection(JsonClientConnection * connection);
|
||||
|
||||
private:
|
||||
/// Hyperion instance
|
||||
Hyperion * _hyperion;
|
||||
|
||||
/// The TCP server object
|
||||
QTcpServer _server;
|
||||
|
||||
/// List with open connections
|
||||
QSet<JsonClientConnection *> _openConnections;
|
||||
};
|
||||
|
@@ -15,29 +15,53 @@
|
||||
class ColorTransform
|
||||
{
|
||||
public:
|
||||
/// @brief Default constructor
|
||||
ColorTransform();
|
||||
|
||||
/// @brief Constructor
|
||||
/// @param threshold
|
||||
/// @param gamma
|
||||
/// @param blacklevel
|
||||
/// @param whitelevel
|
||||
ColorTransform(double threshold, double gamma, double blacklevel, double whitelevel);
|
||||
|
||||
/// @brief Destructor
|
||||
~ColorTransform();
|
||||
|
||||
/// @return The current threshold value
|
||||
double getThreshold() const;
|
||||
|
||||
/// @param threshold New threshold value
|
||||
void setThreshold(double threshold);
|
||||
|
||||
/// @return The current gamma value
|
||||
double getGamma() const;
|
||||
|
||||
/// @param gamma New gamma value
|
||||
void setGamma(double gamma);
|
||||
|
||||
/// @return The current blacklevel value
|
||||
double getBlacklevel() const;
|
||||
|
||||
/// @param blacklevel New blacklevel value
|
||||
void setBlacklevel(double blacklevel);
|
||||
|
||||
/// @return The current whitelevel value
|
||||
double getWhitelevel() const;
|
||||
|
||||
/// @param whitelevel New whitelevel value
|
||||
void setWhitelevel(double whitelevel);
|
||||
|
||||
/// get the transformed value for the given byte value
|
||||
/// @brief Transform the given byte value
|
||||
/// @param input The input color byte
|
||||
/// @return The transformed byte value
|
||||
uint8_t transform(uint8_t input) const
|
||||
{
|
||||
return _mapping[input];
|
||||
}
|
||||
|
||||
private:
|
||||
/// @brief (re)-initilize the color mapping
|
||||
void initializeMapping();
|
||||
|
||||
private:
|
||||
|
@@ -3,19 +3,40 @@
|
||||
// STL includes
|
||||
#include <cstdint>
|
||||
|
||||
///
|
||||
/// \brief Color transformation to adjust the saturation and value of a RGB color value
|
||||
///
|
||||
class HsvTransform
|
||||
{
|
||||
public:
|
||||
/// Default constructor
|
||||
HsvTransform();
|
||||
|
||||
/// @brief Constructor
|
||||
/// @param saturationGain
|
||||
/// @param valueGain
|
||||
HsvTransform(double saturationGain, double valueGain);
|
||||
|
||||
/// Destructor
|
||||
~HsvTransform();
|
||||
|
||||
/// @param saturationGain New saturationGain
|
||||
void setSaturationGain(double saturationGain);
|
||||
|
||||
/// @return The current Saturation gain
|
||||
double getSaturationGain() const;
|
||||
|
||||
/// @param valueGain New Value gain
|
||||
void setValueGain(double valueGain);
|
||||
|
||||
/// @return The current value gain
|
||||
double getValueGain() const;
|
||||
|
||||
/// @brief Apply the transform the the given RGB values.
|
||||
/// @param red The red color component
|
||||
/// @param green The green color component
|
||||
/// @param blue The blue color component
|
||||
/// @note The values are updated in place.
|
||||
void transform(uint8_t & red, uint8_t & green, uint8_t & blue) const;
|
||||
|
||||
/// integer version of the conversion are faster, but a little less accurate
|
||||
|
@@ -7,30 +7,47 @@
|
||||
// jsoncpp includes
|
||||
#include <json/json.h>
|
||||
|
||||
/**
|
||||
* JsonSchemaChecker is a very basic implementation of json schema.
|
||||
* The json schema definition draft can be found at
|
||||
* http://tools.ietf.org/html/draft-zyp-json-schema-03
|
||||
*
|
||||
* The following keywords are supported:
|
||||
* - type
|
||||
* - required
|
||||
* - properties
|
||||
* - items
|
||||
* - enum
|
||||
* - minimum
|
||||
* - maximum
|
||||
*/
|
||||
|
||||
/// JsonSchemaChecker is a very basic implementation of json schema.
|
||||
/// The json schema definition draft can be found at
|
||||
/// http://tools.ietf.org/html/draft-zyp-json-schema-03
|
||||
///
|
||||
/// The following keywords are supported:
|
||||
/// - type
|
||||
/// - required
|
||||
/// - properties
|
||||
/// - items
|
||||
/// - enum
|
||||
/// - minimum
|
||||
/// - maximum
|
||||
/// - addtionalProperties
|
||||
/// - minItems
|
||||
/// - maxItems
|
||||
///
|
||||
/// And the non-standard:
|
||||
/// - dependencies
|
||||
class JsonSchemaChecker
|
||||
{
|
||||
public:
|
||||
JsonSchemaChecker();
|
||||
virtual ~JsonSchemaChecker();
|
||||
|
||||
///
|
||||
/// @param The schema to use
|
||||
/// @return true upon succes
|
||||
///
|
||||
bool setSchema(const Json::Value & schema);
|
||||
|
||||
///
|
||||
/// @brief Validate a JSON structure
|
||||
/// @param The JSON value to check
|
||||
/// @return true when the arguments is valid according to the schema
|
||||
///
|
||||
bool validate(const Json::Value & value);
|
||||
|
||||
///
|
||||
/// @return A list of error messages
|
||||
///
|
||||
const std::list<std::string> & getMessages() const;
|
||||
|
||||
private:
|
||||
|
@@ -14,8 +14,8 @@
|
||||
// Hyperion includes
|
||||
#include <hyperion/Hyperion.h>
|
||||
|
||||
/// Check if XBMC is playing something. When it does not, this class will send all black data Hyperion to
|
||||
/// override (grabbed) data with a lower priority
|
||||
/// This class will check if XBMC is playing something. When it does not, this class will send all black data to Hyperion.
|
||||
/// This allows grabbed screen data to be overriden while in the XBMC menus.
|
||||
///
|
||||
/// Note: The json TCP server needs to be enabled manually in XBMC in System/Settings/Network/Services
|
||||
class XBMCVideoChecker : public QObject
|
||||
@@ -23,13 +23,22 @@ class XBMCVideoChecker : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/// @Constructor
|
||||
/// @param address Netwrok address of the XBMC instance
|
||||
/// @param port Port number to use (XBMC default = 9090)
|
||||
/// @param interval The interval at which XBMC is polled
|
||||
/// @param hyperion The Hyperion instance
|
||||
/// @param priority The priority at which to send the all black data
|
||||
XBMCVideoChecker(const std::string & address, uint16_t port, uint64_t interval, Hyperion * hyperion, int priority);
|
||||
|
||||
/// \brief Start polling XBMC
|
||||
void start();
|
||||
|
||||
private slots:
|
||||
/// \brief Send a request to XBMC
|
||||
void sendRequest();
|
||||
|
||||
/// @brief receive a reply from XBMC
|
||||
void receiveReply();
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user