streamtyped IBObjectData Object CustomObject Application TextField Control Responder TextFieldCell ActionCell Movie Helvetica Version 2.51.1 of Courier Button ButtonCell NXImage appIcon Dec 13 1993 LUse the code for whatever you want. Don't pretend that you wrote it, though. LWith code contributions from Christopher Lane (lane@sumex-aim.stanford.edu) SModified for mpeg support by Andreas Windemuth (windemut@cumbnd.bioc.columbia.edu) OWith code fragments from MPEGPlay2.3 by Brian Willoughby (BrianW@SoundS.WA.com) (by Patrick J. Flynn (flynn@eecs.wsu.edu) MenuCell Backward Matrix @:@iiii Expand 2x Reduce 50% Restore Back 1 frame Forward Forward 1 frame ff@@#::s Print... MenuTemplate *@*@ccc Info Panel... Preferences... Help... submenuAction: NXmenuArrow Load... Play... Save current depth... Close Windows Arrange in Front Miniaturize Window Close Window ClipView ScrollView [2@]# Scroller _doScroller: @@@ffs* NXCursor NXibeam ciifffcfffs [11977c]{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Courier;\f2\fmodern Ohlfs;} \margl40 \margr40 \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 Movie 2.51.1: Even more improved TIFF sequence animator \ \b0\fs24 \ Modifications by Andreas Windemuth\ Columbia University\ 630 West 168th St. BB-221\ New York, NY 10032\ windemut@cumbnd.bioc.columbia.edu\ Using some code from MPEGPlay2.3 by\ Brian Willoughby Software Design Engineer, BSEE NCSU\ BrianW@SoundS.WA.com Sound Consulting: Software Design and Development\ NeXTmail welcome\ Original code (mostly intact) by\ Patrick J. Flynn, School of EE&CS, Washington State University,\ Pullman, WA, USA 99164-2752. Email: flynn@eecs.wsu.edu\ Credit also belongs to anybody else who contributed to the code\ without my knowledge.\ New features:\ reads and plays mpeg encoded videos \b\fs36 \ \b0\fs24 displays frames, frame size and frame number while loading\ memory saving play-from-disk mode (no speed control)\ reenabled tiff-sequence input\ New user interace elements:\ \i Open \i0 has been replaced by \i Load \i0 and \i Play, \i0 where \i Load \i0 is just\ like the old \i Open, \i0 and \i Play \i0 plays the movie directly from disk,\ with minimum memory usage for arbitrarily large movies, but\ no control panel, limited speed and no smoothing.\ An additional switch on the control panel for displaying the\ frame number in the picture, without the overhead associated\ with slider update.\ \b\fs36 Movie 2.51: An improved TIFF sequence animator\ \b0\fs24 \ by Patrick J. Flynn\ Assistant Professor\ School of Electrical Engineering and Computer Science\ Washington State University\ Pullman, WA 99164-2752\ \f1 flynn@eecs.wsu.edu\ \f0 \ Additional code contributed by Christopher Lane (lane@sumex-aim.stanford.edu)\ \b Changes 2.5 -> 2.51\ \b0 0. Fixed bug in `Save' code tickled when user is overwriting an existing movie.\ 1. Fixed bug in IB.proj making Preferences unusable.\ 2. This Help text is now selectable so users can copy the tiff2anim script below.\ \b Changes 2.0 -> 2.5: \b0 \ 0. a few bug fixes (probably a few new bugs, too).\ 1. Adjustable cache depth. This is a big win on the NextDimension. The default cache depth can be set via a Preferences panel.\ 2. The user can now choose to have the movie frame number slider track the frames ( \i a la \i0 Movie 1.0) or be disabled during animation ( \i a la \i0 Movie 2.0).\ 3. The movie can be saved using the currently-selected depth. In other words, if you load\ in a 24-bit RGB movie, you can save it as 2-bit grayscale by changing the depth and picking the Save Current Depth menu item. You can't save a movie on top of the original. If you want to replace an existing movie with the one to be saved, it will try to keep the old copy around by renaming it ( \i e.g. \i0 , foo.anim becomes ~foo.anim).\ 4. Movie no longer accepts multi-frame \f1 .tiff \f0 files by default -- recompilation with an appropriate \f1 #define \f0 will being them back. I have already been flamed for stating that Movie 2.0 would be the last version which would accept this file format. However, it is \b terribly easy \b0 to convert a multi-frame \f1 .tiff \f0 into an \f1 .anim \f0 directory.\ Here is a C-shell script which will do that very thing:\ \f1 #!/bin/csh -f\ # Syntax: tiff2anim foo.tiff\ # Note: creates foo.anim\ set bn = `basename $i .tiff`\ set nframes = `tiffutil -info $1 |grep Dir | wc -l | awk '\{print $1\}'`\ if (-d $bn.anim) then\ echo moving existing directory $bn.anim to $bn.anim.old\ mv $bn.anim $bn.anim.old\ endif\ mkdir $bn.anim\ set i = 1\ while ($i <= $n)\ tiffutil -extract `expr $i - 1` $1 -out $bn.anim/$bn.$i.tiff\ @ i++\ exit 0 \f0 \ I wouldn't be surprised if you could do the same thing in one line of perl, but I don't know perl.\ \b Possible future enhancements: \b0 \ 1. support some kind of scripting capability. This could be as simple as a way to specify a per-frame delay, or as complicated as GRASP. My ulterior motive for trashing the multi-frame\ \f1 .tiff \f0 movie format was to support the addition of a script file to the \f1 .anim \f0 directory.\ 2. Support sound tracks.\ I am also open to suggestions for additional enhancements.\ \b\fs36 What's a movie file?\ \b0\fs24 A movie file is an ` \b .anim \b0 ' directory containing frames in individual TIFF files.\ Example: a directory named \b Cows.anim \b0 containing \b0 files with the names \b Cows.1.tiff \b0 , ..., \b Cows.n.tiff \b0 is a valid input `file' for Movie. When you create animations in Icon, they are written to disk in this format.\ \b If Movie is placed in one of the Workspace's standard application directories, double-clicking an .anim directory should fire up Movie and cause it to open the animation in that directory. It's possible that you might have to fiddle with Workspace's Tools inspector to set Movie as the primary application for .anim directories, but I didn't have to on my system.\ \b0 \ \b\fs36 Running the program\ \b0\fs24 Movie doesn't put up any windows right away; it waits for you to open movies (using the `open' item under the Movie menu). You can have multiple movies open and running at the same time. Each open movie has two associated windows. One window displays frames of the movie, and the other is a control panel. The movie window can be resized; this causes all frames of the movie to be recached to reflect the new window size. Some common resizing operations are available as buttons in the control panel and as menu items also.\ \f2 \ \f0\b\fs36 Controls\ \b0\fs24 There are two sliders, eight pushbuttons, a checkbox, and three groups of radio buttons in the Control panel associated with a currently-loaded movie. Play with them!\ The top slider allows you to choose the number of frames per second. If the animation is running, mousing the slider will change the number of frames per second and continue the animation with the new timing information. The actual speed is displayed below this slider (thanks to Christopher Lane for contributing the code for this). The default is 1 fps when a movie is first loaded. The limit on the slider is 200 fps, but unless your images are very small, you probably won't achieve that speed. One data point: on my 20MB NeXTDimension screen, with no swapping underway, I can get better than 35 256x256 8-bit gray-scale frames (cached as 8-bit grayscale) per second running flat-out.\ \b Drawing speed depends on the available hardware, the image depth, the cache depth, the image size, and the system load. \b0 \ The next slider gives you control over the currently-displayed frame. When the animation is running, this slider is disabled.\ The five buttons in the middle allow you to start and stop the free-running display of frames, as well as single-step through them. I am not an artist, so I stole the icons from the SoundEditor .nib file in /NextDeveloper/Examples. Note that you can go both forward and backward through the set of frames. There are menu (and command-key) equivalents for these buttons (see the View menu).\ The `Mode' radio buttons control what happens at the end of the frame set.\ `Loop' means to loop through the frames cotinuously ( \i i.e. \i0 , frame N-1 is followed by frame 0). `Bounce' mode produces a direction reversal at frames 0 and N-1.\ `Once through' makes the animation stop after the end (frame 0 or frame N-1 depending on the direction) is reached.\ The `Speed' radio buttons offer you a choice between the fastest possible animation accompanied by very coarse, jumpy, and useless `actual fps' estimates, and well-synchronized animation with accurate fps estimates and a lower maximum frame rate. If you're after raw speed and don't particularly care if the frames are being displayed as smoothly as possible, use the default Fast&sloppy setting. If you can live with a lower maximum speed but require more synchronization, use Slow&smooth.\ The three buttons at the bottom yield coarse control over the image size. `Double size' doubles the window and image size (duh), `Halve size' does the inverse, and `Restore' restores the size to match the dimensions of the input image. Note: the Movie window is also resizeable using the resize bar at the bottom. When the image is resized (using the bar, the buttons, or their equivalents in the View menu), the action will pause as the frames are recached. There are menu (and command-key) equivalents for these three operations also.\ Two new additions to Movie for version 2.1 are the `Depth' radio button matrix, and the `animate frame# slider' checkbox. The user now can control the number of bits per pixel used when the frames are drawn. The choices are: Default (the default for the system, which is the depth of the deepest available frame buffer), 2-bit grayscale, 8-bit grayscale, 12-bit color, and 24-bit color. The depth of the cache determines how many frames will fit in memory, which in turn determines how long a movie you can run smoothly. Movie is not smooth when cached frames have to be retrieved from disk. If you can live with grayscale instead of color, you can fit a larger movie in memory with a shallower cache.\ While I encourage users to play with this control, here are some words of wisdom [sic].\ 1. If you ONLY have a 2-bit-deep display (non-ND cube or MonoSlab), use the `Default' or `2-bit gray' setting. You are perfectly free to bump up the cache depth, but you won't see any difference (i.e., using a 24-bit cache on a 2-bit display will \b not \b0 magically upgrade your screen to color).\ 2. If you have a 12-bit-deep display (ColorSlab), use 12-bit color if your movie is in color. If your movie is not in color, use 8-bit grayscale. If your slab pages continuously\ while the animation is running and you can live with the degradation, use `2-bit gray'.\ 3. If you have a NextDimension, use the largest depth that lets you run smoothly.\ Regardless of the depth, you will be able to send the movie out to a VCR or monitor.\ You can set the default cache depth for newly-loaded movies using the buttons in the\ Preferences panel. The associated defaults database entry is "Movie DefaultDepth", and valid\ values are "0" (use the default for the display), "2" (2-bit gray), "8" (8-bit gray), "12" (12-bit color), and "24" (24-bit color).\ \b Note: there will be a delay every time you change the Depth buttons on the control panel as the frames are recached. For long and/or deep movies, this delay can be several seconds.\ \b0 \ As mentioned above, you can save the movie in its currently-displayed depth.\ The `animate frame# slider' checkbox controls whether the frame number slider (and the frame number text item above it) track the movie as it is running. It is disabled by default. You can get \b much higher \b0 top speeds when the slider updates are disabled.\ The Edit menu contains a Copy item which copies the currently-displayed frame to the Pasteboard. If the animation is running when Copy is invoked, the animation stops, the copy is performed, and the animation starts again.\ The Print... menu item prints the current frame, stopping animation if necessary (restarting when done).\ Movie windows can be miniaturized by clicking on the miniaturize button on the left side of the title bar. If the movie is running when miniaturization is requested, the animation stops. To eliminate screen clutter, miniaturization causes the control panel to be hidden also. Deminiaturization (double-clicking on the miniwindow) brings both the movie and its control panel back on-screen.\ I hope you enjoy the program. Suggestions for improvements can be emailed to the address at the top of this help text.\ Pat Flynn WindowTemplate iiii***@s@ Panel' Controller ScrollingText Open...1 Open... Field311 Field3 Field31 ControllerInstance MainMenu VersionNumber MenuItem Field1 Field2 Field File's Owner Field5 Button1 [24@] IBControlConnector IBConnector hide: terminate: makeKeyAndOrderFront: copy: open: expand2x: reduce50pct: restore: revStep: stop: fwdStep: print: IBOutletConnector delegate version performMiniaturize: performClose: arrangeInFront: prefs: save: play: