HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
Units

Better readability. More...

Namespaces

namespace  hart
 

Macros

#define HART_DECLARE_ALIASES_FOR_UNITS
 Pre-C++20 macro to use units without namespace.
 

Functions

constexpr double operator""_s (long double val)
 
constexpr double operator""_s (unsigned long long int val)
 
constexpr double operator""_ms (long double val)
 
constexpr double operator""_ms (unsigned long long int val)
 
constexpr double operator""_us (long double val)
 
constexpr double operator""_us (unsigned long long int val)
 
constexpr double operator""_ns (long double val)
 
constexpr double operator""_ns (unsigned long long int val)
 
constexpr double operator""_dB (long double val)
 
constexpr double operator""_dB (unsigned long long int val)
 
constexpr double operator""_dBTP (long double val)
 
constexpr double operator""_dBTP (unsigned long long int val)
 
constexpr double operator""_Hz (long double val)
 
constexpr double operator""_Hz (unsigned long long int val)
 
constexpr double operator""_kHz (long double val)
 
constexpr double operator""_kHz (unsigned long long val)
 
constexpr double operator""_rad (long double val)
 
constexpr double operator""_rad (unsigned long long val)
 
constexpr double operator""_deg (long double val)
 
constexpr double operator""_deg (unsigned long long val)
 
constexpr double operator""_cents (long double val)
 
constexpr double operator""_cents (unsigned long long val)
 
double operator""_dB_as_ratio (long double val)
 
double operator""_dB_as_ratio (unsigned long long int val)
 
double operator""_ratio_as_dB (long double val)
 
double operator""_ratio_as_dB (unsigned long long int val)
 

Variables

constexpr double inf_dB = hart::inf
 
constexpr double oo_dB = hart::inf
 
constexpr double pi_rad = hart::pi
 
constexpr double twoPi_rad = hart::twoPi
 
constexpr double halfPi_rad = hart::halfPi
 

Detailed Description

Better readability.

Macro Definition Documentation

◆ HART_DECLARE_ALIASES_FOR_UNITS

#define HART_DECLARE_ALIASES_FOR_UNITS
Value:
constexpr hart::Unit native = hart::Unit::native; \
constexpr hart::Unit linear = hart::Unit::linear; \
constexpr hart::Unit dB = hart::Unit::dB; \
constexpr hart::Unit frames = hart::Unit::frames; \
constexpr hart::Unit seconds = hart::Unit::seconds; \
constexpr hart::Unit Hz = hart::Unit::Hz; \
constexpr hart::Unit ratio = hart::Unit::ratio; \
constexpr hart::Unit none = hart::Unit::none;
Unit
Represents a physical unit.
@ none
Unitless value.
@ dB
Value of something in decibels. Can represent voltage, power, or a domain-specific unit like "LUFS" o...
@ seconds
Time stamps, intervals, durations.
@ ratio
Generic ratio.
@ native
Default (native) unit of whatever returns some value.
@ linear
Value of a sample (voltage) in a linear domain.
@ Hz
Hertz.
@ frames
Value of something in frames (samples)

Pre-C++20 macro to use units without namespace.

For C++20 and later, you can just use using enum Unit

Definition at line 36 of file hart_units.hpp.

Function Documentation

◆ operator""_s() [1/2]

constexpr double operator""_s ( long double  val)
constexpr

Definition at line 52 of file hart_units.hpp.

◆ operator""_s() [2/2]

constexpr double operator""_s ( unsigned long long int  val)
constexpr

Definition at line 53 of file hart_units.hpp.

◆ operator""_ms() [1/2]

constexpr double operator""_ms ( long double  val)
constexpr

Definition at line 54 of file hart_units.hpp.

◆ operator""_ms() [2/2]

constexpr double operator""_ms ( unsigned long long int  val)
constexpr

Definition at line 55 of file hart_units.hpp.

◆ operator""_us() [1/2]

constexpr double operator""_us ( long double  val)
constexpr

Definition at line 56 of file hart_units.hpp.

◆ operator""_us() [2/2]

constexpr double operator""_us ( unsigned long long int  val)
constexpr

Definition at line 57 of file hart_units.hpp.

◆ operator""_ns() [1/2]

constexpr double operator""_ns ( long double  val)
constexpr

Definition at line 58 of file hart_units.hpp.

◆ operator""_ns() [2/2]

constexpr double operator""_ns ( unsigned long long int  val)
constexpr

Definition at line 59 of file hart_units.hpp.

◆ operator""_dB() [1/2]

constexpr double operator""_dB ( long double  val)
constexpr

Definition at line 60 of file hart_units.hpp.

◆ operator""_dB() [2/2]

constexpr double operator""_dB ( unsigned long long int  val)
constexpr

Definition at line 61 of file hart_units.hpp.

◆ operator""_dBTP() [1/2]

constexpr double operator""_dBTP ( long double  val)
constexpr

Definition at line 62 of file hart_units.hpp.

◆ operator""_dBTP() [2/2]

constexpr double operator""_dBTP ( unsigned long long int  val)
constexpr

Definition at line 63 of file hart_units.hpp.

◆ operator""_Hz() [1/2]

constexpr double operator""_Hz ( long double  val)
constexpr

Definition at line 64 of file hart_units.hpp.

◆ operator""_Hz() [2/2]

constexpr double operator""_Hz ( unsigned long long int  val)
constexpr

Definition at line 65 of file hart_units.hpp.

◆ operator""_kHz() [1/2]

constexpr double operator""_kHz ( long double  val)
constexpr

Definition at line 66 of file hart_units.hpp.

◆ operator""_kHz() [2/2]

constexpr double operator""_kHz ( unsigned long long  val)
constexpr

Definition at line 67 of file hart_units.hpp.

◆ operator""_rad() [1/2]

constexpr double operator""_rad ( long double  val)
constexpr

Definition at line 68 of file hart_units.hpp.

◆ operator""_rad() [2/2]

constexpr double operator""_rad ( unsigned long long  val)
constexpr

Definition at line 69 of file hart_units.hpp.

◆ operator""_deg() [1/2]

constexpr double operator""_deg ( long double  val)
constexpr

Definition at line 70 of file hart_units.hpp.

◆ operator""_deg() [2/2]

constexpr double operator""_deg ( unsigned long long  val)
constexpr

Definition at line 71 of file hart_units.hpp.

◆ operator""_cents() [1/2]

constexpr double operator""_cents ( long double  val)
constexpr

Definition at line 72 of file hart_units.hpp.

◆ operator""_cents() [2/2]

constexpr double operator""_cents ( unsigned long long  val)
constexpr

Definition at line 73 of file hart_units.hpp.

◆ operator""_dB_as_ratio() [1/2]

double operator""_dB_as_ratio ( long double  val)
inline

Definition at line 75 of file hart_units.hpp.

◆ operator""_dB_as_ratio() [2/2]

double operator""_dB_as_ratio ( unsigned long long int  val)
inline

Definition at line 76 of file hart_units.hpp.

◆ operator""_ratio_as_dB() [1/2]

double operator""_ratio_as_dB ( long double  val)
inline

Definition at line 77 of file hart_units.hpp.

◆ operator""_ratio_as_dB() [2/2]

double operator""_ratio_as_dB ( unsigned long long int  val)
inline

Definition at line 78 of file hart_units.hpp.

Variable Documentation

◆ inf_dB

constexpr double inf_dB = hart::inf
constexpr

Definition at line 46 of file hart_units.hpp.

◆ oo_dB

constexpr double oo_dB = hart::inf
constexpr

Definition at line 47 of file hart_units.hpp.

◆ pi_rad

constexpr double pi_rad = hart::pi
constexpr

Definition at line 48 of file hart_units.hpp.

◆ twoPi_rad

constexpr double twoPi_rad = hart::twoPi
constexpr

Definition at line 49 of file hart_units.hpp.

◆ halfPi_rad

constexpr double halfPi_rad = hart::halfPi
constexpr

Definition at line 50 of file hart_units.hpp.