MCPcopy Create free account
hub / github.com/audacity/audacity / FormatRMSMessage

Function FormatRMSMessage

src/effects/Contrast.cpp:318–341  ·  view source on GitHub ↗

Pass nullptr when value is not yet defined

Source from the content-addressed store, hash-verified

316
317 // Pass nullptr when value is not yet defined
318 TranslatableString FormatRMSMessage( float *pValue )
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 }
342
343 TranslatableString FormatDifference( float diffdB )
344 {

Callers 1

OnExportMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected