22.1 Cdplayer Interface

ORIGIN '~beta/guienv/guienv';
BODY 'private/cdplayerbody';

-- guienvLib: attributes --


cdPlayer:
  (* This is an interface to controlling the CD player
   * build into the computer.
   *)
  (# <<SLOT cdPlayerLib: attributes>>;
     deviceError:< exception
       (# errMsg: ^text;
       enter errMsg[]
       do INNER deviceError
       #);
     allocationError:< exception
       (# errMsg: ^text;
       enter errMsg[]
       do INNER allocationError
       #);
     open:<(# ... #);
     close:<
       (# ... #);
     cdPresent:
       (* Tells if a cd is present in the cd drawer. *)
       (# isCDPresent: @boolean;
       ...
       exit isCDPresent
       #);
     play:
       (* Play starting at the specified track number. *)
       (# track: @integer;
       enter track
       ...
       #);
     stop:
       (* Stop playing, rewinding to the start of the CD *)
       (#
       ...
       #);
     pause:
       (* Pause playing. *)
       (#
       ...
       #);
     resume:
       (* Resume playing. *)
       (#
       ...
       #);
     duration:
       (* Return the total running time of the current CD in milliseonds. *)
       (# theDuration: @integer;
       ...
       exit theDuration
       #);
     currentTime:
       (* This is the current time in milliseconds. *)
       (# theTime: @integer;
          theTrack:@integer;
       enter (# enter (theTrack,theTime) ... #)
       exit (# ... exit (theTrack,theTime) #)
       #);
     numberOfTracks:
       (* Return the number of tracks on the current CD. *)
       (# tracks: @integer;
       ...
       exit tracks
       #);
     private: @...;
  #)


22.1 Cdplayer Interface
© 1994-2002 Mjølner Informatics
[Modified: Wednesday July 7th 1999 at 16:22]