File: struct.h

package info (click to toggle)
groovycd 0.51-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 128 kB
  • ctags: 200
  • sloc: ansic: 1,818; makefile: 75
file content (76 lines) | stat: -rw-r--r-- 3,007 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* @(#)struct.h	2.00 12/17/97 */

/*
 * Structure for a single track.  This is pretty much self-explanatory --
 * one of these exists for each track on the current CD.
 */
struct trackinfo {
	char	*songname;	/* Name of song, dynamically allocated */
	char	*otherdb;	/* Unrecognized info for this track */
	char	*otherrc;
	int	min,		// Stuck this in here to ease incorporation
           	sec;	 	// of the cddb algorithms 
        int	length;		/* Length of track in seconds or Kbytes */
	int	start;		/* Starting position (f+s*75+m*60*75) */
	int	volume;		/* Per-track volume (1-32, 0 to disable) */
	int	track;		/* Physical track number */
	int	section;	/* Section number (0 if track not split) */
	char	contd;		/* Flag: continuation of previous track */
	char	avoid;		/* Flag: don't play this track. */
	char	data;		/* Flag: data track */
};

/*
 * Structure for internal playlist management.  The internal playlist is
 * simply the list of track ranges that are being played currently.  This
 * is built whenever the CD starts playing; it's used in normal and shuffle
 * modes as well as playlist mode.
 *
 * The "starttime" element represents how much time has elapsed by the time
 * we get to this entry.  For instance, if the list begins with a 5-minute
 * track and a 3-minute track, the third entry would have a starttime of 8
 * minutes.  This is used so that the elapsed play time can be displayed
 * even in shuffle or playlist modes.
 *
 * The last member of the list has a start track of 0, and its starttime is
 * the total playing time of the playlist (which will usually be overestimated,
 * since we don't play leadouts in some cases.)
 */
struct play {
	int	start;		/* Start track, or 0 if end of list */
	int	end;		/* last track plus 1 */
	int	starttime;	/* Number of seconds elapsed previously */
};

/*
 * Structure for playlists (as seen by the user.)  This is simply a name
 * followed by a zero-terminated list of track numbers to play.  The list
 * is terminated by a NULL name.
 */
struct playlist {
	char	*name;		/* Name of this playlist */
	int	*list;		/* List of tracks */
};

struct cdinfo {
	char	artist[84];	 /* Artist's name */
	char	cdname[84];	 /* Disc's name */
    char	cdnames[168];	 /* CDDB artist and CD name string */
    char	catagory[21];	 /* CDDB catagory */
	int	ntracks;	 /* Number of tracks on the disc */
	int	length;		 /* Total running time in seconds */
	int	autoplay;	 /* Start playing CD immediately */
	int	playmode;	 /* How to play the CD */
	int	volume;		 /* Default volume (1-32, 0 for none) */
	struct trackinfo *trk;	 /* struct trackinfo[ntracks] */
	struct playlist *lists;	 /* User-specified playlists */
	char	*whichdb;	 /* Which database is this entry from? */
	char	*otherdb;	 /* Unrecognized lines from this entry */
	char	*otherrc;
        unsigned long	cddb_id; /* CDDB ID which gets calculated */
};

/* The global variable "cd" points to the struct for the CD that's playing. */
extern struct cdinfo *cd;

/* struct playlist *new_list(); */