Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
olaf_fp_matcher.h
Go to the documentation of this file.
1// Olaf: Overly Lightweight Acoustic Fingerprinting
2// Copyright (C) 2019-2025 Joren Six
3
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Affero General Public License for more details.
13
14// You should have received a copy of the GNU Affero General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
22
23#ifndef OLAF_FP_MATCHER_H
24#define OLAF_FP_MATCHER_H
25
26 #include "olaf_fp_extractor.h"
27 #include "olaf_db.h"
28 #include "olaf_config.h"
29
30
42 typedef void (*Olaf_FP_Matcher_Result_Callback)(int matchCount, float queryStart, float queryStop, const char* path, uint32_t matchIdentifier, float referenceStart, float referenceStop);
43
50 typedef struct Olaf_FP_Matcher Olaf_FP_Matcher;
51
52 //Create a new matcher which matches incoming fingerprints with a database.
53
63
64 //Matches fingerprints to the database and updates internal state
65
72 void olaf_fp_matcher_match(Olaf_FP_Matcher * olaf_fp_matcher, struct extracted_fingerprints * olaf_fps);
73
78
94 void olaf_fp_matcher_callback_print_result(int matchCount, float queryStart, float queryStop, const char* path, uint32_t matchIdentifier, float referenceStart, float referenceStop);
95
101 void olaf_fp_matcher_print_results(Olaf_FP_Matcher * olaf_fp_matcher);
102
108 void olaf_fp_matcher_destroy(Olaf_FP_Matcher * olaf_fp_matcher);
109
110#endif // OLAF_FP_MATCHER_H
Olaf configuration pramameters.
Olaf fingerprint database.
Olaf fingerprint extractor: combines event points into fingerprints.
void olaf_fp_matcher_print_results(Olaf_FP_Matcher *olaf_fp_matcher)
Print the current results.
Definition olaf_fp_matcher.c:282
void olaf_fp_matcher_match(Olaf_FP_Matcher *olaf_fp_matcher, struct extracted_fingerprints *olaf_fps)
Match fingerprints with the database.
Definition olaf_fp_matcher.c:231
void(* Olaf_FP_Matcher_Result_Callback)(int matchCount, float queryStart, float queryStop, const char *path, uint32_t matchIdentifier, float referenceStart, float referenceStop)
Callback function template to respond to a result.
Definition olaf_fp_matcher.h:42
void olaf_fp_matcher_callback_print_result(int matchCount, float queryStart, float queryStop, const char *path, uint32_t matchIdentifier, float referenceStart, float referenceStop)
Prints a match result using the specified format.
Definition olaf_fp_matcher.c:276
Olaf_FP_Matcher * olaf_fp_matcher_new(Olaf_Config *config, Olaf_DB *db, Olaf_FP_Matcher_Result_Callback callback)
Initialize a new matcher.
Definition olaf_fp_matcher.c:116
void olaf_fp_matcher_destroy(Olaf_FP_Matcher *olaf_fp_matcher)
Free used memory and resources, does not close the database resources!
Definition olaf_fp_matcher.c:354
void olaf_fp_matcher_callback_print_header(void)
Print a header for the CSV output.
Definition olaf_fp_matcher.c:273
Configuration parameters defining the behaviour of Olaf.
Definition olaf_config.h:48
A struct with state information on the data store.
Definition olaf_db.c:27
A matcher matches extracted fingerprints with a database. A struct to keep the internal state of the ...
Definition olaf_fp_matcher.c:54
The result of fingerprint extraction: a list of fingerprints with a size.
Definition olaf_fp_extractor.h:63