CAVAPA-GUI  30.5.2014
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | Protected Member Functions | List of all members
cavapa_gui::SourceSettings Class Reference

Represents the settings for a video source. More...

#include <sourcesettings.h>

Inheritance diagram for cavapa_gui::SourceSettings:
cavapa_gui::Settings cavapa_gui::KeyValueCollection

Public Member Functions

 SourceSettings ()
 Constructs a new SourceSettings object with default values and an empty name.
 
 SourceSettings (const std::string &sourceName)
 Constructs a new SourceSettings object with default values. More...
 
std::string getSourceName () const
 Gets the name of the associated source. More...
 
void setCameraSettings (const cavapa::CameraSettings &cameraSettings)
 Sets the camera settings for the instance of SourceSettings. More...
 
void setSourceName (const std::string &name)
 Sets the name of the associated source.
 
cavapa::CameraSettings toCameraSettings () const
 Converts the instance of SourceSettings to CameraSettings. More...
 
- Public Member Functions inherited from cavapa_gui::Settings
std::vector< std::string > getVector (const std::string &key) const
 Gets a collection of values related to the specified key. More...
 
void setVector (const std::string &key, const std::vector< std::string > &vector)
 Sets a collection of values related to the specified key. More...
 
- Public Member Functions inherited from cavapa_gui::KeyValueCollection
const_iterator begin () const
 Returns a const iterator to the beginning of the collection. More...
 
const_iterator end () const
 Returns a const iterator to the end of the collection. More...
 
std::string get (const std::string &name) const
 Gets the value of the specified key as a string. More...
 
bool getBool (const std::string &name) const
 Gets the value of the specified key as a bool. More...
 
QColor getColor (const std::string &name) const
 Gets the value of the specified key as a QColor. More...
 
QString getQString (const std::string &name) const
 Gets the value of the specified key as a QString. More...
 
double getDouble (const std::string &name) const
 Gets the value of the specified key as a double. More...
 
int getInt (const std::string &name) const
 Gets the value of the specified key as an integer. More...
 
template<typename ValueType , int N>
std::array< ValueType, N > getValues (const std::string &name) const
 Gets an array of values from the specified key. More...
 
void set (const std::string &name, const std::string &value)
 Sets the value of the specified key. More...
 
void setBool (const std::string &name, bool value)
 Sets the value of the specified key as a bool. More...
 
void setColor (const std::string &name, const QColor &value)
 Sets the value of the specified key as a QColor. More...
 
void setInt (const std::string &name, int value)
 Sets the value of the specified key as an int. More...
 
template<typename... T>
void setValues (const std::string &name, T...values)
 Sets the value of the specified key as an array. More...
 
void setQString (const std::string &name, const QString &value)
 Sets the value of the specified key as a QString. More...
 
bool trySet (const std::string &name, const std::string &value)
 Attempts to set the value of the specified key. More...
 

Protected Member Functions

bool canLoadOrSave ()
 Gets whether the SourceSettings instance can be saved or not. More...
 
std::string getGroupName ()
 Gets the name of the setting group. More...
 

Additional Inherited Members

- Public Types inherited from cavapa_gui::KeyValueCollection
using const_iterator = std::map< std::string, std::string >::const_iterator
 Provides a bidirectional iterator that can read a const element in the collection.
 
- Protected Attributes inherited from cavapa_gui::Settings
std::map< std::string,
std::vector< std::string > > 
vectorMap
 The map associates a string key with a vector of strings. More...
 
- Protected Attributes inherited from cavapa_gui::KeyValueCollection
std::map< std::string,
std::string > 
keyValueMap
 Contains the key-value mappings in an std::map.
 

Detailed Description

Represents the settings for a video source.

Author
Mika Lehtinen

Constructor & Destructor Documentation

cavapa_gui::SourceSettings::SourceSettings ( const std::string &  sourceName)
explicit

Constructs a new SourceSettings object with default values.

Parameters
sourceNameThe name of the source.

Member Function Documentation

bool cavapa_gui::SourceSettings::canLoadOrSave ( )
inlineprotectedvirtual

Gets whether the SourceSettings instance can be saved or not.

Returns
True if sourceName is not an empty string, false otherwise.

Reimplemented from cavapa_gui::Settings.

std::string cavapa_gui::SourceSettings::getGroupName ( )
inlineprotectedvirtual

Gets the name of the setting group.

Returns
The name of the setting group (the source name).

Reimplemented from cavapa_gui::Settings.

std::string cavapa_gui::SourceSettings::getSourceName ( ) const

Gets the name of the associated source.

Returns
The name of the source.
void cavapa_gui::SourceSettings::setCameraSettings ( const cavapa::CameraSettings &  cameraSettings)

Sets the camera settings for the instance of SourceSettings.

Parameters
cameraSettingsThe camera settings.
cavapa::CameraSettings cavapa_gui::SourceSettings::toCameraSettings ( ) const

Converts the instance of SourceSettings to CameraSettings.

Returns
The CameraSettings object.

The documentation for this class was generated from the following files: