Audacity
3.2.0
libraries
lib-numeric-formats
NumericConverterFormats.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
/**********************************************************************
3
4
Audacity: A Digital Audio Editor
5
6
@file NumericConverterFormats.h
7
8
Dmitry Vedenko
9
10
**********************************************************************/
11
#pragma once
12
13
#include "
NumericConverterType.h
"
14
#include "
ComponentInterfaceSymbol.h
"
15
16
class
FormatterContext
;
17
18
namespace
NumericConverterFormats
19
{
20
struct
DefaultFormatRegistrator
final
21
{
22
explicit
DefaultFormatRegistrator
(
23
const
NumericConverterType
& type,
const
NumericFormatSymbol
& symbol);
24
};
25
27
NUMERIC_FORMATS_API
NumericFormatSymbol
Default
(
const
NumericConverterType
& type);
28
30
NUMERIC_FORMATS_API
NumericFormatSymbol
Lookup
(
31
const
FormatterContext
& context,
const
NumericConverterType
& type,
32
const
NumericFormatID
& formatIdentifier);
33
34
NUMERIC_FORMATS_API
NumericFormatSymbol
DefaultSelectionFormat
();
35
NUMERIC_FORMATS_API
NumericFormatSymbol
TimeAndSampleFormat
();
36
NUMERIC_FORMATS_API
NumericFormatSymbol
SecondsFormat
();
37
NUMERIC_FORMATS_API
NumericFormatSymbol
HoursMinsSecondsFormat
();
38
NUMERIC_FORMATS_API
NumericFormatSymbol
HundredthsFormat
();
39
NUMERIC_FORMATS_API
NumericFormatSymbol
MillisecondsFormat
();
40
NUMERIC_FORMATS_API
NumericFormatSymbol
HertzFormat
();
41
NUMERIC_FORMATS_API
NumericFormatSymbol
OctavesFormat
();
42
44
NUMERIC_FORMATS_API
NumericFormatID
45
GetBestDurationFormat
(
const
NumericFormatID
& timeFormat);
46
}
ComponentInterfaceSymbol.h
NumericConverterType.h
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition:
ComponentInterfaceSymbol.h:27
FormatterContext
A context in which formatter operates.
Definition:
NumericConverterFormatterContext.h:24
Identifier
An explicitly nonlocalized string, not meant for the user to see.
Definition:
Identifier.h:22
TaggedIdentifier< struct NumericFormatIDTag >
NumericConverterFormats
Definition:
NumericConverterFormats.cpp:30
NumericConverterFormats::HoursMinsSecondsFormat
NUMERIC_FORMATS_API NumericFormatSymbol HoursMinsSecondsFormat()
Definition:
NumericConverterFormats.cpp:96
NumericConverterFormats::MillisecondsFormat
NUMERIC_FORMATS_API NumericFormatSymbol MillisecondsFormat()
Definition:
NumericConverterFormats.cpp:103
NumericConverterFormats::HundredthsFormat
NUMERIC_FORMATS_API NumericFormatSymbol HundredthsFormat()
Definition:
NumericConverterFormats.cpp:110
NumericConverterFormats::DefaultSelectionFormat
NUMERIC_FORMATS_API NumericFormatSymbol DefaultSelectionFormat()
Definition:
NumericConverterFormats.cpp:78
NumericConverterFormats::HertzFormat
NUMERIC_FORMATS_API NumericFormatSymbol HertzFormat()
Definition:
NumericConverterFormats.cpp:117
NumericConverterFormats::SecondsFormat
NUMERIC_FORMATS_API NumericFormatSymbol SecondsFormat()
Definition:
NumericConverterFormats.cpp:90
NumericConverterFormats::Default
NumericFormatSymbol Default(const NumericConverterType &type)
Returns the default format for the type or empty symbol, if no default symbol is registered.
Definition:
NumericConverterFormats.cpp:47
NumericConverterFormats::OctavesFormat
NUMERIC_FORMATS_API NumericFormatSymbol OctavesFormat()
Definition:
NumericConverterFormats.cpp:123
NumericConverterFormats::Lookup
NUMERIC_FORMATS_API NumericFormatSymbol Lookup(const FormatterContext &context, const NumericConverterType &type, const NumericFormatID &formatIdentifier)
Looks up the format, returns Default for the type if the format is not registered.
Definition:
NumericConverterFormats.cpp:62
NumericConverterFormats::GetBestDurationFormat
NUMERIC_FORMATS_API NumericFormatID GetBestDurationFormat(const NumericFormatID &timeFormat)
Return the best duration format for the given time format. Currently is an identity function.
Definition:
NumericConverterFormats.cpp:130
NumericConverterFormats::TimeAndSampleFormat
NUMERIC_FORMATS_API NumericFormatSymbol TimeAndSampleFormat()
Definition:
NumericConverterFormats.cpp:83
NumericConverterFormats::DefaultFormatRegistrator
Definition:
NumericConverterFormats.h:21
NumericConverterFormats::DefaultFormatRegistrator::DefaultFormatRegistrator
DefaultFormatRegistrator(const NumericConverterType &type, const NumericFormatSymbol &symbol)
Definition:
NumericConverterFormats.cpp:31
Generated by
1.9.3