HART  0.1.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
Matchers

Check audio. More...

Classes

class  EqualsTo< SampleType >
 Checks whether the audio is identical to some signal. More...
 
class  Matcher< SampleType >
 Base for audio matchers. More...
 
struct  MatcherFailureDetails
 Details about matcher failure. More...
 
class  PeaksAt< SampleType >
 Checks whether the audio peaks at specific level. More...
 
class  PeaksBelow< SampleType >
 Checks whether the audio peaks below specific level. More...
 

Macros

#define HART_MATCHER_DEFINE_COPY_AND_MOVE(ClassName)
 Defines hart::Matcher::copy() and hart::Matcher::move() methods.
 
#define HART_MATCHER_FORBID_COPY_AND_MOVE
 Forbids hart::Matcher::copy() and hart::Matcher::move() methods.
 

Functions

template<typename SampleType >
std::ostream & operator<< (std::ostream &stream, const Matcher< SampleType > &dsp)
 Prints readable text representation of the Matcher object into the I/O stream.
 

Detailed Description

Check audio.

Macro Definition Documentation

◆ HART_MATCHER_DEFINE_COPY_AND_MOVE

#define HART_MATCHER_DEFINE_COPY_AND_MOVE (   ClassName)
Value:
std::unique_ptr<Matcher<SampleType>> copy() const override { \
return hart::make_unique<ClassName> (*this); \
} \
std::unique_ptr<Matcher<SampleType>> move() override { \
return hart::make_unique<ClassName> (std::move (*this)); \
}

Defines hart::Matcher::copy() and hart::Matcher::move() methods.

Put this into your class body's public section if either is true:

  • Your class is trivially copyable and movable
  • You have your Rule Of Five methods explicitly defined in this class (see Rule Of Three/Five/Zero)

If neither of those is true, or you're unsure, use HART_MATCHER_FORBID_COPY_AND_MOVE instead

Despite returning a smart pointer to an abstract Matcher class, those two methods must construct an object of a specific class, hence the mandatory boilerplate methods - sorry!

Parameters
ClassNameName of your class

Definition at line 117 of file hart_matcher.hpp.

◆ HART_MATCHER_FORBID_COPY_AND_MOVE

#define HART_MATCHER_FORBID_COPY_AND_MOVE
Value:
std::unique_ptr<Matcher<SampleType>> copy() const override { \
static_assert (false, "This Matcher cannot be copied"); \
return nullptr; \
} \
std::unique_ptr<Matcher<SampleType>> move() override { \
static_assert (false, "This Matcher cannot be moved"); \
return nullptr; \
}

Forbids hart::Matcher::copy() and hart::Matcher::move() methods.

Put this into your class body's public section if either is true:

  • Your class is not trivially copyable and movable
  • You don't want to trouble yourself with implementing move and copy semantics for your class

Otherwise, use HART_MATCHER_DEFINE_COPY_AND_MOVE() instead. Obviously, you won't be able to pass your class to the host by reference, copy or explicit move, but you still can pass it wrapped into a smart pointer like so:

processAudioWith (hart::make_unique<MyDspType>()).withThis().withThat().process();

But it's still better to get your move and copy semantics figured out - this is a perfect chance to stress-test your effect's resource management, among other things!

Definition at line 140 of file hart_matcher.hpp.

Function Documentation

◆ operator<<()

template<typename SampleType >
std::ostream & operator<< ( std::ostream &  stream,
const Matcher< SampleType > &  dsp 
)
related

Prints readable text representation of the Matcher object into the I/O stream.

Definition at line 99 of file hart_matcher.hpp.