Audacity 3.2.0
TimeSnapFunctions.cpp
Go to the documentation of this file.
1
2/* SPDX-License-Identifier: GPL-2.0-or-later */
3/*!********************************************************************
4
5 Audacity: A Digital Audio Editor
6
7 TimeSnapFunctions.cpp
8
9 Dmitry Vedenko
10
11**********************************************************************/
12
13#include "SnapUtils.h"
14#include "ProjectRate.h"
15
16namespace
17{
19{
21}
22
24 SnapFunctionItems("time",
26 "time", { XO("Seconds && samples"), false },
27 TimeInvariantSnapFunction("seconds", XO("Seconds"), 1.0),
28 TimeInvariantSnapFunction("deciseconds", XO("Deciseconds"), 10.0),
29 TimeInvariantSnapFunction("centiseconds", XO("Centiseconds"), 100.0),
30 TimeInvariantSnapFunction("milliseconds", XO("Milliseconds"), 1000.0),
31 TimeInvariantSnapFunction("samples", XO("Samples"), SnapToSamples))
32 ),
34};
35}
XO("Cut/Copy/Paste")
an object holding per-project preferred sample rate
std::unique_ptr< SnapRegistryItem > TimeInvariantSnapFunction(const Identifier &functionId, const TranslatableString &label, MultiplierFunctor functor)
Definition: SnapUtils.cpp:286
constexpr auto SnapFunctionGroup
Definition: SnapUtils.h:98
constexpr auto SnapFunctionItems
Definition: SnapUtils.h:123
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
double GetRate() const
Definition: ProjectRate.cpp:53
Generates classes whose instances register items at construction.
Definition: Registry.h:388
double SnapToSamples(const AudacityProject &project)
SnapRegistryItemRegistrator secondsAndSamples