From ca524131a5ae0cc61f8a307f6e4ba130d498a457 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 16 Sep 2021 21:40:24 +0200 Subject: [PATCH] README: describe filter syntax --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1738462..03b91ae 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,15 @@ Open a video. Press `space` to start or stop video playback. Seek with `←` and To add a new event, press the key for the corresponding tag and fill out event details. Custom tags can be defined as a JSON array and loaded at runtime. See `tags.json` for the built‐in example showcasing all supported field types. -Events for `video.mp4` are saved in JSON format in the file `video.mp4.events`. Saved file includes tag definitions, which are loaded automatically when the file is opened. Event timestamps are stored with millisecond precision. +Events for `video.mp4` are saved in JSON format to the file `video.mp4.events`. The saved file includes tag definitions, which are loaded automatically when the video is opened. Event timestamps are stored with millisecond precision. + +### Filter + +Input space‐separated search strings to select a subset of events. Selected events must match each string, either as the tag name or a field value. Tags are matched from the beginning, so `p` will select events tagged `pass` and `penalty`. + +Text and enum fields match when they contain the given search string. Prefixing the string with `=` specifies a complete match. The string `2` thus matches values `123`, `2` and `22`, while `=2` only matches `2`. A boolean field matches when it’s value is true and it’s name starts with the search string. Prefixing the string with `!` inverts the match. + +Finally, a search string can be prefixed with a (prefix of) field name, as in `play:2`. This selects events with a field named `player` whose value matches `2` as above. This can be combined with the `!` and `=` operators, as in `pass:!success`. ## Compiling