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
54
55 //Create a new matcher which matches incoming fingerprints with a database.
56
67
68 //Matches fingerprints to the database and updates internal state
69
76 void olaf_fp_matcher_match(Olaf_FP_Matcher * olaf_fp_matcher, struct extracted_fingerprints * olaf_fps);
77
82
98 void olaf_fp_matcher_callback_print_result(int matchCount, float queryStart, float queryStop, const char* path, uint32_t matchIdentifier, float referenceStart, float referenceStop);
99
105 void olaf_fp_matcher_print_results(Olaf_FP_Matcher * olaf_fp_matcher);
106
112 void olaf_fp_matcher_destroy(Olaf_FP_Matcher * olaf_fp_matcher);
113
114
121 void olaf_fp_matcher_set_header(Olaf_FP_Matcher * fp_matcher, const char * header);
122
123
124#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:273
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:225
void olaf_fp_matcher_print_header(Olaf_FP_Matcher *fp_matcher)
Print a header for the CSV output.
Definition olaf_fp_matcher.c:221
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:267
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:102
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:343
void olaf_fp_matcher_set_header(Olaf_FP_Matcher *fp_matcher, const char *header)
Set the result header for the matcher.
Definition olaf_fp_matcher.c:217
Configuration parameters defining the behaviour of Olaf.
Definition olaf_config.h:51
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:48
const char * header
Definition olaf_fp_matcher.c:60
Olaf_DB * db
Definition olaf_fp_matcher.c:52
Olaf_Config * config
Definition olaf_fp_matcher.c:54
The result of fingerprint extraction: a list of fingerprints with a size.
Definition olaf_fp_extractor.h:63