HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
NoDenormals< SampleType > Class Template Reference

Checks whether the audio has no denormal values. More...

#include <hart_no_denormals.hpp>

Inheritance diagram for NoDenormals< SampleType >:

Public Member Functions

bool match (const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &observedOutputAudio) override
 Tells the host if the piece of audio satisfies Matcher's condition or not.
 
MatcherFailureDetails getFailureDetails () const override
 Returns a description of why the match has failed.
 
bool canOperatePerBlock () const override
 Tells the host if it can operate on a block-by-block basis.
 
void prepare (double, size_t, size_t) override
 Prepare for processing It is guaranteed that all subsequent process() calls will be in line with the arguments received in this callback. This callback is guaranteed to be called after canOperatePerBlock() If any of the values supplied by this callback are not supported by the matcher, it is expected to act as if the match has failed when match() gets called.
 
 HART_DEFINE_GENERIC_REPRESENT (NoDenormals)
 
- Public Member Functions inherited from Matcher< SampleType, NoDenormals< SampleType > >
virtual std::unique_ptr< MatcherBase< SampleType > > copy () const override
 Returns a smart pointer with a copy of this object.
 
virtual std::unique_ptr< MatcherBase< SampleType > > move () override
 Returns a smart pointer with a moved instance of this object.
 
NoDenormals< SampleType > & atChannels (std::initializer_list< size_t > channelsToMatch) &
 Makes this matcher check only specific channels, and ignore the rest.
 
NoDenormals< SampleType > && atChannels (std::initializer_list< size_t > channelsToMatch) &&
 Makes this matcher check only specific channels, and ignore the rest.
 
NoDenormals< SampleType > & atChannel (size_t channelToMatch) &
 Makes this matcher check only one specific channel, and ignore the rest.
 
NoDenormals< SampleType > && atChannel (size_t channelToMatch) &&
 Makes this matcher check only one specific channel, and ignore the rest.
 
NoDenormals< SampleType > & atAllChannels () &
 Makes this matcher check all channels.
 
NoDenormals< SampleType > && atAllChannels () &&
 Makes this matcher check all channels.
 
NoDenormals< SampleType > & atAllChannelsExcept (std::initializer_list< size_t > channelsToSkip) &
 Makes this matcher check only specific channels, and ignore the rest.
 
NoDenormals< SampleType > && atAllChannelsExcept (std::initializer_list< size_t > channelsToSkip) &&
 Makes this matcher check only specific channels, and ignore the rest.
 
void representWithActiveChannels (std::ostream &stream) const override
 Makes a text representation of this Matcher with optional "atChannels" appendix.
 
- Public Member Functions inherited from MatcherBase< SampleType >
virtual ~MatcherBase ()=default
 
 HART_DEPRECATED ("This match() overload will be removed in HART 1.0.0, use \"match (const AudioBuffer&, const AudioBuffer&)\" instead") virtual bool match(const AudioBuffer< SampleType > &observedAudio)
 Tells the host if the piece of audio satisfies Matcher's condition or not.
 
virtual void reset ()
 Resets the matcher to its initial state.
 
virtual void represent (std::ostream &stream) const =0
 Makes a text representation of this Matcher for test failure outputs.
 

Additional Inherited Members

- Protected Member Functions inherited from Matcher< SampleType, NoDenormals< SampleType > >
bool appliesToChannel (size_t channel)
 Indicates whether this matcher should check a specific channel.
 
- Protected Attributes inherited from Matcher< SampleType, NoDenormals< SampleType > >
ChannelFlags m_channelsToMatch
 

Detailed Description

template<typename SampleType>
class hart::NoDenormals< SampleType >

Checks whether the audio has no denormal values.

This matcher scans the audio signal for denormal (subnormal) floating-point values.

Definition at line 17 of file hart_no_denormals.hpp.

Member Function Documentation

◆ match()

template<typename SampleType >
bool match ( const AudioBuffer< SampleType > &  inputAudio,
const AudioBuffer< SampleType > &  observedOutputAudio 
)
inlineoverridevirtual

Tells the host if the piece of audio satisfies Matcher's condition or not.

It is guaranteed to be called only after prepare(), or not be called at all. It is guaranteed to be handed a pair of AudioBuffers in line with values set by the last prepare() call. If canOperatePerBlock() has returned false, this callback is guaranteed to be handed a full piece of audio to check. Otherwise, it may still get a full piece of audio, or get data on a block-by-block basis.

Parameters
inputAudioA piece of input audio. Some matchers may be based on a relationship between input and output, rather than checking just the output audio. And in a lot of cases Matcher can ingore the input completely.
observedOutputAudioA piece of observed output audio to check
Returns
true if the audio satisfies the Matcher's condition, false otherwise

Reimplemented from MatcherBase< SampleType >.

Definition at line 21 of file hart_no_denormals.hpp.

◆ getFailureDetails()

template<typename SampleType >
MatcherFailureDetails getFailureDetails ( ) const
inlineoverridevirtual

Returns a description of why the match has failed.

It is guaranteed to be called strictly after calling match(), or not called at all

Note
This method is a callback for the test host, so you probably don't need to call it yourself ever. If you're making a custom matcher, use it to communicate the data with test host.
Return values
MatcherFailureDetails::frameIndex of frame at which the match has failed
MatcherFailureDetails::channelIndex of channel at which the failure was detected
MatcherFailureDetails::descriptionReadable description of why the match has failed. Do not include the value of observed frame value or its timing in the description, as well as any of values printed by represent(), as all of this will be added to the output anyway. Also, query hart::CLIConfig for number of displayed decimal places, whenever applicable.
See also
MatcherFailureDetails

Implements MatcherBase< SampleType >.

Definition at line 46 of file hart_no_denormals.hpp.

◆ canOperatePerBlock()

template<typename SampleType >
bool canOperatePerBlock ( ) const
inlineoverridevirtual

Tells the host if it can operate on a block-by-block basis.

Some types of conditions absolutely require having a full piece of audio to produce an appropriate response. For example, hart::PeaksAt matcher. Those types of matchers will return false on this callback. Matcher is guaranteed to receive a full piece of audio if this callback has returned false. Otherwise, it may receive audio either block-by-block basis, or still get a full piece of audio, if the host decides to do so.

Implements MatcherBase< SampleType >.

Definition at line 63 of file hart_no_denormals.hpp.

◆ prepare()

template<typename SampleType >
void prepare ( double  sampleRateHz,
size_t  numChannels,
size_t  maxBlockSizeFrames 
)
inlineoverridevirtual

Prepare for processing It is guaranteed that all subsequent process() calls will be in line with the arguments received in this callback. This callback is guaranteed to be called after canOperatePerBlock() If any of the values supplied by this callback are not supported by the matcher, it is expected to act as if the match has failed when match() gets called.

Parameters
sampleRateHzsample rate at which the audio should be interpreted
numChannelsNumber of audio channels
maxBlockSizeFramesMaximum block size in frames (samples)

Implements MatcherBase< SampleType >.

Definition at line 68 of file hart_no_denormals.hpp.

◆ HART_DEFINE_GENERIC_REPRESENT()

template<typename SampleType >
HART_DEFINE_GENERIC_REPRESENT ( NoDenormals< SampleType )

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