home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexx_rsp.zip / REXX_RSP.CMD < prev   
OS/2 REXX Batch file  |  1997-06-05  |  9KB  |  277 lines

  1. /*********************************************************************/
  2. /*  FILE NAME:              RSP.CMD                                  */
  3. /*                                                                   */
  4. /*  AUTHOR:                 Kathleen Colina                          */
  5. /*                                                                   */
  6. /*  DATE:                   May 5, 1995                              */
  7. /*                                                                   */
  8. /*  PURPOSE:                Test Digital Video (SMV)                 */
  9. /*                                                                   */
  10. /*  HARDWARE:               1 audio card                             */
  11. /*********************************************************************/
  12.  
  13. /*********************************************************************/
  14. /* Must enter name of output file in order to execute.               */
  15. /*********************************************************************/
  16.  
  17. parse upper arg ERRFILE
  18. ERRFILE = STRIP(ERRFILE)
  19.  
  20. if (ERRFILE = ' ' | ERRFILE = '?')
  21.   then do
  22.          say 'Specify name of output file, (FILENAME FILENAME.OUT)'.
  23.          exit
  24.        end
  25.  
  26. /*********************************************************************/
  27. /* Load the DLL, initialize MCI REXX support                         */
  28. /*********************************************************************/
  29.  
  30. rc = RXFUNCADD('SysSleep','RexxUtil','SysSleep')
  31. rc = RXFUNCADD('mciRxInit','MCIAPI','mciRxInit')
  32. InitRC = mciRxInit()
  33.  
  34.  
  35.    env='OS2ENVIRONMENT'
  36.  
  37.    say "Starting time: "TIME(C)
  38.  
  39.    call SendString "defaultconnection digitalvideo make type wave stream to ampmix01 totype amp stream wait"
  40.    say "#01  connect digitalvideo"
  41.  
  42.    call SendString "Open digitalvideo alias dv1 shareable wait"
  43.    say "#02  open    dv1"
  44.  
  45.    DeviceID = mciRxGetDeviceID(dv1)
  46.    say "#03  get     dv1 device ID"
  47.  
  48.    call SendString "Capability dv1 device type wait"
  49.    say "#04  capability - device type"
  50.  
  51.    call SendString "Capability dv1 can setvolume wait"
  52.    say "#05  capability - setvolume"
  53.  
  54.    call SendString "Set dv1 time format MMTIME wait"
  55.    say "#06  set     dv1 time format"
  56.  
  57.    call SendString "Load dv1 \ulti\movie.avi wait"
  58.    say "#07  load    dv1 movie.avi"
  59.  
  60.    call SendString "Status dv1 volume wait"
  61.    say "#08  status  dv1 volume"
  62.  
  63.    call SendString "Status dv1 length wait"
  64.    say "#09  status  dv1 length"
  65.  
  66.    call SendString "Cue dv1 output wait"
  67.    say "#10  cue     dv1 output"
  68. /*********************************************************************/
  69.    call SendString "Acquire dv1 exclusive instance wait"
  70.    say "#11  acquire dv1 exclusive instance"
  71.    call SysSleep 5
  72.  
  73.    call SendString "Play dv1 from 0"
  74.    say "#12  play    dv1 from 0"
  75.    call SysSleep 10
  76.  
  77.    call SendString "Pause dv1 wait"
  78.    say "#13  pause   dv1"
  79.    call SysSleep 5
  80.  
  81.    call SendString "Resume dv1 wait"
  82.    say "#14  resume  dv1"
  83.    call SysSleep 10
  84. /*********************************************************************/
  85.    call SendString "Seek dv1 to start wait"
  86.    say "#15  seek    dv1 to start"
  87.    call SysSleep 5
  88.  
  89.    call SendString "Play dv1 from 0"
  90.    say "#16  play    dv1 from 0"
  91.    call SysSleep 20
  92.  
  93.    call SendString "Stop dv1 wait"
  94.    say "#17  stop    dv1"
  95.    call SysSleep 5
  96.  
  97.    call SendString "Release dv1 wait"
  98.    say "#18  release dv1"
  99.    call SysSleep 5
  100.  
  101.    call SendString "Acquire dv1 exclusive instance"
  102.    say "#19  acquire dv1 exclusive instance"
  103.    call SysSleep 5
  104.  
  105.    call SendString "Load dv1 \ulti\laserc24.avi wait"
  106.    say "#20  load    dv1 laserc24.avi"
  107.    call SysSleep 5
  108.  
  109.    call SendString "Play dv1 from 0 to 25000"
  110.    say "#21  play    dv1 from 0 to 25000"
  111.    call SysSleep 10
  112.  
  113.    call SendString "Pause dv1 wait"
  114.    say "#22  pause   dv1"
  115.    call SysSleep 5
  116.  
  117.    call SendString "Resume dv1 wait"
  118.    say "#23  resume  dv1"
  119.    call SysSleep 20
  120.  
  121.    call SendString "Stop dv1 wait"
  122.    say "#24  stop    dv1"
  123.    call SysSleep 5
  124.  
  125.    call SendString "Release dv1 wait"
  126.    say "#25  release dv1"
  127.    call SysSleep 5
  128.  
  129.    call SendString "Acquire dv1 exclusive instance"
  130.    say "#26  acquire dv1 exclusive instance"
  131.    call SysSleep 5
  132.  
  133.    call SendString "Load dv1 \ulti\movie.avi wait"
  134.    say "#27  load    dv1 movie.avi"
  135.    call SysSleep 5
  136.  
  137.    call SendString "Play dv1"
  138.    say "#28  play    dv1"
  139.    call SysSleep 10
  140.  
  141. /*********************************************************************/
  142. /* Attempt to acquire first file exclusive instance.  Should         */
  143. /* return Device is Locked.                                          */
  144. /*********************************************************************/
  145.  
  146.    call SendString "Acquire dv1 exclusive instance wait"
  147.    linerc=LINEOUT(ERRFILE,'This string has passed. Expect:  Device is Locked')
  148.    say "#29  acquire dv1 - expected return Device is Locked"
  149.    call SysSleep 10
  150.  
  151.    call SendString "Stop dv1 wait"
  152.    say "#30  stop    dv1"
  153.    call SysSleep 5
  154.  
  155.    call SendString "Release dv1 wait"
  156.    say "#31  release dv1"
  157.    call SysSleep 5
  158.  
  159.    call SendString "Acquire dv1 wait"
  160.    say "#32  acquire dv1"
  161.    call SysSleep 5
  162.  
  163.    call SendString "Load dv1 \ulti\laserc24.avi wait"
  164.    say "#33  load    dv1 laserc24.avi"
  165.    call SysSleep 5
  166.  
  167.    call SendString "Cue dv1 output wait"
  168.    say "#34  cue     dv1 output"
  169.    call SysSleep 5
  170.  
  171.    call SendString "Status dv1 mode wait"
  172.    say "#35  status  dv1 mode"
  173.    call SysSleep 5
  174.  
  175.    call SendString "Release dv1 wait"
  176.    say "#36  release dv1"
  177.    call SysSleep 5
  178.  
  179.    call SendString "Acquire dv1 wait"
  180.    say "#37  acquire dv1"
  181.    call SysSleep 5
  182.  
  183.    call SendString "Play dv1 from 0 to 8000"
  184.    say "#38  play    dv1 0 to 8000"
  185.    call SysSleep 15
  186.  
  187.    call SendString "Stop dv1 wait"
  188.    say "#39  stop    dv1"
  189.    call SysSleep 5
  190.  
  191.    call SendString "Release dv1 wait"
  192.    say "#40  release dv1"
  193.    call SysSleep 5
  194.  
  195.    call SendString "Acquire dv1 wait"
  196.    say "#41  acquire dv1"
  197.    call SysSleep 5
  198.  
  199.    call SendString "Play dv1 from 0"
  200.    say "#42  play    dv1 from 0"
  201.    call SysSleep 20
  202.  
  203.    call SendString "Stop dv1 wait"
  204.    say "#43  stop    dv1"
  205.    call SysSleep 10
  206.  
  207. /*********************************************************************/
  208. /* Close all instances                                               */
  209. /*********************************************************************/
  210.  
  211.    call SendString "Close dv1 wait"
  212.    say "#44  close   dv1"
  213.  
  214.    say "Ending time: "TIME(C)
  215.  
  216.    say "Click on OK button of REXX PROCEDURE HAS ENDED message"
  217.    say "Then close PMREXX by double-click on left icon of title bar"
  218.    say "  "
  219.    say "  "
  220.    say "  "
  221.    say "  "
  222.    say "  "
  223.    say "  "
  224.    say "  "
  225.    say "  "
  226.    say "  "
  227.    say "  "
  228.  
  229. /*********************************************************************/
  230. /* Terminate the REXX command file and Exit (DLL), return code = 0.  */
  231. /*********************************************************************/
  232.                       /****************************************/
  233. MacRC = mciRxExit()   /* Terminate REXX command file          */
  234. call rxqueue 'Set', 'pmrexxque'   /* SET Queue name for PMREXX*/
  235. call lineout 'QUEUE:','1'         /* Add line to Queue        */
  236. exit 0                /* Tell the DLL we're going away        */
  237.                       /****************************************/
  238.  
  239.    say "Test complete"
  240.  
  241. /*********************************************************************/
  242. /* Terminate the REXX command file and Exit (DLL), return code = 0.  */
  243. /*********************************************************************/
  244.                       /****************************************/
  245. MacRC = mciRxExit()   /* Terminate REXX command file          */
  246. call rxqueue 'Set', 'pmrexxque'   /* SET Queue name for PMREXX*/
  247. call lineout 'QUEUE:','1'         /* Add line to Queue        */
  248. exit 0                /* Tell the DLL we're going away        */
  249.                       /****************************************/
  250.  
  251. /*********************************************************************/
  252. /*   --- SendString --                                               */
  253. /* Call DLL function.  Pass the command to process and the           */
  254. /* name of a REXX variable that will recieve textual return          */
  255. /* information.                                                      */
  256. /*********************************************************************/
  257.  
  258. SendString:
  259.    arg CmndTxt
  260.    Zero='0'
  261.    MacRC = mciRxSendString(CmndTxt, 'RetSt', Zero, Zero)
  262.    if (MacRC<>0) then
  263.       do
  264.       ErrRC = MacRC
  265.       linerc=LINEOUT(ERRFILE,'MciCmd=' CmndTxt)
  266.       linerc=LINEOUT(ERRFILE, 'Err:mciRxSendString RC=' ErrRC RetSt)
  267.       MacRC = mciRxGetErrorString(ErrRC, 'ErrStVar')
  268.         linerc=LINEOUT(ERRFILE, ErrStVar)                /***********************/
  269.         MacRC = ErrRC                                    /* return the error rc */
  270.      end                                                 /***********************/
  271.      else
  272.         if (RetSt <> '') then
  273.            linerc=LINEOUT(ERRFILE, CmndTxt 'returned' RetSt)
  274.    return MacRC
  275.  
  276.  
  277.