1 /*****************************************************************************
2 * cdda.c : CD digital audio input module for vlc using libcdio
3 *****************************************************************************
4 * Copyright (C) 2000, 2003, 2004, 2005 the VideoLAN team
7 * Authors: Rocky Bernstein <rocky@panix.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program 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
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
30 #include <cdio/version.h>
31 #include <vlc_plugin.h>
33 /*****************************************************************************
35 *****************************************************************************/
37 /*****************************************************************************
39 *****************************************************************************/
41 #if LIBCDIO_VERSION_NUM >= 72
42 static const char *const psz_paranoia_list[] = { "none", "overlap", "full" };
43 static const char *const psz_paranoia_list_text[] = { N_("none"), N_("overlap"),
47 #define DEBUG_LONGTEXT N_( \
48 "This integer when viewed in binary is a debugging mask\n" \
53 "all calls (0x10) 16\n" \
56 "libcdio (0x80) 128\n" \
57 "libcddb (0x100) 256\n" )
59 #define CACHING_LONGTEXT N_( \
60 "Caching value for CDDA streams. This " \
61 "value should be set in millisecond units." )
63 #define BLOCKS_PER_READ_LONGTEXT N_( \
64 "How many CD blocks to get on a single CD read. " \
65 "Generally on newer/faster CDs, this increases throughput at the " \
66 "expense of a little more memory usage and initial delay. SCSI-MMC " \
67 "limitations generally don't allow for more than 25 blocks per access.")
69 #define CDDB_TITLE_FMT_LONGTEXT N_( \
70 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
71 "Format specifiers that start with a percent sign. Specifiers are: \n" \
72 " %a : The artist (for the album)\n" \
73 " %A : The album information\n" \
75 " %e : The extended data (for a track)\n" \
76 " %I : CDDB disk ID\n" \
78 " %M : The current MRL\n" \
79 " %m : The CD-DA Media Catalog Number (MCN)\n" \
80 " %n : The number of tracks on the CD\n" \
81 " %p : The artist/performer/composer in the track\n" \
82 " %T : The track number\n" \
83 " %s : Number of seconds in this track\n" \
84 " %S : Number of seconds in the CD\n" \
85 " %t : The track title or MRL if no title\n" \
86 " %Y : The year 19xx or 20xx\n" \
89 #define TITLE_FMT_LONGTEXT N_( \
90 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
91 "Format specifiers that start with a percent sign. Specifiers are: \n" \
92 " %M : The current MRL\n" \
93 " %m : The CD-DA Media Catalog Number (MCN)\n" \
94 " %n : The number of tracks on the CD\n" \
95 " %T : The track number\n" \
96 " %s : Number of seconds in this track\n" \
97 " %S : Number of seconds in the CD\n" \
98 " %t : The track title or MRL if no title\n" \
101 #define PARANOIA_TEXT N_("Enable CD paranoia?")
102 #define PARANOIA_LONGTEXT N_( \
103 "Select whether to use CD Paranoia for jitter/error correction.\n" \
104 "none: no paranoia - fastest.\n" \
105 "overlap: do only overlap detection - not generally recommended.\n" \
106 "full: complete jitter and error correction detection - slowest.\n" )
108 /*****************************************************************************
110 *****************************************************************************/
113 add_usage_hint( N_("cddax://[device-or-file][@[T]track]") )
114 set_description( N_("Compact Disc Digital Audio (CD-DA) input") )
115 set_capability( "access", 10 /* compare with priority of cdda */ )
116 set_shortname( N_("Audio Compact Disc"))
117 set_callbacks( CDDAOpen, CDDAClose )
118 add_shortcut( "cddax" )
120 set_category( CAT_INPUT )
121 set_subcategory( SUBCAT_INPUT_ACCESS )
123 /* Configuration options */
124 add_integer ( MODULE_STRING "-debug", 0, CDDADebugCB,
125 N_("Additional debug"),
126 DEBUG_LONGTEXT, true );
128 add_integer( MODULE_STRING "-caching",
129 DEFAULT_PTS_DELAY / MILLISECONDS_PER_SEC, NULL,
130 N_("Caching value in microseconds"),
131 CACHING_LONGTEXT, true );
133 add_integer( MODULE_STRING "-blocks-per-read",
134 DEFAULT_BLOCKS_PER_READ, CDDABlocksPerReadCB,
135 N_("Number of blocks per CD read"),
136 BLOCKS_PER_READ_LONGTEXT, true );
138 add_string( MODULE_STRING "-title-format",
139 "Track %T. %t", NULL,
140 N_("Format to use in playlist \"title\" field when no CDDB"),
141 TITLE_FMT_LONGTEXT, true );
143 #if LIBCDIO_VERSION_NUM >= 73
144 add_bool( MODULE_STRING "-analog-output", false, NULL,
145 N_("Use CD audio controls and output?"),
146 N_("If set, audio controls and audio jack output are used"),
150 add_bool( MODULE_STRING "-cdtext-enabled", true, CDTextEnabledCB,
151 N_("Do CD-Text lookups?"),
152 N_("If set, get CD-Text information"),
155 add_bool( MODULE_STRING "-navigation-mode", true,
161 N_("Use Navigation-style playback?"),
162 N_("Tracks are navigated via Navagation rather than "
163 "a playlist entries"),
166 #if LIBCDIO_VERSION_NUM >= 72
167 add_string( MODULE_STRING "-paranoia", NULL, NULL,
171 change_string_list( psz_paranoia_list, psz_paranoia_list_text, 0 );
172 #endif /* LIBCDIO_VERSION_NUM >= 72 */
175 set_section( N_("CDDB" ), 0 )
176 add_string( MODULE_STRING "-cddb-title-format",
177 "Track %T. %t - %p %A", NULL,
178 N_("Format to use in playlist \"title\" field when using CDDB"),
179 CDDB_TITLE_FMT_LONGTEXT, true );
181 add_bool( MODULE_STRING "-cddb-enabled", true, CDDBEnabledCB,
183 N_("If set, lookup CD-DA track information using the CDDB "
187 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
189 N_( "Contact this CDDB server look up CD-DA information"),
192 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
193 N_("CDDB server port"),
194 N_("CDDB server uses this port number to communicate on"),
197 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
198 N_("email address reported to CDDB server"),
199 N_("email address reported to CDDB server"),
202 add_bool( MODULE_STRING "-cddb-enable-cache", true, NULL,
203 N_("Cache CDDB lookups?"),
204 N_("If set cache CDDB information about this CD"),
207 add_bool( MODULE_STRING "-cddb-httpd", false, NULL,
208 N_("Contact CDDB via the HTTP protocol?"),
209 N_("If set, the CDDB server gets information via the CDDB HTTP "
213 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
214 N_("CDDB server timeout"),
215 N_("Time (in seconds) to wait for a response from the "
219 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
220 N_("Directory to cache CDDB requests"),
221 N_("Directory to cache CDDB requests"),
224 add_bool( MODULE_STRING "-cdtext-prefer", true, CDTextPreferCB,
225 N_("Prefer CD-Text info to CDDB info?"),
226 N_("If set, CD-Text information will be preferred "
227 "to CDDB information when both are available"),
229 #endif /*HAVE_LIBCDDB*/