4 * $Id: wm_struct.h,v 1.7 1999/05/28 03:35:58 dirk Exp $
6 * This file is part of WorkMan, the civilized CD player library
7 * (c) 1991-1997 by Steven Grimm (original author)
8 * (c) by Dirk Försterling (current 'author' = maintainer)
9 * The maintainer can be contacted by his e-mail address:
10 * milliByte@DeathsDoor.com
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * Structure for a single track. This is pretty much self-explanatory --
32 * one of these exists for each track on the current CD.
36 char *songname
; /* Name of song, dynamically allocated */
37 char *otherdb
; /* Unrecognized info for this track */
39 int length
; /* Length of track in seconds or Kbytes */
40 int start
; /* Starting position (f+s*75+m*60*75) */
41 int volume
; /* Per-track volume (1-32, 0 to disable) */
42 int track
; /* Physical track number */
43 int section
; /* Section number (0 if track not split) */
44 int contd
; /* Flag: continuation of previous track */
45 int avoid
; /* Flag: don't play this track. */
46 int data
; /* Flag: data track */
50 * Structure for internal playlist management. The internal playlist is
51 * simply the list of track ranges that are being played currently. This
52 * is built whenever the CD starts playing; it's used in normal and shuffle
53 * modes as well as playlist mode.
55 * The "starttime" element represents how much time has elapsed by the time
56 * we get to this entry. For instance, if the list begins with a 5-minute
57 * track and a 3-minute track, the third entry would have a starttime of 8
58 * minutes. This is used so that the elapsed play time can be displayed
59 * even in shuffle or playlist modes.
61 * The last member of the list has a start track of 0, and its starttime is
62 * the total playing time of the playlist (which will usually be overestimated,
63 * since we don't play leadouts in some cases.)
67 int start
; /* Start track, or 0 if end of list */
68 int end
; /* last track plus 1 */
69 int starttime
; /* Number of seconds elapsed previously */
73 * Structure for playlists (as seen by the user.) This is simply a name
74 * followed by a zero-terminated list of track numbers to play. The list
75 * is terminated by a NULL name.
79 char *name
; /* Name of this playlist */
80 int *list
; /* List of tracks */
85 char artist
[84]; /* Artist's name */
86 char cdname
[84]; /* Disc's name */
87 int ntracks
; /* Number of tracks on the disc */
88 int length
; /* Total running time in seconds */
89 int autoplay
; /* Start playing CD immediately */
90 int playmode
; /* How to play the CD */
91 int volume
; /* Default volume (1-32, 0 for none) */
92 struct wm_trackinfo
*trk
; /* struct wm_trackinfo[ntracks] */
93 struct wm_playlist
*lists
; /* User-specified playlists */
94 char *whichdb
; /* Which database is this entry from? */
95 char *otherdb
; /* Unrecognized lines from this entry */
97 char *user
; /* Name of originating user */
98 unsigned int cddbid
; /* CDDB-ID of the current disc */
99 struct cdinfo
*next
; /* For browsers, etc. */
102 /* The global variable "cd" points to the struct for the CD that's playing. */
103 extern struct wm_cdinfo
*cd
;
105 struct wm_playlist
*new_list();
110 WM_CDM_BACK
= 0, WM_CDM_TRACK_DONE
= 0,
119 * Drive descriptor structure. Used for access to low-level routines.
123 int fd
; /* File descriptor, if used by platform */
124 char vendor
[32]; /* Vendor name */
125 char model
[32]; /* Drive model */
126 char revision
[32]; /* Revision of the drive */
127 void *aux
; /* Pointer to optional platform-specific info */
128 void *daux
; /* Pointer to optional drive-specific info */
131 int (*get_trackcount
)();
133 int (*get_trackinfo
)();
134 int (*get_drive_status
)();
146 * Structure for information of the usage of cddb.
149 int protocol
; /* 0-off, 1-cddbp, 2-http, 3-htproxy */
150 char cddb_server
[84]; /* host.domain.name:port */
151 char mail_adress
[84]; /* user@domain.name */
152 char path_to_cgi
[84]; /* (/)path/to/cddb.cgi */
153 char proxy_server
[84]; /* host.domain.name:port */
155 extern struct wm_cddb cddb
;
159 * Each platform has to define generic functions, so may as well declare
160 * them all here to save space.
161 * These functions should never be seen outside libworkman. So I don't care
162 * about the wm_ naming convention here.
165 gen_get_trackcount(),
168 gen_get_drive_status(),
178 struct wm_drive
*find_drive_struct();
181 #endif /* WM_STRUCT_H */