Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory Class Referencefinal
Inheritance diagram for anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory:
[legend]
Collaboration diagram for anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory:
[legend]

Public Member Functions

 ParsedNumericConverterFormatterFactory (NumericConverterType type, TranslatableString format)
 
std::unique_ptr< NumericConverterFormatterCreate (const FormatterContext &context) const override
 
bool IsAcceptableInContext (const FormatterContext &context) const override
 
- Public Member Functions inherited from NumericConverterFormatterFactory
virtual ~NumericConverterFormatterFactory ()=default
 
virtual std::unique_ptr< NumericConverterFormatterCreate (const FormatterContext &context) const =0
 
virtual bool IsAcceptableInContext (const FormatterContext &context) const =0
 

Private Attributes

NumericConverterType mType
 
TranslatableString mFormat
 
bool mDependsOnSampleRate
 

Detailed Description

Definition at line 1014 of file ParsedNumericConverterFormatter.cpp.

Constructor & Destructor Documentation

◆ ParsedNumericConverterFormatterFactory()

anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::ParsedNumericConverterFormatterFactory ( NumericConverterType  type,
TranslatableString  format 
)
inline

Definition at line 1018 of file ParsedNumericConverterFormatter.cpp.

1020 : mType { std::move(type) }
1021 , mFormat { std::move(format) }
1022 {
1023 // # in the format means that Sample Rate is used
1024 // to calculate the values. Otherwise, Sample Rate is optional for
1025 // the TIME and DURATION formats and ignored by the others.
1027 }
wxString Debug() const
Format as an English string for debugging logs and developers' eyes, not for end users.
constexpr size_t npos(-1)

References Tuple::detail::npos().

Here is the call graph for this function:

Member Function Documentation

◆ Create()

std::unique_ptr< NumericConverterFormatter > anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::Create ( const FormatterContext context) const
inlineoverridevirtual

Implements NumericConverterFormatterFactory.

Definition at line 1030 of file ParsedNumericConverterFormatter.cpp.

1031 {
1032 if (!IsAcceptableInContext(context))
1033 return {};
1034
1035 return std::make_unique<ParsedNumericConverterFormatter>(
1036 mType, mFormat, context);
1037 }

◆ IsAcceptableInContext()

bool anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::IsAcceptableInContext ( const FormatterContext context) const
inlineoverridevirtual

Implements NumericConverterFormatterFactory.

Definition at line 1039 of file ParsedNumericConverterFormatter.cpp.

1040 {
1041 return !mDependsOnSampleRate || context.HasSampleRate();
1042 }
bool HasSampleRate() const
Returns true if it is possible to get a sample rate from this context.

References FormatterContext::HasSampleRate().

Here is the call graph for this function:

Member Data Documentation

◆ mDependsOnSampleRate

bool anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::mDependsOnSampleRate
private

Definition at line 1048 of file ParsedNumericConverterFormatter.cpp.

◆ mFormat

TranslatableString anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::mFormat
private

Definition at line 1046 of file ParsedNumericConverterFormatter.cpp.

◆ mType

NumericConverterType anonymous_namespace{ParsedNumericConverterFormatter.cpp}::ParsedNumericConverterFormatterFactory::mType
private

Definition at line 1045 of file ParsedNumericConverterFormatter.cpp.


The documentation for this class was generated from the following file: