KCompactDisc

wm_cdda.h
1 #ifndef WM_CDDA_H
2 #define WM_CDDA_H
3 /*
4  * This file is part of WorkMan, the civilized CD player library
5  * Copyright (C) 1991-1997 by Steven Grimm <[email protected]>
6  * Copyright (C) by Dirk Försterling <[email protected]>
7  * Copyright (C) 2004-2006 Alexander Kern <[email protected]>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the Free
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 #include "wm_cdrom.h"
26 #include "wm_config.h"
27 #include "wm_struct.h"
28 /*
29  * cdda_block status codes.
30  */
31 
32 /*
33  * Enable or disable CDDA building depending on platform capabilities, and
34  * determine endianness based on architecture. (Gross!)
35  *
36  * For header-comfort, the macros LITTLE_ENDIAN and BIG_ENDIAN had to be
37  * renamed. At least Linux does have bytesex.h and endian.h for easy
38  * byte-order examination.
39  */
40 
41 #ifdef HAVE_MACHINE_ENDIAN_H
42  #include <machine/endian.h>
43  #if BYTE_ORDER == LITTLE_ENDIAN
44  #define WM_LITTLE_ENDIAN 1
45  #define WM_BIG_ENDIAN 0
46  #else
47  #define WM_LITTLE_ENDIAN 0
48  #define WM_BIG_ENDIAN 1
49  #endif
50 #elif defined(__sun) || defined(sun)
51 # ifdef SYSV
52 # include <sys/types.h>
53 # include <sys/cdio.h>
54 # ifndef CDROMCDDA
55 # error what to do?
56 # endif
57 # ifdef i386
58 # define WM_LITTLE_ENDIAN 1
59 # define WM_BIG_ENDIAN 0
60 # else
61 # define WM_BIG_ENDIAN 1
62 # define WM_LITTLE_ENDIAN 0
63 # endif
64 # endif
65 
66 /* Linux only allows definition of endianness, because there's no
67  * standard interface for CDROM CDDA functions that aren't available
68  * if there is no support.
69  */
70 #elif defined(__linux__)
71 /*# include <bytesex.h>*/
72 # include <endian.h>
73 /*
74  * XXX could this be a problem? The results are only 0 and 1 because
75  * of the ! operator. How about other linux compilers than gcc ?
76  */
77 # define WM_LITTLE_ENDIAN !(__BYTE_ORDER - __LITTLE_ENDIAN)
78 # define WM_BIG_ENDIAN !(__BYTE_ORDER - __BIG_ENDIAN)
79 #elif defined WORDS_BIGENDIAN
80  #define WM_LITTLE_ENDIAN 0
81  #define WM_BIG_ENDIAN 1
82 #else
83  #define WM_LITTLE_ENDIAN 1
84  #define WM_BIG_ENDIAN 0
85 #endif
86 
87 /*
88  * The following code shouldn't take effect now.
89  * In 1998, the WorkMan platforms don't support __PDP_ENDIAN
90  * architectures.
91  *
92  */
93 
94 #if !defined(WM_LITTLE_ENDIAN)
95 # if !defined(WM_BIG_ENDIAN)
96 # error yet unsupported architecture
97  foo bar this is to stop the compiler.
98 # endif
99 #endif
100 
101 /*
102  * Information about a particular block of CDDA data.
103  */
104 struct cdda_block {
105  unsigned char status;
106  unsigned char track;
107  unsigned char index;
108  unsigned char reserved;
109 
110  int frame;
111  char *buf;
112  long buflen;
113 };
114 
115 struct cdda_device {
116  int fd;
117  int cdda_slave;
118  const char *devname;
119 
120  unsigned char status;
121  unsigned char track;
122  unsigned char index;
123  unsigned char command;
124 
125  int frame;
126  int frames_at_once;
127 
128  /* Average volume levels, for level meters */
129  unsigned char lev_chan0;
130  unsigned char lev_chan1;
131 
132  /* Current volume setting (0-255) */
133  unsigned char volume;
134 
135  /* Current balance setting (0-255, 128 = balanced) */
136  unsigned char balance;
137 
138  struct cdda_block *blocks;
139  int numblocks;
140 
141  struct cdda_proto *proto;
142 };
143 
144 #endif /* WM_CDDA_H */
qreal volume()
KGuiItem stop()
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 23:23:11 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.