Sayonara Player
Public Types | Public Member Functions | Static Public Member Functions | List of all members
EqualizerSetting Class Reference

The EQ_Setting class. Container for Equalizer configurations. More...

#include <EqualizerSetting.h>

Inheritance diagram for EqualizerSetting:
SettingConvertible

Public Types

using ValueArray = std::array< int, 10 >
 

Public Member Functions

 EqualizerSetting (const QString &name=QString())
 
 EqualizerSetting (const QString &name, const ValueArray &values)
 
 EqualizerSetting (const EqualizerSetting &other)
 
EqualizerSettingoperator= (const EqualizerSetting &s)
 
bool operator== (const EqualizerSetting &s) const
 Compares the case insensitive string representation of two settings. More...
 
QString name () const
 get name of setting More...
 
void set_name (const QString &name)
 set name of setting More...
 
ValueArray values () const
 get database values for setting More...
 
int value (int idx) const
 get specific value for a band idx. if idx is not valid, 0 is returned More...
 
void set_value (int idx, int val)
 set specific value for band More...
 
void set_values (const ValueArray &values)
 set all values for a specific index. If there are more than 10 values, list is stripped. If there are less, the list is filled with zeros More...
 
bool is_default () const
 append a value. If there are already more than 10 values, nothing happens More...
 
bool is_default_name () const
 checks, if the preset name belongs to a default preset More...
 
bool loadFromString (const QString &str) override
 converts a string to a EQ_Setting. If not possible a default constructed EQ_Setting is returned More...
 
QString toString () const override
 converts EQ_Setting to string More...
 

Static Public Member Functions

static QList< EqualizerSettingget_defaults ()
 get default settings More...
 
static ValueArray get_default_values (const QString &name)
 get default values for a specific preset. If the preset does not have default values, an empty list is returned More...
 
static bool is_default_name (const QString &name)
 static convenience function for is_default_name() More...
 

Detailed Description

The EQ_Setting class. Container for Equalizer configurations.

Member Function Documentation

◆ get_default_values()

static ValueArray EqualizerSetting::get_default_values ( const QString &  name)
static

get default values for a specific preset. If the preset does not have default values, an empty list is returned

Parameters
namepreset name
Returns
value list if name belongs to a default preset. Empty list else

◆ get_defaults()

static QList<EqualizerSetting> EqualizerSetting::get_defaults ( )
static

get default settings

Returns
list of default settings

◆ is_default()

bool EqualizerSetting::is_default ( ) const

append a value. If there are already more than 10 values, nothing happens

Parameters
valchecks, if preset is default preset
Returns
true if preset is default preset, false else

◆ is_default_name() [1/2]

bool EqualizerSetting::is_default_name ( ) const

checks, if the preset name belongs to a default preset

Returns
true if preset is default preset, false else

◆ is_default_name() [2/2]

static bool EqualizerSetting::is_default_name ( const QString &  name)
static

static convenience function for is_default_name()

Parameters
namepreset name
Returns

◆ loadFromString()

bool EqualizerSetting::loadFromString ( const QString &  str)
overridevirtual

converts a string to a EQ_Setting. If not possible a default constructed EQ_Setting is returned

Parameters
str
Returns

Implements SettingConvertible.

◆ name()

QString EqualizerSetting::name ( ) const

get name of setting

Returns

◆ operator==()

bool EqualizerSetting::operator== ( const EqualizerSetting s) const

Compares the case insensitive string representation of two settings.

Parameters
sother preset
Returns

◆ set_name()

void EqualizerSetting::set_name ( const QString &  name)

set name of setting

Parameters
name

◆ set_value()

void EqualizerSetting::set_value ( int  idx,
int  val 
)

set specific value for band

Parameters
idxband index
valdatabase formatted value

◆ set_values()

void EqualizerSetting::set_values ( const ValueArray &  values)

set all values for a specific index. If there are more than 10 values, list is stripped. If there are less, the list is filled with zeros

Parameters
values

◆ toString()

QString EqualizerSetting::toString ( ) const
overridevirtual

converts EQ_Setting to string

Returns

Implements SettingConvertible.

◆ value()

int EqualizerSetting::value ( int  idx) const

get specific value for a band idx. if idx is not valid, 0 is returned

Parameters
idxband index
Returns
database value if idx is valid, 0 else

◆ values()

ValueArray EqualizerSetting::values ( ) const

get database values for setting

Returns