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 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.

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