![]() |
Audacity 3.2.0
|
Public Member Functions | |
BeatsFormatter (const FormatterContext &context, int fracPart, bool timeFormat) | |
bool | CheckField (size_t fieldIndex, int value) const noexcept |
Check that field exists and has enough digits to fit the value. More... | |
bool | CheckFracField (int newLts) const noexcept |
void | UpdateFields (size_t barsDigits) |
void | UpdateFormat (const AudacityProject &project) |
void | UpdateFormatForValue (double value, bool canShrink) override |
Potentially updates the format so it can fit the value . Default implementation is empty. More... | |
void | UpdateResultString (ConversionResult &result) const |
ConversionResult | ValueToString (double value, bool) const override |
std::optional< double > | StringToValue (const wxString &valueString) const override |
double | SingleStep (double value, int digitIndex, bool upwards) const override |
void | UpdatePrefs () override |
![]() | |
virtual | ~NumericConverterFormatter () |
virtual void | UpdateFormatForValue (double value, bool canShrink) |
Potentially updates the format so it can fit the value . Default implementation is empty. More... | |
virtual ConversionResult | ValueToString (double value, bool nearest) const =0 |
virtual std::optional< double > | StringToValue (const wxString &value) const =0 |
virtual double | SingleStep (double value, int digitIndex, bool upwards) const =0 |
const wxString & | GetPrefix () const |
const NumericFields & | GetFields () const |
const DigitInfos & | GetDigitInfos () const |
![]() | |
Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={}) | |
Constructor supporting type-erased custom allocation/deletion. More... | |
Publisher (Publisher &&)=default | |
Publisher & | operator= (Publisher &&)=default |
Subscription | Subscribe (Callback callback) |
Connect a callback to the Publisher; later-connected are called earlier. More... | |
Subscription | Subscribe (Object &obj, Return(Object::*callback)(Args...)) |
Overload of Subscribe takes an object and pointer-to-member-function. More... | |
![]() | |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Static Public Attributes | |
static constexpr std::array< size_t, 3 > | MIN_DIGITS { 3, 2, 2 } |
static constexpr std::array< size_t, 3 > | UPPER_BOUNDS |
![]() | |
static constexpr bool | notifies_all |
Private Attributes | |
const FormatterContext | mContext |
Observer::Subscription | mTimeSignatureChangedSubscription |
double | mTempo { 0.0 } |
int | mUpperTimeSignature { 0 } |
int | mLowerTimeSignature { 0 } |
const int | mFracPart |
const int | mFieldValueOffset |
std::array< double, 3 > | mFieldLengths {} |
wxString | mBarString |
wxString | mBeatString |
Additional Inherited Members | |
![]() | |
using | message_type = NumericConverterFormatChangedMessage |
using | CallbackReturn = std::conditional_t< true, void, bool > |
using | Callback = std::function< CallbackReturn(const NumericConverterFormatChangedMessage &) > |
Type of functions that can be connected to the Publisher. More... | |
![]() | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
![]() | |
CallbackReturn | Publish (const NumericConverterFormatChangedMessage &message) |
Send a message to connected callbacks. More... | |
![]() | |
virtual void | UpdateSelectedPrefs (int id) |
![]() | |
wxString | mPrefix |
NumericFields | mFields |
DigitInfos | mDigits |
Definition at line 40 of file BeatsNumericConverterFormatter.cpp.
|
inline |
Definition at line 51 of file BeatsNumericConverterFormatter.cpp.
References anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BarString, anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BeatString, ProjectTimeSignature::Get(), and project.
|
inlinenoexcept |
Check that field exists and has enough digits to fit the value.
Definition at line 80 of file BeatsNumericConverterFormatter.cpp.
References anonymous_namespace{BeatsNumericConverterFormatter.cpp}::Get10Pow().
|
inlinenoexcept |
Definition at line 96 of file BeatsNumericConverterFormatter.cpp.
|
inlineoverridevirtual |
Implements NumericConverterFormatter.
Definition at line 303 of file BeatsNumericConverterFormatter.cpp.
References field.
|
inlineoverridevirtual |
Implements NumericConverterFormatter.
Definition at line 268 of file BeatsNumericConverterFormatter.cpp.
References field, and Tuple::detail::npos().
|
inline |
Definition at line 104 of file BeatsNumericConverterFormatter.cpp.
References NumericField::ForRange(), and NumericField::WithDigits().
|
inline |
Definition at line 151 of file BeatsNumericConverterFormatter.cpp.
References ProjectTimeSignature::Get(), and project.
|
inlineoverridevirtual |
Potentially updates the format so it can fit the value
. Default implementation is empty.
Reimplemented from NumericConverterFormatter.
Definition at line 190 of file BeatsNumericConverterFormatter.cpp.
References NumericField::ForRange().
|
inlineoverridevirtual |
Implements PrefsListener.
Definition at line 318 of file BeatsNumericConverterFormatter.cpp.
References anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BarString, anonymous_namespace{BeatsNumericConverterFormatter.cpp}::BeatString, and project.
|
inline |
Definition at line 218 of file BeatsNumericConverterFormatter.cpp.
References NumericConverterFormatter::ConversionResult::fieldValueStrings, and NumericConverterFormatter::ConversionResult::valueString.
|
inlineoverridevirtual |
GetFields().size() == result.fieldValueStrings.size()
Implements NumericConverterFormatter.
Definition at line 227 of file BeatsNumericConverterFormatter.cpp.
References NumericConverterFormatter::ConversionResult::fieldValueStrings.
|
private |
Definition at line 353 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 354 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 338 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 351 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 349 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 347 of file BeatsNumericConverterFormatter.cpp.
|
staticconstexpr |
Definition at line 45 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 345 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 342 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 340 of file BeatsNumericConverterFormatter.cpp.
|
private |
Definition at line 344 of file BeatsNumericConverterFormatter.cpp.
|
staticconstexpr |
Definition at line 46 of file BeatsNumericConverterFormatter.cpp.