20template<
typename SampleType>
32 virtual void prepare (
double sampleRateHz, size_t numChannels, size_t maxBlockSizeFrames) = 0;
62 virtual std::unique_ptr<
Matcher<SampleType>>
copy()
const = 0;
89 virtual void represent (std::ostream& stream)
const = 0;
98template <
typename SampleType>
99inline std::ostream& operator<< (std::ostream& stream,
const Matcher<SampleType>& dsp)
101 dsp.represent (stream);
117#define HART_MATCHER_DEFINE_COPY_AND_MOVE(ClassName)
118 std::unique_ptr<Matcher<SampleType>> copy() const override {
119 return hart::make_unique<ClassName> (*this);
121 std::unique_ptr<Matcher<SampleType>> move() override {
122 return hart::make_unique<ClassName> (std::move (*this));
140#define HART_MATCHER_FORBID_COPY_AND_MOVE
141 std::unique_ptr<Matcher<SampleType>> copy() const override {
142 static_assert (false, "This Matcher cannot be copied");
145 std::unique_ptr<Matcher<SampleType>> move() override {
146 static_assert (false, "This Matcher cannot be moved");
154#define HART_MATCHER_DECLARE_ALIASES_FOR(ClassName)
155 namespace aliases_float{
156 using ClassName = hart::ClassName<float>;
158 namespace aliases_double{
159 using ClassName = hart::ClassName<double>;
virtual bool canOperatePerBlock()=0
Tells the host is if can operate on a block-by-block basis.
virtual ~Matcher()=default
Destructor.
virtual void reset()=0
Resets the matcher to its initial state.
virtual std::unique_ptr< Matcher< SampleType > > move()=0
Returns a smart pointer with a moved instance of this object.
virtual void represent(std::ostream &stream) const =0
Makes a text representation of this Macther for test failure outputs.
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 ...
virtual MatcherFailureDetails getFailureDetails() const =0
Returns a description of why the match has failed.
virtual bool match(const AudioBuffer< SampleType > &observedAudio)=0
Tells the host if the piece of audio satisfies Matcher's condition or not.
virtual std::unique_ptr< Matcher< SampleType > > copy() const =0
Returns a smart pointer with a copy of this object.
Details about matcher failure.