Skip to content

Latest commit

 

History

History
106 lines (83 loc) · 4.59 KB

advanced.md

File metadata and controls

106 lines (83 loc) · 4.59 KB

Advanced

← README

The panda pushes one glass fader up; above, a curve that starts flat, rises and levels off

Nothing here is needed for everyday use.

Hold

Most hotkey tools run a command once per press, however long the key stays down. With --hold the command itself keeps going: nowplayingseek forward --hold makes a step every interval seconds until nowplayingseek release forward is run — bind the first to the key down and the second to the key up. The release names its direction so that, when fingers roll from one key to the other, letting go of the first does not stop the second; a bare release stops both. A tap is still one step. Another --hold takes over from the one before it, so switching direction needs no release in between, and a hold ends by itself after max_time in case the release never arrives.

[hold]
interval = 0.2
max_time = 60

It does not wait for a step to land before the next one, only for the last: the exit code tells whether the player ended up where the hold left it.

Progressive seek

With --progressive the step grows the longer the key is held, a little at a time. A press is always one whole step. Keep the key down and it glides off in small steps, so a short hold stays short, then gathers pace and settles at two and a half times the step — twenty seconds of holding move about a quarter of an hour of film.

held each step in total
a tap 5 s 0:05
1 s 2.5 s 0:13
2 s 3 s 0:26
3 s 4.5 s 0:44
5 s 7 s 1:40
7 s 10 s 3:05
10 s 12 s 5:49

The curve is start + (max_multiplier − start) · (1 − e^−(held / ramp)²): where it begins, where it settles, and how long it takes to get about two thirds of the way.

[progressive]
start = 0.4
max_multiplier = 2.5
ramp = 6

The curve multiplies whatever step you give: forward 30 --hold --progressive is a 30 s press, then steps from 12 s up to 75 s — six times the pace of the table above. Lower max_multiplier if a long step makes a long hold too fast.

Separate presses no further apart than streak_gap count as one hold and grow the same way, but never drop below a whole step; the other direction, a pause or a seek starts over. When the step was multiplied, the output line ends with the multiplier: ×1.4.

Knob

forward --knob and backward --knob are one click of a keyboard knob. Turned carefully, a click is one step, 5 s; spun fast, up to four steps. The tool tells the two apart by the time since the click before: what a hand does on a real knob, measured on recordings of one —

a turn each click in total
careful: 3-4 clicks, 10-16 a second 5 s 0:15-0:20
three spins with a regrip between them: 17-21 clicks, 30-40 a second up to 20 s 4-6 min
a fast spin that slows down near the place 20 s, then 5 s about 3 min

Up to slow clicks a second a click is step; from fast on it is max_multiplier steps; in between it eases from one to the other. Turning the other way or stopping for longer than streak_gap (a second) starts again from one step; a regrip, a quarter to half a second, does not. A time in the command itself, forward 3 --knob, is the careful click for that binding.

[knob]
step = 5
max_multiplier = 4
slow = 18
fast = 32

Config file

~/.config/nowplayingseek/config.ini ($XDG_CONFIG_HOME/nowplayingseek/config.ini when that is set). The file is optional and so is every key in it. nowplayingseek config init writes one with every key commented out: remove the ; in front of a line to put it in force, and what stays commented keeps following the defaults. nowplayingseek config prints what is in effect.

nowplayingseek config set knob.fast 24 changes one setting without opening the file: the value is checked first, the line is put in force where it stands, and a file that does not exist yet is written as config init would, with this one line live. A config symlinked from dotfiles stays a symlink.

Comments are whole lines starting with ; or #. A config file outlives the version that reads it, so an unknown section or key — a newer release's setting, or an older one's — is ignored: the rest of the file still applies, and the command still runs. It is named once on stderr, with the line number, so a real typo does not pass in silence. A value that does not parse for a key this build does know stops every command with exit 78 and the line number — that is a mistake the tool can prove, not a version difference.