SourceForge.net LogoLinuxFund.org Logo
Home Press Mailing List Documentation Screenshots People SourceForge Downloads

Film Gimp Macro Recorder/Player Design

A macros file, let's call it "example.mcr", may look like this:

mcr "example"
# comment
{File} {Open} "test.xcf" [Esc] <0,142>

Here's how it works:

  1. Selecting a menu choice records the menu name in braces. Incidentally, clicking a button shortcut writes the equivalent menu commands.
  2. Text is verbatim in quotes, except literal quotes are escaped.
  3. Special keys are in brackets, e.g. [Esc] or [F1].
  4. Mousing is written as a binary event dump to an implicit second file -- in this case, example.mc2. The offset and count of the relevant event data
    is in angle brackets. A mouse reference of <1,142> means events 1 through 142 in the associated mouse file (example.mc2). Mouse clicks are recorded as a single event. Drags are multiple events. Each event knows what kind it is, including alt/ctrl/shift status. The next mouse event for this example would be event 143. A single click would be <143,1>. Recorded mouse events are normally packed together. You would not tend to see, although it would be legal, the mouse events <1,142><143,1>. That would instead be <1,143>.
  5. Whitespace between tokens is not significant. Comments go to end of line.

A {Play} menu choice would enable playing back the macro file in Film Gimp. Also could be passed on command line. Hitting {Play}when recording
interactively implicitly stops the macro recorder. There would also be a Stop button, and of course {Record}.

In the future we could play a series of macros for a test suite by launching with 'filmgimp -play test/*.mcr'.


Questions to rower@movieeditor.com
Created December 4, 2002; updated February 9, 2003