wmmisc: Bump to version 1.2.
[dockapps.git] / ascd / libworkman / include / wm_cdda.h
blob03689d7a32d466f6966933071021e5c125fcd2a1
1 #ifndef WM_CDDA_H
2 #define WM_CDDA_H
3 /*
4 * $Id: wm_cdda.h,v 1.2 1999/02/14 09:50:46 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
29 * Information about a particular block of CDDA data.
31 struct cdda_block {
32 unsigned char status; /* see below */
33 unsigned char track;
34 unsigned char index;
35 unsigned char minute;
36 unsigned char second;
37 unsigned char frame;
39 /* Average volume levels, for level meters */
40 unsigned char lev_chan0;
41 unsigned char lev_chan1;
43 /* Current volume setting (0-255) */
44 unsigned char volume;
46 /* Current balance setting (0-255, 128 = balanced) */
47 unsigned char balance;
51 * cdda_block status codes.
53 #define WMCDDA_ERROR 0 /* Couldn't read CDDA from disc */
54 #define WMCDDA_OK 1 /* Read this block successfully (raw data) */
55 #define WMCDDA_PLAYED 2 /* Just played the block in question */
56 #define WMCDDA_STOPPED 3 /* Block data invalid; we've just stopped */
57 #define WMCDDA_ACK 4 /* Acknowledgement of command from parent */
58 #define WMCDDA_DONE 5 /* Chunk of data is done playing */
59 #define WMCDDA_EJECTED 6 /* Disc ejected or offline */
62 * Enable or disable CDDA building depending on platform capabilities, and
63 * determine endianness based on architecture. (Gross!)
65 * For header-comfort, the macros LITTLE_ENDIAN and BIG_ENDIAN had to be
66 * renamed. At least Linux does have bytesex.h and endian.h for easy
67 * byte-order examination.
70 #ifdef sun
71 # ifdef SYSV
72 # include <sys/types.h>
73 # include <sys/cdio.h>
74 # ifndef CDROMCDDA
75 # undef BUILD_CDDA
76 # endif
77 # ifdef i386
78 # define WM_LITTLE_ENDIAN 1
79 # define WM_BIG_ENDIAN 0
80 # else
81 # define WM_BIG_ENDIAN 1
82 # define WM_LITTLE_ENDIAN 0
83 # endif
84 # else
85 # undef BUILD_CDDA
86 # endif
87 #endif
89 /* Linux only allows definition of endianness, because there's no
90 * standard interface for CDROM CDDA functions that aren't available
91 * if there is no support.
93 #ifdef linux
94 # include <bytesex.h>
95 # include <endian.h>
97 * XXX could this be a problem? The results are only 0 and 1 because
98 * of the ! operator. How about other linux compilers than gcc ?
100 # define WM_LITTLE_ENDIAN !(__BYTE_ORDER - __LITTLE_ENDIAN)
101 # define WM_BIG_ENDIAN !(__BYTE_ORDER - __BIG_ENDIAN)
102 #endif
105 * The following code shouldn't take effect now.
106 * In 1998, the WorkMan platforms don't support __PDP_ENDIAN
107 * architectures.
111 #if !WM_LITTLE_ENDIAN
112 # if !WM_BIG_ENDIAN
113 # error yet unsupported architecture
114 foo bar this is to stop the compiler.
115 # endif
116 #endif
117 #endif /* WM_CDDA_H */