home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / internet / freenet / WrkBone001 / Linux / WBone / WorkBone-0.1 / struct.h < prev    next >
C/C++ Source or Header  |  1993-12-08  |  3KB  |  72 lines

  1. /* @(#)struct.h    1.13 11/12/92 */
  2.  
  3. /*
  4.  * Structure for a single track.  This is pretty much self-explanatory --
  5.  * one of these exists for each track on the current CD.
  6.  */
  7. struct trackinfo {
  8.     char    *songname;    /* Name of song, dynamically allocated */
  9.     char    *otherdb;    /* Unrecognized info for this track */
  10.     char    *otherrc;
  11.     int    length;        /* Length of track in seconds or Kbytes */
  12.     int    start;        /* Starting position (f+s*75+m*60*75) */
  13.     int    volume;        /* Per-track volume (1-32, 0 to disable) */
  14.     int    track;        /* Physical track number */
  15.     int    section;    /* Section number (0 if track not split) */
  16.     char    contd;        /* Flag: continuation of previous track */
  17.     char    avoid;        /* Flag: don't play this track. */
  18.     char    data;        /* Flag: data track */
  19. };
  20.  
  21. /*
  22.  * Structure for internal playlist management.  The internal playlist is
  23.  * simply the list of track ranges that are being played currently.  This
  24.  * is built whenever the CD starts playing; it's used in normal and shuffle
  25.  * modes as well as playlist mode.
  26.  *
  27.  * The "starttime" element represents how much time has elapsed by the time
  28.  * we get to this entry.  For instance, if the list begins with a 5-minute
  29.  * track and a 3-minute track, the third entry would have a starttime of 8
  30.  * minutes.  This is used so that the elapsed play time can be displayed
  31.  * even in shuffle or playlist modes.
  32.  *
  33.  * The last member of the list has a start track of 0, and its starttime is
  34.  * the total playing time of the playlist (which will usually be overestimated,
  35.  * since we don't play leadouts in some cases.)
  36.  */
  37. struct play {
  38.     int    start;        /* Start track, or 0 if end of list */
  39.     int    end;        /* last track plus 1 */
  40.     int    starttime;    /* Number of seconds elapsed previously */
  41. };
  42.  
  43. /*
  44.  * Structure for playlists (as seen by the user.)  This is simply a name
  45.  * followed by a zero-terminated list of track numbers to play.  The list
  46.  * is terminated by a NULL name.
  47.  */
  48. struct playlist {
  49.     char    *name;        /* Name of this playlist */
  50.     int    *list;        /* List of tracks */
  51. };
  52.  
  53. struct cdinfo {
  54.     char    artist[84];    /* Artist's name */
  55.     char    cdname[84];    /* Disc's name */
  56.     int    ntracks;    /* Number of tracks on the disc */
  57.     int    length;        /* Total running time in seconds */
  58.     int    autoplay;    /* Start playing CD immediately */
  59.     int    playmode;    /* How to play the CD */
  60.     int    volume;        /* Default volume (1-32, 0 for none) */
  61.     struct trackinfo *trk;    /* struct trackinfo[ntracks] */
  62.     struct playlist *lists;    /* User-specified playlists */
  63.     char    *whichdb;    /* Which database is this entry from? */
  64.     char    *otherdb;    /* Unrecognized lines from this entry */
  65.     char    *otherrc;
  66. };
  67.  
  68. /* The global variable "cd" points to the struct for the CD that's playing. */
  69. extern struct cdinfo *cd;
  70.  
  71. struct playlist *new_list();
  72.