File: README

package info (click to toggle)
its-playback-time 0.2017-08-30.3c40fd3-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 888 kB
  • sloc: ansic: 15,449; perl: 197; makefile: 29; sh: 1
file content (78 lines) | stat: -rw-r--r-- 3,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
This directory contains `ipbt', a high-tech player for `ttyrec'
files.

`ttyrec' is a program similar to script(1): it records all the
terminal output during a Unix terminal session. Unlike script, it
writes timestamps into the output file as well as raw output data,
so that the session can be played back at the original speed. It is
commonly used for recording games of NetHack. The ttyrec recorder
program can be found at

  http://namazu.org/~satoru/ttyrec/index.html.en

Conventional ttyrec players are little more than a loop
interspersing sleep(2) with write(2); it's easy to pause and
fast-forward, and a particularly advanced player might be able to
rewind by noticing screen clears and using them as marker points
(since replay can be restarted reasonably safely from a screen
clear), but precision single-step backward and forward motion is
entirely beyond such an application.

ipbt works by embedding a terminal emulator: it is essentially a
derivative work of the PuTTY code base. The input file is read in
full and run through the internal terminal emulator, and the
resulting screen states are saved in an internal movie array in such
a way that any screen state (`frame') can be retrieved efficiently.
Once this is done, the player application simply displays a sequence
of frames using libncurses; the user can perform the usual pause and
speed adjustment operations, but can also jump to an arbitrary frame
number and move backwards as well as forwards.

The downside is that ipbt takes time to read the entire input file
before starting. I've been testing it on an 8Mb ttyrec of a NetHack
ascension; on a 1GHz Pentium III it takes about a minute to read the
file. After that setup phase, however, playback is efficient.

Current status of ipbt:
 * Basically works.
 * Amenities such as online help and proper documentation are not
   available yet.
 * Dependent on libncurses; uses the use_default_colors() extension
   function, which means it probably won't compile on other curses
   implementations without a bit of autoconf work.
 * Makefile is rudimentary at best. Porting work required. See the
   TODO file for a full list of desirable features.

Proper documentation has yet to be written (as mentioned above), but
here's a quick list of the available keystrokes during playback:

 * `q' (or `Q') quits ipbt.
 * Space moves on by a frame. Prefix it by a number to move on by
   multiple frames at a time.
 * `b' moves back by a frame. Prefix it by a number to move backwards by
   multiple frames at a time.
 * `o' toggles the on-screen display, which shows the current status
   of ipbt.
 * `L' toggles logarithmic time compression (designed to have little
   effect on small delays but massively compress long ones).
 * Typing a number followed by `x' causes play to proceed at that
   many times normal speed (e.g. `3x' means play at triple speed).
   Typing just `x' is equivalent to `1x': it restores normal speed.
 * `X' is like `x', but slows down rather than speeding up: `2X'
   means half speed and `3X' means one third speed. `X' on its own
   restores normal speed, just like `x'.
 * `g' jumps to the beginning of the animation. Prefixing a number
   jumps to a particular frame.
 * `G' jumps to the end of the animation. Prefixing a number jumps
   to that many frames from the end.
 * `p' (and also `s', for historical reasons) toggles pause mode.
   Pause mode is initially enabled.
 * '/' searches forward for a frame containing the given text.
 * '?' and `\' both search backward for a frame containing the given
   text.
 * `n' repeats the previous search: searches for the same text in
   the same direction (i.e. `go to next match').
 * `N' repeats the previous search in reverse: searches for the same
   text in the opposite direction (i.e. `go to _previous_ match').

Oh, and `ipbt' stands for `It's Play-Back Time'.