This abstract class provides access to a set of parameters. Each parameter has a type, a name and a value. This API is designed to manage interactions between parameters and to enforce restrictions on allowed values.
Each parameter has a predefined type so the codec can expose integer, double, boolean, string and enumerated parameters. Parameters may be marked as disabled or read-only by the codec, and they each have a default value. Numeric paremters have minimum and maximum limits. Enumerated parameters have a "mask" of allowable values.
Parameters are implicitly ordered by precedence. This allows the user to make certain assumtions about the behavior of the Settings API. Modifiying a paramater's value could affect parameters of lower precedence - their values could change, they could be enabled or disabled or their range or mask might be changed. Parameters of higher precedence that the modified parameter are guaranteed not to be affected.
The settings are guaranteed to be in a usable state after every user interaction. This means that some interactions will fail, for example attempting to change a disabled or read-only parameter.
|
Public Types |
typedef uint32_t | Enum |
enum | Type {
BOOLEAN,
INTEGER,
DOUBLE,
ENUM,
STRING,
DATA
} |
Public Member Functions |
Settings & | operator= (const Settings &rhs) |
virtual Name | getName (int n) const =0 |
virtual Type | getType (Name name) const =0 |
virtual bool | isReadOnly (Name name) const =0 |
virtual bool | isEnabled (Name name) const =0 |
virtual bool | isDefault (Name name) const =0 |
virtual void | setBool (Name name, bool value)=0 |
virtual bool | getBool (Name name) const =0 |
virtual void | setInt (Name name, int value)=0 |
virtual int | getInt (Name name) const =0 |
virtual int | getIntMin (Name name) const =0 |
virtual int | getIntMax (Name name) const =0 |
virtual void | setDouble (Name name, double value)=0 |
virtual double | getDouble (Name name) const =0 |
virtual double | getDoubleMin (Name name) const =0 |
virtual double | getDoubleMax (Name name) const =0 |
virtual void | setEnum (Name name, Enum value)=0 |
virtual Enum | getEnum (Name name) const =0 |
virtual Enum | getEnumMask (Name name) const =0 |
virtual void | setStr (Name name, const char *value)=0 |
virtual const char * | getStr (Name name) const =0 |
virtual void | setData (Name name, const uint8_t *buff, int len)=0 |
virtual const uint8_t * | getData (Name name) const =0 |
virtual int | getDataLen (Name name) const =0 |
virtual void | makeCurrentSettingsDefault ()=0 |
virtual void | resetDefaults ()=0 |
virtual int | getPrecedence (Settings::Name name) const =0 |
Static Public Member Functions |
static Enum | fourCC2Encoder (FourCC fourCC) |
static bool | isCorrectHeader (const char *version=SETTINGS_REVISION) |
Protected Member Functions |
| Settings (const Settings &rhs) |
| Settings () |
virtual | ~Settings () |
Data Structures |
class | Exception |
| C++ exception type used by the settings API. More...
|
class | Name |
| Parameter name. Each parameter has a unique name. More...
|