Module Sdlcdrom

Exception
exception SDLcdrom_exception of string


Types
type cdrom_drive
 

type cdrom_track


type cdrom_drive_status = 
    CD_TRAYEMPTY
  | CD_STOPPED
  | CD_PLAYING
  | CD_PAUSED
  | CD_ERROR


type cdrom_track_type =
    TRACK_AUDIO
  | TRACK_DATA


Operations on a CD-ROM drive

An SDLcdrom_exception is raised on errors
val get_num_drives : unit -> int;;

get_num_drives returns the number of CD-ROM drives on the system
val drive_name : drive:int -> string;;

drive_name drive returns a human-readable, system-dependent identifier for the CD-ROM. drive is the index of the drive. Drive indices start to 0 and end at get_num_drives()-1.
val cd_open : int -> cdrom_drive;;

cd_open drive open a CD-ROM drive for access
val cd_close : cdrom_drive -> unit;;

Closes the handle for the cdrom_drive
val cd_status : cdrom_drive -> cdrom_drive_status;;

This function returns the current status of the given drive.
val cd_play_tracks : cdrom_drive:cdrom_drive -> start_track:int -> 
  start_frame:int -> num_tracks:int -> num_frames:int -> unit;;

Play the given CD with these parameters start_track : int => the starting track start_frame : int => the starting frame ntracks : int => the number of tracks to play nframes : int => the number of frames to play
val cd_play_track : cdrom_drive:cdrom_drive -> n:int -> unit;;

Play the track n on the given cdrom_drive
val cd_pause : cdrom_drive -> unit;;

Pause play
val cd_resume : cdrom_drive -> unit;;

Resume play
val cd_stop : cdrom_drive -> unit;;

Stop play
val cd_eject : cdrom_drive -> unit;;

Eject CD-ROM
Operations on tracks
val cd_get_num_tracks : cdrom_drive -> int;;

Return the number of tracks
val cd_track_num : cdrom_drive:cdrom_drive -> n:int -> cdrom_track;;

Return the Nth track
val cd_track_list : cdrom_drive -> cdrom_track list;;

Return list of track
val track_length : cdrom_track -> int * int;;

Return length of track
val track_type : cdrom_track -> cdrom_track_type;;

Return type of cdrom_track (TRACK_AUDIO or TRACK_DATA)
val cd_track_current_time : cdrom_drive -> int * int ;;

Return the minute and seconds elapted
val cd_current_track : cdrom_drive -> cdrom_track;;

Return the current track played
val track_get_number : cdrom_track -> int ;;

Convert cdrom_track type to int