Mercurial > audlegacy
annotate Plugins/Input/cdaudio/cdaudio.h @ 1625:79891e2fd8a5 trunk
[svn] - use $(SHARED_SUFFIX)
- use $(PICFLAGS)
- use $(PICLDFLAGS)
author | nenolod |
---|---|
date | Wed, 06 Sep 2006 13:21:40 -0700 |
parents | 705d4c089fce |
children | cc5952675fca |
rev | line source |
---|---|
61 | 1 /* XMMS - Cross-platform multimedia player |
2 * Copyright (C) 1998-2002 Peter Alm, Mikael Alm, Olle Hallnas, | |
3 * Thomas Nilsson and 4Front Technologies | |
4 * Copyright (C) 1999-2002 Haavard Kvaalen | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
1459 | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
61 | 19 */ |
20 #ifndef CDAUDIO_H | |
21 #define CDAUDIO_H | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 # include "config.h" | |
25 #endif | |
26 | |
27 #include <glib.h> | |
28 #include <gtk/gtk.h> | |
29 #include "audacious/plugin.h" | |
30 | |
31 #include "cdinfo.h" | |
32 | |
33 #ifdef HAVE_OSS | |
34 #include <Output/OSS/soundcard.h> | |
35 #endif | |
36 | |
37 #ifdef HAVE_MNTENT_H | |
38 #include <mntent.h> | |
39 #endif | |
40 | |
41 #ifdef HAVE_GETMNTINFO | |
42 #include <sys/param.h> | |
43 #include <sys/ucred.h> | |
44 #include <sys/mount.h> | |
45 #endif | |
46 | |
47 #ifndef CD_FRAMES | |
48 #define CD_FRAMES 75 | |
49 #endif | |
50 | |
51 #include <sys/types.h> | |
52 | |
53 #ifdef HAVE_LINUX_CDROM_H | |
54 #include <linux/cdrom.h> | |
55 #elif defined HAVE_SYS_CDIO_H | |
56 #include <sys/cdio.h> | |
419
2291caab50ca
[svn] FreeBSD 6.x/7.x newata cdrio fixes. (I now have an ia32 box to work with ;))
nenolod
parents:
392
diff
changeset
|
57 #include <sys/cdrio.h> |
61 | 58 #endif |
59 | |
392 | 60 #if defined(CDROMREADAUDIO) || defined(CDIOCREADAUDIO) || defined(CDROMCDDA) || defined(CDRIOCSETBLOCKSIZE) |
61 | 61 # define CDDA_HAS_READAUDIO |
62 #endif | |
63 | |
64 #ifndef CD_FRAMESIZE_RAW | |
65 # define CD_FRAMESIZE_RAW 2352 | |
66 #endif | |
67 | |
68 /* Number of frames that are read at once in dae mode */ | |
69 #define CDDA_DAE_FRAMES 8 | |
70 | |
71 #ifndef CDDA_HAS_READAUDIO | |
72 #warning "Digital audio extraction has not been ported to this platform" | |
73 #define read_audio_data(fd, pos, num, buf) -1 | |
74 #else | |
75 int read_audio_data(int fd, int pos, int num, void *buf); | |
76 #endif | |
77 | |
78 | |
79 #ifdef __FreeBSD__ | |
80 /* | |
81 * FreeBSD won't be able to detect media changes if using O_NONBLOCK | |
82 */ | |
83 #define CDOPENFLAGS O_RDONLY | |
84 #else | |
85 #define CDOPENFLAGS (O_RDONLY | O_NONBLOCK) | |
86 #endif | |
87 | |
88 | |
89 #define CDDB_DEFAULT_SERVER "freedb.freedb.org" | |
90 | |
91 struct driveinfo { | |
92 gchar *device, *directory; | |
93 gint mixer, oss_mixer; | |
94 gboolean valid; | |
95 gint dae; | |
96 }; | |
97 | |
98 typedef struct { | |
99 GList *drives; | |
100 | |
101 gchar *cddb_server; | |
102 gint cddb_protocol_level; | |
103 gboolean use_cddb; | |
104 | |
105 gchar *cdin_server; | |
106 gboolean use_cdin; | |
107 | |
108 gboolean title_override; | |
109 char *name_format; | |
110 } CDDAConfig; | |
111 | |
112 struct cdda_msf { | |
113 guint8 minute; | |
114 guint8 second; | |
115 guint8 frame; | |
116 struct { | |
117 guint data_track:1; | |
118 } flags; | |
119 }; | |
120 | |
121 /* | |
122 * Note: This macro will convert to a LBA representation of the MSF | |
123 * address, not to a true LBA address, as we don't subtract the offset | |
124 */ | |
125 #define LBA(msf) ((msf.minute * 60 + msf.second) * 75 + msf.frame) | |
126 | |
127 #define CDDA_MSF_OFFSET 150 | |
128 | |
129 typedef struct { | |
130 guint8 first_track, last_track; | |
131 struct cdda_msf leadout; | |
132 struct cdda_msf track[100]; | |
133 } cdda_disc_toc_t; | |
134 | |
135 extern CDDAConfig cdda_cfg; | |
136 | |
137 enum { | |
138 CDDA_MIXER_NONE, | |
139 CDDA_MIXER_DRIVE, | |
140 CDDA_MIXER_OSS, | |
141 }; | |
142 | |
143 enum { | |
144 CDDA_READ_ANALOG, | |
145 CDDA_READ_DAE, | |
146 }; | |
147 | |
148 void cdda_configure(void); | |
149 gboolean cdda_get_toc(cdda_disc_toc_t * info, const gchar *device); | |
150 guint32 cdda_cddb_compute_discid(cdda_disc_toc_t * info); | |
151 void cdda_cddb_get_info(cdda_disc_toc_t * toc, cdinfo_t * info); | |
152 void cdda_cdindex_get_idx(cdda_disc_toc_t * toc, cdinfo_t * cdinfo); | |
153 struct driveinfo *cdda_find_drive(gchar *filename); | |
154 | |
155 void cdda_cddb_show_server_dialog(GtkWidget * w, gpointer data); | |
156 void cdda_cddb_set_server(const gchar *new_server); | |
157 void cddb_quit(void); | |
158 | |
159 #endif |