
     CDP (12 Feb 1996)       Command Line CD Player                     CDP



     NAME:

          CDP - Command line Audio CD player

     SYNOPSIS:

          cdp [{option | command}]


     DESCRIPTION:

          cdp is a command line driven audio CD player, which need not
          MSCDEX loaded and does not stay resident (no TSR).

          To  bypass  MSCDEX  saves  approximately  16KB  memory,  but
          requires a little bit more setup.  That also means, that the
          audio tracks can  be  accessed  now,  but  the  data  tracks
          cannot.  But nonetheless, if MSCDEX is loaded, cdp will work
          properly.

          cdp does not stay resident, what means, that it will not use
          any memory after execution.  This also means, that there are
          no  such  functions like play randomly or play continuously,
          because both would  require  that  cdp  stays  resident  and
          aquires memory and time.

          All  options  and commands are processed from left to right.
          See the EXAMPLES section for more details.

          If no command is specified  on  the  command  line,  one  is
          assumed.  See the DEFAULT ACTION section.

          Before  processing any command line argument the contents of
          the environment variable "SKAUS18A" is processed.   It  will
          be  interpreted the same way as if it would be a part of the
          command  line,  except  that  all  non-option  keywords  are
          ignored.   For instance, if the environment variable was set
          with "SET SKAUS18A= /D:NECD001 /U:2  play",  any  subsequent
          start  of  cdp  acts  as if "/D:NECD001" and "/U:2" had been
          typed as the first two arguments.   The  command  "play"  is
          ignored.  Invalid options cause an error.


     OPTIONS:


      /? and /h Display a help screen.

      /D:name  Use  the  driver  name  for accessing the CD-ROM drive.
          This is the same name as of the option of  MSCDEX  with  the
          same  name, and, mostly, of the option of your CD-ROM driver
          with the same name.  Unless  changed  by  CD_INST  the  name
          defaults to: "MSCD001".

      /D Reset the driver name to the default value.

      /U:# Use  the unit number # of the CD-ROM drive.  Unless changed


                                      -1-


     CDP (12 Feb 1996)       Command Line CD Player                     CDP


          by CD_INST the unit number defaults to: "0".

      /U Reset the value to the default value.

      /[+-]A Auto-Unlock. If the '+' sign is supplied, Auto-Unlock  is
          active;  if  the '-' sign is supplied, Auto-Unlock disabled;
          otherwise the actual value is toggled.   Unless  changed  by
          CD_INST the value defaults to: "disabled".

          CD-ROM  drives with a tray allows to open and close the tray
          automaticly.  To avoid problems when the door is opened at a
          wrong time, the door can be locked.    Auto-Unlock  controls
          whether  or  not  this  lock  is  automaticly  removed, if a
          command to open the door is to be executed.

      /V Display version information, then exit.


     COMMANDS:


          Each command may be abbreviated down to the string  left  of
          the paranthise  and will ignore the case of the letters.  Do
          not include the paranthise in the command!

          If the command needs a closed door in order to be  processed
          but  the  door is currently opened, the "close" command will
          be executed prior the command itself.

      e)ject Open the door.  If the door is locked and Auto-Unlock  is
          disabled, an  error  occures.  This command is not available
          at all CD-ROM drives.

      c)lose Close the door and initialize the  CD-ROM  drive.    This
          procedure includes to stop audio playing.  To close the tray
          is not supported by all CD-ROM drives.

      s)tatus Display  the  status of the CD-ROM drive.  This contains
          more or less useful information.

      sto)p This is equal to the close command.

      l)ock Lock the door.  To lock the door is not supported  by  all
          CD-ROM drives.

      u)nlock Unlock  the  door.  To lock the door is not supported by
          all CD-ROM drives.

      t)racks Display an overview of all tracks  of  the  CD-ROM.  The
          following information are displayed:

             Tracks: 1 - 17
             Size: 55 min 34 sec 15 frames
             UPC/EAN: ??????????????

               Trk    start    length   track  Cpy Aud Pre
               N   Mn Sc Fm  Mn Sc Fm  type   Pro Chn Emp
               001  00 02 00  14 36 55  data   yes  2  no


                                      -2-


     CDP (12 Feb 1996)       Command Line CD Player                     CDP


               002  14 38 55  03 36 16  audio  yes  2  no

          Line 1 tells how many tracks are available on the CD.
          Line  2  tells  the  total size of the CD including any data
          tracks.
          Line 3 shows the UPC/EAN code.  This code should identify  a
          specific  CD  series,  but  currently only few CDs have such
          code.
          Line 4 and 5 are the header and beginning with  Line  6  the
          body of  the track table.  Each track contains the following
          information, from left to right:
              1) track number,
              2) start minute, second, frame,
              3) length of the track minute, second, frame,
              4) data or audio track,
              5) copy protected yes/no,
              6) number of audio channels, and
              7) pre-emphasis yes/no.

          Note: There is no built-in pager for the output.    To  page
          the  output  just  pipe  the command into more, for example:
          "cdp tracks | more".

      p)lay Play audio tracks.  An additional argument  may  tell  cdp
          which tracks shall be played.  This argument looks like:
             # To play only track #
             #- To play all tracks beginning at #
             #-# To play the tracks from # to #
          Without  this  argument "1-" is assumed, what means that the
          whole CD will be played.  No whitespaces are allowed  around
          the dash!

          If  one  of  the  track numbers identifies a data track or a
          non-existing track, this track is skipped, but no warning is
          issued.  After successfully initiating the  audio  play  the
          message   "CDP:  Playing  tracks  #-#."  will  be  displayed
          informing about which tracks are really played.

      i)splaying Test, if audio is playing.  If audio is NOT  playing,
          cdp  will  be terminated with the errorlevel 100. Otherwise,
          the next command will be executed.   This  can  be  used  to
          determine,  whether  or  not  an  audio  track  is currently
          playing.  See section EXAMPLES.

      n)otplaying This  is  the  opposite  of  isplaying.    It   will
          terminate with the errorlevel 100, if audio IS playing.


     DEFAULT ACTION:


          When  no  command  is  specified  on command line, a default
          action will be initiated.  This action depends on the actual
          name of the executable.  If the executable's file name start
          with one of the following names, the equally  named  command
          will be activated:
             EJECT
             CLOSE


                                      -3-


     CDP (12 Feb 1996)       Command Line CD Player                     CDP


          Otherwise the default action is "PLAY".


     KNOWN BUGS:

      o The  error  handling  is  not  great.   When some message like
          "Error 10" is displayed, the CD-ROM driver did not activated
          a function as it  should  at  this  time.    This  can  have
          multiple reasons, for example:
              a)  the CD-ROM settings are invalid (see options /D: and
              /U:),
              b) the CD-ROM is accessed as data CD,
              c) the drive was busy while initiating the command,  but
              did not notifed the driver (opening/closing the door).


     EXAMPLES:


      cdp
          Start  playing  the whole CD ignoring all CD-ROM data tracks
          and close the tray, if it is currently opened.

      ejectcd
          Eject the disk.  This requires that the executable has  been
          renamed  or  copied to "ejectcd.com", for instance by typing
          "REN CDP.COM EJECTCD.COM" or "COPY CDP.COM EJECTCD.COM".

      ejectcd 10-
          Play all audio tracks beginning with track "10".

      cdp /d:opt /u:3 e /d 4
          Eject the disk of the driver "OPT" subunit 3, then play  the
          audio track "4" of the default driver subunit 3.

      cdp isplaying
          The batch script:
              @echo off
              cdp i
              if not errorlevel 1 goto isPlaying
              if errorlevel 100 if not errorlevel 101 goto notPlaying
              echo An error occured.
              goto end
              :notPlaying
              echo Audio is not playing.
              goto end
              :isPlaying
              echo Audio is playing.
              :end
          determines   the  state  of  audio  playing  and  echos  the
          appropriate message.

      cdp isplaying stop
          If  the  audio  is  playing,  the  play  will  be   stopped.
          Otherwise, no  changes  are  made  to the CD-ROM drive.  The
          command "stop" alone would close the tray and initialize the
          CD-ROM driver.



                                      -4-


     CDP (12 Feb 1996)       Command Line CD Player                     CDP


     ERRORLEVELS:


          The following errorlevels have a specific meaning:

      0 No error occured.

      127 Help screen issued.

      100 The commands "isplaying" or "notplaying" found the  opposite
          situation.

      otherwise An error occured.


     CONTRIBUTERS:

                            Steffen Kaiser
                       Ernst-Thlmann-Strae 2
                             D-39606 Iden
                        Deutschland - Germany

          e-mail: Steffen.Kaiser@Informatik.TU-Chemnitz.DE





































                                      -5-

