|
HART
0.2.0
High level Audio Regression and Testing
|
Base for audio matchers. More...
#include <hart_matcher.hpp>
Public Member Functions | |
| 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. | |
| Derived & | atChannels (std::initializer_list< size_t > channelsToMatch) |
| Makes this matcher check only specific channels, and ignore the rest. | |
| Derived & | atChannel (size_t channelToMatch) |
| Makes this matcher check only one specific channel, and ignore the rest. | |
| Derived & | atAllChannels () |
| Makes this matcher check all channels. | |
| Derived & | 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 |
| virtual void | prepare (double sampleRateHz, size_t numChannels, size_t maxBlockSizeFrames)=0 |
| 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. | |
| virtual bool | match (const AudioBuffer< SampleType > &observedAudio)=0 |
| Tells the host if the piece of audio satisfies Matcher's condition or not. | |
| virtual bool | canOperatePerBlock ()=0 |
| Tells the host if it can operate on a block-by-block basis. | |
| virtual void | reset ()=0 |
| Resets the matcher to its initial state. | |
| virtual MatcherFailureDetails | getFailureDetails () const =0 |
| Returns a description of why the match has failed. | |
| virtual void | represent (std::ostream &stream) const =0 |
| Makes a text representation of this Matcher for test failure outputs. | |
Protected Member Functions | |
| bool | appliesToChannel (size_t channel) |
| Indicates whether this matcher should check a specific channel. | |
Protected Attributes | |
| ChannelFlags | m_channelsToMatch {true} |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename SampleType > | |
| std::ostream & | operator<< (std::ostream &stream, const MatcherBase< SampleType > &matcher) |
| Prints readable text representation of the Matcher object into the I/O stream. | |
Base for audio matchers.
Those matchers get a piece of audio generated by some DSP effect and asked if if satisfies their condition or not You can inherit from this class to create a new matcher (note the CRTP in the template args here, it's important!):
| SampleType | Type of data in the buffers to be checked, typically float or double. |
| Derived | Subclass for CRTP |
Definition at line 112 of file hart_matcher.hpp.
|
inlineoverridevirtual |
Returns a smart pointer with a copy of this object.
Implements MatcherBase< SampleType >.
Definition at line 119 of file hart_matcher.hpp.
|
inlineoverridevirtual |
Returns a smart pointer with a moved instance of this object.
Implements MatcherBase< SampleType >.
Definition at line 126 of file hart_matcher.hpp.
Makes this matcher check only specific channels, and ignore the rest.
If not set, the matcher applies to all channels by default. If you call this method multiple times, only the last one will be applied. To select only one channel, consider using Matcher::atChannel() instead.
| channelsToMatch | List of channels this matcher should apply to, e.g. {0, 1} or {Channel::left, Channel::right} for left and right channels only. |
hart::Channel Definition at line 138 of file hart_matcher.hpp.
Makes this matcher check only one specific channel, and ignore the rest.
If not set, the matcher applies to all channels by default. If you call this method multiple times, only the last one will be applied. To select multiple channels, use Matcher::atChannels() instead.
| channelToMatch | Channel this matcher should apply to (zero-based), e.g. 0 or Channel::left for left channel. |
hart::Channel Definition at line 161 of file hart_matcher.hpp.
|
inline |
Makes this matcher check all channels.
This is the default setting anyway, so this method is only for cases when you need to override previous atChannel(), `atChannels()` or atAllChannelsExcept() calls.
Definition at line 176 of file hart_matcher.hpp.
Makes this matcher check only specific channels, and ignore the rest.
If not set, matcher checks all channels by default. If you call this method multiple times, only the last one will be applied.
| channelsToSkip | List of channels this matcher should NOT check, e.g. {0, 1} or {Channel::left, Channel::right} to skip left and right channels, and match the rest |
hart::Channel Definition at line 189 of file hart_matcher.hpp.
|
inlineoverridevirtual |
Makes a text representation of this Matcher with optional "atChannels" appendix.
For internal use by hosts, don't override it in custom matchers.
Implements MatcherBase< SampleType >.
Definition at line 205 of file hart_matcher.hpp.
Indicates whether this matcher should check a specific channel.
You might want to use it in the match() callback. See atChannels(), atChannel(), atAllChannels(), atAllChannelsExcept().
Definition at line 224 of file hart_matcher.hpp.
|
protected |
Definition at line 219 of file hart_matcher.hpp.