Audacity 3.2.0
Namespaces | Functions | Variables
anonymous_namespace{Contrast.cpp} Namespace Reference

Namespaces

namespace  anonymous_namespace{Contrast.cpp}
 

Functions

TranslatableString FormatRMSMessage (float *pValue)
 
TranslatableString FormatDifference (float diffdB)
 
TranslatableString FormatDifferenceForExport (float diffdB)
 

Variables

AttachedWindows::RegisteredFactory sContrastDialogKey
 
AttachedItem sAttachment
 

Function Documentation

◆ FormatDifference()

TranslatableString anonymous_namespace{Contrast.cpp}::FormatDifference ( float  diffdB)

Definition at line 439 of file Contrast.cpp.

440 {
441 if( diffdB != diffdB ) // test for NaN, reliant on IEEE implementation
442 return XO("indeterminate");
443 else {
444 if( diffdB != std::numeric_limits<float>::infinity() )
445 /* i18n-hint: dB abbreviates decibels
446 * RMS abbreviates root mean square, a certain averaging method */
447 return XO("%.2f dB RMS").Format( diffdB );
448 else
449 /* i18n-hint: dB abbreviates decibels */
450 return XO("Infinite dB difference");
451 }
452 }
XO("Cut/Copy/Paste")

References XO().

Referenced by ContrastDialog::results().

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

◆ FormatDifferenceForExport()

TranslatableString anonymous_namespace{Contrast.cpp}::FormatDifferenceForExport ( float  diffdB)

Definition at line 454 of file Contrast.cpp.

455 {
456 if( diffdB != diffdB ) //test for NaN, reliant on IEEE implementation
457 return XO("Difference is indeterminate.");
458 else
459 if( fabs(diffdB) != std::numeric_limits<float>::infinity() )
460 /* i18n-hint: dB abbreviates decibels
461 RMS abbreviates root mean square, a certain averaging method */
462 return XO("Difference = %.2f RMS dB.").Format( diffdB );
463 else
464 /* i18n-hint: dB abbreviates decibels
465 RMS abbreviates root mean square, a certain averaging method */
466 return XO("Difference = infinite RMS dB.");
467 }

References XO().

Referenced by ContrastDialog::OnExport().

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

◆ FormatRMSMessage()

TranslatableString anonymous_namespace{Contrast.cpp}::FormatRMSMessage ( float *  pValue)

Definition at line 414 of file Contrast.cpp.

415 {
416
417 /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
418 auto format0 = XO("RMS = %s.");
419
420 /* i18n-hint: dB abbreviates decibels */
421 auto format1 = XO("%s dB");
422
423 TranslatableString value;
424
425 if ( pValue ) {
426 if( fabs( *pValue ) != std::numeric_limits<float>::infinity() ) {
427 auto number = wxString::Format( wxT("%.2f"), *pValue );
428 value = format1.Format( number );
429 }
430 else
431 value = XO("zero");
432 }
433 else
434 value = format1.Format( "" );
435
436 return format0.Format( value );
437 }
wxT("CloseDown"))
Holds a msgid for the translation catalog; may also bind format arguments.
TranslatableString & Format(Args &&...args) &
Capture variadic format arguments (by copy) when there is no plural.

References TranslatableString::Format(), wxT(), and XO().

Referenced by ContrastDialog::OnExport().

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

Variable Documentation

◆ sAttachment

AttachedItem anonymous_namespace{Contrast.cpp}::sAttachment
Initial value:
{
Command( wxT("ContrastAnalyser"), XXO("Contrast..."),
wxT("Ctrl+Shift+T") ),
wxT("Analyze/Analyzers/Windows")
}
const ReservedCommandFlag & AudioIONotBusyFlag()
const ReservedCommandFlag & TimeSelectedFlag()
const ReservedCommandFlag & WaveTracksSelectedFlag()
XXO("&Cut/Copy/Paste Toolbar")
constexpr auto Command
Definition: MenuRegistry.h:456

Definition at line 688 of file Contrast.cpp.

◆ sContrastDialogKey

AttachedWindows::RegisteredFactory anonymous_namespace{Contrast.cpp}::sContrastDialogKey
Initial value:
{
[]( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
auto &window = GetProjectFrame(parent);
&window, -1, XO("Contrast Analysis (WCAG 2 compliance)"),
wxPoint{ 150, 150 }
);
}
}
#define safenew
Definition: MemoryX.h:10
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90

Definition at line 661 of file Contrast.cpp.

Referenced by anonymous_namespace{Contrast.cpp}::anonymous_namespace{Contrast.cpp}::OnContrast().