[Scummvm-devel] CD sound interface

Marcus Comstedt marcus at mc.pp.se
Wed Mar 20 03:39:08 CET 2002


Hi.

I was looking a bit at adding CD sound support for the Dreamcast port,
but I'm a bit confused by the interface.

First of all, why have two almost identical functions

  void cd_playtrack(int track, int offset, int delay)
  void cd_play(int track, int num_loops, int start_frame)

instead of having one general

  void cd_play(int track, int num_loops, int start_frame, int end_frame)

which subsumes both?  (As far as I can see, "start_frame" and "offset"
are identical, and "delay" would be identical to "end_frame" if one
existed...)  Maybe this is a candidate for refactoring during the
current code freeze?

Secondly, I'm a little unsure about the parameters:

* track

  Is this the actual track number in the TOC, or does it mean
  something like "the n:th audio track", which seems to be what the
  SDL version is actually doing if I read the SDL docs correctly?
  Is it offset; i.e. is the first track specified as number 0 or 1?

* num_loops

  Is it the number of plays, or the number of repeats?  I.e. if the
  sound should be played exactly once, should num_loops be 0 or 1?
  I'm guessing that -1 means infinite looping, is this correct?
  If a start_frame is given, should the repetitions also start at this
  frame?  (I hope this is the case, as then looping could be delegated
  to the drive itself.)


 // Marcus






More information about the Scummvm-devel mailing list