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 343 of file Contrast.cpp.

344 {
345 if( diffdB != diffdB ) // test for NaN, reliant on IEEE implementation
346 return XO("indeterminate");
347 else {
348 if( diffdB != std::numeric_limits<float>::infinity() )
349 /* i18n-hint: dB abbreviates decibels
350 * RMS abbreviates root mean square, a certain averaging method */
351 return XO("%.2f dB RMS").Format( diffdB );
352 else
353 /* i18n-hint: dB abbreviates decibels */
354 return XO("Infinite dB difference");
355 }
356 }
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 358 of file Contrast.cpp.

359 {
360 if( diffdB != diffdB ) //test for NaN, reliant on IEEE implementation
361 return XO("Difference is indeterminate.");
362 else
363 if( fabs(diffdB) != std::numeric_limits<float>::infinity() )
364 /* i18n-hint: dB abbreviates decibels
365 RMS abbreviates root mean square, a certain averaging method */
366 return XO("Difference = %.2f RMS dB.").Format( diffdB );
367 else
368 /* i18n-hint: dB abbreviates decibels
369 RMS abbreviates root mean square, a certain averaging method */
370 return XO("Difference = infinite RMS dB.");
371 }

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 318 of file Contrast.cpp.

319 {
320
321 /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */
322 auto format0 = XO("RMS = %s.");
323
324 /* i18n-hint: dB abbreviates decibels */
325 auto format1 = XO("%s dB");
326
327 TranslatableString value;
328
329 if ( pValue ) {
330 if( fabs( *pValue ) != std::numeric_limits<float>::infinity() ) {
331 auto number = wxString::Format( wxT("%.2f"), *pValue );
332 value = format1.Format( number );
333 }
334 else
335 value = XO("zero");
336 }
337 else
338 value = format1.Format( "" );
339
340 return format0.Format( value );
341 }
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 597 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 570 of file Contrast.cpp.

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