#!/bin/sh

# Expects $* to be a list of frames...  in order
#
# $Id: makehologram,v 1.4 2005/10/24 03:32:12 protius Exp $
#
# Copyright (c) 2005 Tommy Johnson  All Rights Reserved
#
#

# Distance from top edge to bottom edge
height=29500
# count from top limit down to top edge  (positive num)
top=2000
# inter-frame settling time (in seconds)
settle=40
# exposure time (in milliseconds)
exposure=34400

list="$*"

count=`echo "$list" | wc -w`
row=`echo "$height $count" | awk ' { print int($1/$2)}' `

echo "there are $count strips"
echo "a single strip is $row steps wide"
echo "exposure is $exposure milliseconds"
echo
echo "Hit ^C /now/ if thats not right..."
echo
echo "walking to the top..."
gototop
echo "walking down to the first strip"
walk -$top

echo "in the initial settling time"
sleep 400

# XXX: disable X cursor

for i in $list
do
	xv -root -quit $i

	echo "starting settle for $i"
	sleep $settle
	echo "now exposing $i"
	expose $exposure
	echo "done...  walking"
	sleep 1
	walk -$row
	# did we hit a limit switch?  Abort...
done
