Skip to content

Class Ase::Preference

ClassList > Ase > Preference

Class for preference parameters (global settings)

  • #include <properties.hh>

Inherits the following classes: Ase::ParameterProperty

Public Types

Type Name
typedef std::function< void()> DelCb
typedef std::function< void(const String &, const Value &)> StringValueF

Public Attributes inherited from Ase::Property

See Ase::Property

Type Name
Member<&Property::metadata_ > metadata
Member<&Property::name_ > name
Member<&Property::value_ > value

Public Functions

Type Name
Preference (const Param & param, const StringValueF & cb=nullptr)
virtual Value get_value () override const
Get the native property value.
bool getb () const
double getd () const
int64 getn () const
String gets () const
uint64 getu () const
bool set (const Value & value)
bool set (const String & string)
virtual bool set_value (const Value & v) override
Set the native property value.
virtual ~Preference ()

Public Functions inherited from Ase::ParameterProperty

See Ase::ParameterProperty

Type Name
virtual ChoiceS choices () override const
Enumerate choices for choosable properties.
double get_double () const
virtual double get_max () override const
Get the maximum property value, converted to double.
virtual double get_min () override const
Get the minimum property value, converted to double.
virtual double get_normalized () override const
Get the normalized property value, converted to double.
virtual double get_step () override const
Get the property value stepping, converted to double.
virtual String get_text () override const
Get the current property value, converted to a text String.
virtual Value get_value () override const = 0
Get the native property value.
virtual String ident () override const
Unique name (per owner) of this Property .
Value initial () const
virtual bool is_numeric () override const
Whether the property settings can be represented as a floating point number.
virtual String label () override const
Preferred user interface name.
virtual String nick () override const
Abbreviated user interface name, usually not more than 6 characters.
ParameterC parameter () const
MinMaxStep range () const
virtual void reset () override
Assign default as normalized property value.
virtual bool set_normalized (double v) override
Set the normalized property value as double.
virtual bool set_text (String v) override
Set the current property value as a text String.
virtual bool set_value (const Value & v) override = 0
Set the native property value.
virtual String unit () override const
Units of the values within range.

Public Functions inherited from Ase::EmittableImpl

See Ase::EmittableImpl

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) override
virtual void emit_notify (const String & detail) override
Emit notify:detail , multiple notifications maybe coalesced if a CoalesceNotifies instance exists.
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) override

Public Functions inherited from Ase::Emittable

See Ase::Emittable

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) = 0
virtual void emit_notify (const String & detail) = 0
void js_trigger (const String & eventselector, JsTrigger callback)
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) = 0

Public Functions inherited from Ase::Property

See Ase::Property

Type Name
String blurb () const
Short description for user interface tooltips (metadata).
virtual ChoiceS choices () const = 0
Enumerate choices for choosable properties.
String descr () const
Elaborate description, e.g. for help dialogs (metadata).
virtual double get_max () const = 0
Get the maximum property value, converted to double.
virtual double get_min () const = 0
Get the minimum property value, converted to double.
virtual double get_normalized () const = 0
Get the normalized property value, converted to double.
virtual double get_step () const = 0
Get the property value stepping, converted to double.
virtual String get_text () const = 0
Get the current property value, converted to a text String.
virtual Value get_value () const = 0
Get the native property value.
String group () const
Group name for parameters of similar function (metadata).
String hints () const
Hints for parameter handling (metadata).
virtual String ident () const = 0
Unique name (per owner) of this Property .
virtual bool is_numeric () const = 0
Whether the property settings can be represented as a floating point number.
virtual String label () const = 0
Preferred user interface name.
virtual String nick () const = 0
Abbreviated user interface name, usually not more than 6 characters.
virtual void reset () = 0
Assign default as normalized property value.
virtual bool set_normalized (double v) = 0
Set the normalized property value as double.
virtual bool set_text (String v) = 0
Set the current property value as a text String.
virtual bool set_value (const Value & v) = 0
Set the native property value.
virtual String unit () const = 0
Units of the values within range.

Public Functions inherited from Ase::Emittable

See Ase::Emittable

Type Name
virtual void emit_event (const String & type, const String & detail, const ValueR fields={}) = 0
virtual void emit_notify (const String & detail) = 0
void js_trigger (const String & eventselector, JsTrigger callback)
virtual ASE_USE_RESULT Connection on_event (const String & eventselector, const EventHandler & eventhandler) = 0

Public Static Functions

Type Name
PreferenceP find (const String & ident)
Value get (const String & ident)
CStringS list ()
DelCb listen (const std::function< void(const CStringS &)> & func)
void load_preferences (bool autosave)
void save_preferences ()

Protected Attributes inherited from Ase::ParameterProperty

See Ase::ParameterProperty

Type Name
ParameterC parameter_

Protected Functions inherited from Ase::ParameterProperty

See Ase::ParameterProperty

Type Name
virtual StringS get_metadata () override const

Protected Functions inherited from Ase::EmittableImpl

See Ase::EmittableImpl

Type Name
virtual ~EmittableImpl ()

Protected Functions inherited from Ase::VirtualBase

See Ase::VirtualBase

Type Name
virtual ~VirtualBase () noexcept = 0

Protected Functions inherited from Ase::Property

See Ase::Property

Type Name
Property ()
virtual StringS get_metadata () const = 0
virtual ~Property () = 0

Protected Functions inherited from Ase::VirtualBase

See Ase::VirtualBase

Type Name
virtual ~VirtualBase () noexcept = 0

Public Types Documentation

typedef DelCb

using Ase::Preference::DelCb =  std::function<void()>;

typedef StringValueF

using Ase::Preference::StringValueF =  std::function<void(const String&, const Value&)>;

Public Functions Documentation

function Preference [2/2]

Ase::Preference::Preference (
    const Param & param,
    const StringValueF & cb=nullptr
) 

function get_value

virtual Value Ase::Preference::get_value () override const

Implements Ase::ParameterProperty::get_value


function getb

inline bool Ase::Preference::getb () const

function getd

inline double Ase::Preference::getd () const

function getn

inline int64 Ase::Preference::getn () const

function gets

inline String Ase::Preference::gets () const

function getu

inline uint64 Ase::Preference::getu () const

function set [1/2]

inline bool Ase::Preference::set (
    const Value & value
) 

function set [2/2]

inline bool Ase::Preference::set (
    const String & string
) 

function set_value

virtual bool Ase::Preference::set_value (
    const Value & v
) override

Implements Ase::ParameterProperty::set_value


function ~Preference

virtual Ase::Preference::~Preference () 

Public Static Functions Documentation

function find

static PreferenceP Ase::Preference::find (
    const String & ident
) 

function get

static Value Ase::Preference::get (
    const String & ident
) 

function list

static CStringS Ase::Preference::list () 

function listen

static DelCb Ase::Preference::listen (
    const std::function< void(const CStringS &)> & func
) 

function load_preferences

static void Ase::Preference::load_preferences (
    bool autosave
) 

function save_preferences

static void Ase::Preference::save_preferences () 


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/properties.hh