Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Ase::Preference Class Reference

Class for preference parameters (global settings) More...

#include "properties.hh"

Inheritance diagram for Ase::Preference:
[legend]

Public Types

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

Public Member Functions

 Preference (const Param &, const StringValueF &=nullptr)
 
String gets () const
 
bool getb () const
 
int64 getn () const
 
uint64 getu () const
 
double getd () const
 
bool set (const Value &value)
 
bool set (const String &string)
 
Value get_value () const override
 Get the native property value.
 
bool set_value (const Value &v) override
 Set the native property value.
 
- Public Member Functions inherited from Ase::ParameterProperty
String ident () const override
 Unique name (per owner) of this Property.
 
String label () const override
 Preferred user interface name.
 
String nick () const override
 Abbreviated user interface name, usually not more than 6 characters.
 
String unit () const override
 Units of the values within range.
 
double get_min () const override
 Get the minimum property value, converted to double.
 
double get_max () const override
 Get the maximum property value, converted to double.
 
double get_step () const override
 Get the property value stepping, converted to double.
 
bool is_numeric () const override
 Whether the property settings can be represented as a floating point number.
 
ChoiceS choices () const override
 Enumerate choices for choosable properties.
 
void reset () override
 Assign default as normalized property value.
 
double get_normalized () const override
 Get the normalized property value, converted to double.
 
bool set_normalized (double v) override
 Set the normalized property value as double.
 
String get_text () const override
 Get the current property value, converted to a text String.
 
bool set_text (String txt) override
 Set the current property value as a text String.
 
double get_double () const
 
ParameterC parameter () const
 
Value initial () const
 
MinMaxStep range () const
 
- Public Member Functions inherited from Ase::EmittableImpl
ASE_USE_RESULT Connection on_event (const String &eventselector, const EventHandler &eventhandler) override
 
void emit_event (const String &type, const String &detail, const ValueR fields={}) override
 
void emit_notify (const String &detail) override
 Emit notify:detail, multiple notifications maybe coalesced if a CoalesceNotifies instance exists.
 
- Public Member Functions inherited from Ase::Emittable
void js_trigger (const String &eventselector, JsTrigger callback)
 
- Public Member Functions inherited from std::enable_shared_from_this< SharedBase >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 
~enable_shared_from_this (T... args)
 
- Public Member Functions inherited from Ase::Property
virtual String get_name () const
 
virtual void set_name (const String &n)
 
virtual void set_metadata (const StringS &md)
 
String hints () const
 Hints for parameter handling (metadata).
 
String blurb () const
 Short description for user interface tooltips (metadata).
 
String descr () const
 Elaborate description, e.g. for help dialogs (metadata).
 
String group () const
 Group name for parameters of similar function (metadata).
 

Static Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from Ase::Emittable
const EventHandlereventhandler
 
- Public Attributes inherited from Ase::Property
Member<&Property::get_name,&Property::set_name > name
 
Member<&Property::get_value,&Property::set_valuevalue
 
Member<&Property::get_metadata,&Property::set_metadata > metadata
 
- Protected Member Functions inherited from Ase::ParameterProperty
StringS get_metadata () const override
 
- Protected Attributes inherited from Ase::ParameterProperty
ParameterC parameter_
 

Detailed Description

Class for preference parameters (global settings)

Definition at line 40 of file properties.hh.

Member Typedef Documentation

◆ DelCb

Definition at line 43 of file properties.hh.

◆ StringValueF

Definition at line 44 of file properties.hh.

Constructor & Destructor Documentation

◆ ~Preference()

Ase::Preference::~Preference ( )
virtual

Definition at line 143 of file properties.cc.

◆ Preference()

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

Definition at line 125 of file properties.cc.

Member Function Documentation

◆ find()

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

Definition at line 188 of file properties.cc.

◆ get()

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

Definition at line 176 of file properties.cc.

◆ get_value()

Value Ase::Preference::get_value ( ) const
overridevirtual

Get the native property value.

Implements Ase::ParameterProperty.

Definition at line 155 of file properties.cc.

◆ getb()

bool Ase::Preference::getb ( ) const

Definition at line 48 of file properties.hh.

◆ getd()

double Ase::Preference::getd ( ) const

Definition at line 51 of file properties.hh.

◆ getn()

int64 Ase::Preference::getn ( ) const

Definition at line 49 of file properties.hh.

◆ gets()

String Ase::Preference::gets ( ) const

Definition at line 47 of file properties.hh.

◆ getu()

uint64 Ase::Preference::getu ( ) const

Definition at line 50 of file properties.hh.

◆ list()

CStringS Ase::Preference::list ( )
static

Definition at line 200 of file properties.cc.

◆ listen()

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

Definition at line 210 of file properties.cc.

◆ load_preferences()

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

Definition at line 223 of file properties.cc.

◆ save_preferences()

void Ase::Preference::save_preferences ( )
static

Definition at line 238 of file properties.cc.

◆ set() [1/2]

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

Definition at line 53 of file properties.hh.

◆ set() [2/2]

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

Definition at line 52 of file properties.hh.

◆ set_value()

bool Ase::Preference::set_value ( const Value v)
overridevirtual

Set the native property value.

Implements Ase::ParameterProperty.

Definition at line 163 of file properties.cc.


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