wiki / gindexer / apiedited 2026-07-19
Library API
One header, one config struct, one lookup call.
#include <gindexer/gindexer.h>
gindexer::config cfg;
cfg.dirs = {"/home/user/music"};
cfg.splitter = split; // your artist-splitting logic
gindexer::indexer idx(std::move(cfg));
auto result = idx.lookup("Radiohead", "Creep", "Pablo Honey");
if (result) {
// result->cover — path to the cover art (or the audio file itself
// when the art is embedded; check result->embedded)
// result->artist / title / album — the matched track's tags
}
A miss means the track isn’t in the index — the watcher keeps things current, so “not indexed yet” isn’t a state you see.
Config
dirsRoot directories to scan and watch, recursive.splitterCaller-provided function that splits combined artist strings — "A & B feat. C" versus the single artist the OS reports.cover_patternCase-insensitive filename regex for external art; default cover\.gif.embeddedAlso index tracks whose only art is embedded in the tags; default false.thresholdMinimum fuzzy-match score, default 0.5.exactNormalized string equality instead of bigram similarity; default false.db_pathLMDB directory for a persistent index; omit for in-memory only.
External cover art must sit in the same directory as the audio file it belongs to.
Building
CMake 3.27+ and a C++17 compiler. Dependencies — TagLib, efsw, LMDB, lmdbxx, Catch2 — are fetched automatically via FetchContent:
cmake -B build
cmake --build build
ctest --test-dir build --output-on-failure # with -DBUILD_TESTING=ON
backlinks (1): gindexer/overview