Audacity 3.2.0
Classes | Functions | Variables
anonymous_namespace{SnapUtils.cpp} Namespace Reference

Classes

class  ConstantMultiplierSnapItem
 
class  ProjectDependentMultiplierSnapItem
 

Functions

SnapResult SnapWithMultiplier (double value, double multiplier, bool nearest)
 

Variables

const wxString SnapModeKey = L"/Snap/Mode"
 
const wxString SnapToKey = L"/Snap/To"
 
const wxString OldSnapToKey = L"/SnapTo"
 
const wxString SelectionFormatKey = L"/SelectionFormat"
 
const auto PathStart = L"SnapFunctions"
 

Detailed Description


Audacity: A Digital Audio Editor

SnapUtils.cpp

Dmitry Vedenko

Function Documentation

◆ SnapWithMultiplier()

SnapResult anonymous_namespace{SnapUtils.cpp}::SnapWithMultiplier ( double  value,
double  multiplier,
bool  nearest 
)

Definition at line 187 of file SnapUtils.cpp.

188{
189 if (multiplier <= 0.0)
190 return SnapResult { value, false };
191
192 auto result = nearest ? std::round(value * multiplier) / multiplier :
193 std::floor(value * multiplier) / multiplier;
194
195 return SnapResult { result, true };
196}
fastfloat_really_inline void round(adjusted_mantissa &am, callback cb) noexcept
Definition: fast_float.h:2512

References fast_float::round().

Referenced by anonymous_namespace{SnapUtils.cpp}::ConstantMultiplierSnapItem::SingleStep(), anonymous_namespace{SnapUtils.cpp}::ConstantMultiplierSnapItem::Snap(), and anonymous_namespace{SnapUtils.cpp}::ProjectDependentMultiplierSnapItem::Snap().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ OldSnapToKey

const wxString anonymous_namespace{SnapUtils.cpp}::OldSnapToKey = L"/SnapTo"

Definition at line 23 of file SnapUtils.cpp.

Referenced by ReadSnapMode().

◆ PathStart

const auto anonymous_namespace{SnapUtils.cpp}::PathStart = L"SnapFunctions"

Definition at line 26 of file SnapUtils.cpp.

Referenced by SnapFunctionsRegistry::Registry(), and SnapFunctionsRegistry::Visit().

◆ SelectionFormatKey

const wxString anonymous_namespace{SnapUtils.cpp}::SelectionFormatKey = L"/SelectionFormat"

Definition at line 24 of file SnapUtils.cpp.

Referenced by DeduceSnapTo().

◆ SnapModeKey

const wxString anonymous_namespace{SnapUtils.cpp}::SnapModeKey = L"/Snap/Mode"

Definition at line 21 of file SnapUtils.cpp.

Referenced by ReadSnapMode().

◆ SnapToKey

const wxString anonymous_namespace{SnapUtils.cpp}::SnapToKey = L"/Snap/To"

Definition at line 22 of file SnapUtils.cpp.

Referenced by ReadSnapTo().