|
HART
0.2.0
High level Audio Regression and Testing
|
Checks whether the audio is identical to some signal. More...
#include <hart_equalsto.hpp>
Public Member Functions | |
| EqualsTo (std::unique_ptr< SignalBase< SampleType > > &&referenceSignal, double toleranceLinear=(SampleType) 1e-5) | |
| Creates a matcher for a specific signal by transfering smart pointer details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes. | |
| EqualsTo (const SignalBase< SampleType > &referenceSignal, double toleranceLinear=(SampleType) 1e-5) | |
| Creates a matcher for a specific signal by copying it details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes. | |
| EqualsTo (SignalBase< SampleType > &&referenceSignal, double toleranceLinear=(SampleType) 1e-5) | |
| Creates a matcher for a specific signal by moving it details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes. | |
| EqualsTo (EqualsTo &&other) noexcept | |
| EqualsTo (const EqualsTo &other) | |
| EqualsTo & | operator= (const EqualsTo &other) |
| EqualsTo & | operator= (EqualsTo &&other) noexcept |
| ~EqualsTo () override=default | |
| void | prepare (double sampleRateHz, size_t numChannels, size_t maxBlockSizeFrames) 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. | |
| bool | match (const AudioBuffer< SampleType > &observedAudio) override |
| Tells the host if the piece of audio satisfies Matcher's condition or not. | |
| bool | canOperatePerBlock () override |
| Tells the host if it can operate on a block-by-block basis. | |
| void | reset () override |
| Resets the matcher to its initial state. | |
| virtual MatcherFailureDetails | getFailureDetails () const override |
| Returns a description of why the match has failed. | |
| void | represent (std::ostream &stream) const override |
| Makes a text representation of this Matcher for test failure outputs. | |
Public Member Functions inherited from Matcher< SampleType, EqualsTo< 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. | |
| EqualsTo< SampleType > & | atChannels (std::initializer_list< size_t > channelsToMatch) |
| Makes this matcher check only specific channels, and ignore the rest. | |
| EqualsTo< SampleType > & | atChannel (size_t channelToMatch) |
| Makes this matcher check only one specific channel, and ignore the rest. | |
| EqualsTo< SampleType > & | atAllChannels () |
| Makes this matcher check all channels. | |
| EqualsTo< 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 |
Additional Inherited Members | |
Protected Member Functions inherited from Matcher< SampleType, EqualsTo< SampleType > > | |
| bool | appliesToChannel (size_t channel) |
| Indicates whether this matcher should check a specific channel. | |
Protected Attributes inherited from Matcher< SampleType, EqualsTo< SampleType > > | |
| ChannelFlags | m_channelsToMatch |
Related Symbols inherited from Matcher< SampleType, EqualsTo< SampleType > > | |
| std::ostream & | operator<< (std::ostream &stream, const MatcherBase< SampleType > &matcher) |
| Prints readable text representation of the Matcher object into the I/O stream. | |
Checks whether the audio is identical to some signal.
Holds an internal Signal instance, and gets it to generate reference audio as the matcher receives new audio blocks through match(). Reports mismatch if even one of the frames in the audio does not match the reference signal within tolerance specified in epsilon during its instantiation.
Definition at line 22 of file hart_equalsto.hpp.
|
inline |
Creates a matcher for a specific signal by transfering smart pointer details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes.
| referenceSignal | Signal to compare the incoming audio against |
| toleranceLinear | Absolute tolerance for comparing frames, in linear domain (not decibels) |
Definition at line 32 of file hart_equalsto.hpp.
|
inline |
Creates a matcher for a specific signal by copying it details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes.
| referenceSignal | Signal to compare the incoming audio against |
| toleranceLinear | Absolute tolerance for comparing frames, in linear domain (not decibels) |
Definition at line 44 of file hart_equalsto.hpp.
|
inline |
Creates a matcher for a specific signal by moving it details The reference signal can be something simple like a SineWave, or more complex signal with DSP effects chain and automation envelopes.
| referenceSignal | Signal to compare the incoming audio against |
| toleranceLinear | Absolute tolerance for comparing frames, in linear domain (not decibels) |
Definition at line 55 of file hart_equalsto.hpp.
|
inlinenoexcept |
Definition at line 60 of file hart_equalsto.hpp.
|
inline |
Definition at line 67 of file hart_equalsto.hpp.
|
overridedefault |
|
inline |
Definition at line 74 of file hart_equalsto.hpp.
|
inlinenoexcept |
Definition at line 87 of file hart_equalsto.hpp.
|
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.
| sampleRateHz | sample rate at which the audio should be interpreted |
| numChannels | Number of audio channels |
| maxBlockSizeFrames | Maximum block size in frames (samples) |
Implements MatcherBase< SampleType >.
Definition at line 104 of file hart_equalsto.hpp.
|
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 an AudioBuffer 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.
| observedAudio | A piece of audio to check |
Implements MatcherBase< SampleType >.
Definition at line 109 of file hart_equalsto.hpp.
|
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 135 of file hart_equalsto.hpp.
|
inlineoverridevirtual |
Resets the matcher to its initial state.
Implements MatcherBase< SampleType >.
Definition at line 140 of file hart_equalsto.hpp.
|
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
| MatcherFailureDetails::frame | Index of frame at which the match has failed |
| MatcherFailureDetails::channel | Index of channel at which the failure was detected |
| MatcherFailureDetails::description | Readable 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. |
Implements MatcherBase< SampleType >.
Definition at line 145 of file hart_equalsto.hpp.
|
inlineoverridevirtual |
Makes a text representation of this Matcher for test failure outputs.
It is strongly encouraged to follow python's repr() conventions for returned text - basically, put something like "MyClass(value1, value2)" (with no quotes) into the stream whenever possible, or "<Readable info in angled brackets>" otherwise. Also, use built-in stream manipulators like hart::dbPrecision wherever applicable. Use HART_DEFINE_GENERIC_REPRESENT() to get a basic implementation for this method.
| [out] | stream | Output stream to write to |
Implements MatcherBase< SampleType >.
Definition at line 161 of file hart_equalsto.hpp.