#!/bin/csh -f

#this script maps camera numbers to grabbers

# DEFINE YOUR CAMERA SETUP HERE

#set the machines to grab 
# The order defines the camera numbering starting at camera 0 for HD camera 0
# end at camera NUM_VIEWS-1 for the last SD camera
set HMACHINES=(cvphd01 cvphd02 cvphd03 cvphd04 cvphd05 cvphd06 cvphd07 cvphd08);
set NUM_HVIEWS=8;
set SMACHINES=(cvpsd09 cvpsd02 cvpsd10 cvpsd04 cvpsd11 cvpsd06 cvpsd12 cvpsd08);
set NUM_SVIEWS=8;
set NUM_VIEWS=8;

# DEFINE THE GRAB TOOLS HERE

#set the grabber command to use
set SGRAB=/opt/bin/grabber;  
#/vol/v/localsoft/Grabber/beta/last/sgrab;
set SVIDEO=/opt/bin/grabber;   
#/vol/v/localsoft/Grabber/beta/last/svideo;
set HGRAB=/opt/bin/grabber;
#/vol/v/localsoft/Grabber/beta/last/hgrab;
#/vol/v/localsoft/Grabber/beta/last/hgrab;
set HVIDEO=/opt/bin/grabber;      
#/vol/v/localsoft/Grabber/beta/last/hvideo;



if ($#argv == 0) then
  # return the number of views
  echo $NUM_VIEWS
else
  # return the grabber for the given camera
  set CAMERA=$argv[1];
  if ( $CAMERA < $NUM_HVIEWS ) then
    set CAMERA=`expr $CAMERA + 1`;
    echo $HMACHINES[$CAMERA] $HGRAB $HVIDEO
  else 
    if ( $CAMERA < $NUM_VIEWS ) then
      set CAMERA=`expr $CAMERA - $NUM_HVIEWS + 1`;
      echo $SMACHINES[$CAMERA] $SGRAB $SVIDEO
    endif
  endif
endif
