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 *****************************************************************************/
33 #include <cdio/version.h>
34 #include <vlc_plugin.h>
36 /*****************************************************************************
38 *****************************************************************************/
40 /*****************************************************************************
42 *****************************************************************************/
44 #if LIBCDIO_VERSION_NUM >= 72
45 static const char *const psz_paranoia_list[] = { "none", "overlap", "full" };
46 static const char *const psz_paranoia_list_text[] = { N_("none"), N_("overlap"),
50 #define DEBUG_LONGTEXT N_( \
51 "This integer when viewed in binary is a debugging mask\n" \
56 "all calls (0x10) 16\n" \
59 "libcdio (0x80) 128\n" \
60 "libcddb (0x100) 256\n" )
62 #define CACHING_LONGTEXT N_( \
63 "Caching value for CDDA streams. This " \
64 "value should be set in millisecond units." )
66 #define BLOCKS_PER_READ_LONGTEXT N_( \
67 "How many CD blocks to get on a single CD read. " \
68 "Generally on newer/faster CDs, this increases throughput at the " \
69 "expense of a little more memory usage and initial delay. SCSI-MMC " \
70 "limitations generally don't allow for more than 25 blocks per access.")
72 #define CDDB_TITLE_FMT_LONGTEXT N_( \
73 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
74 "Format specifiers that start with a percent sign. Specifiers are: \n" \
75 " %a : The artist (for the album)\n" \
76 " %A : The album information\n" \
78 " %e : The extended data (for a track)\n" \
79 " %I : CDDB disk ID\n" \
81 " %M : The current MRL\n" \
82 " %m : The CD-DA Media Catalog Number (MCN)\n" \
83 " %n : The number of tracks on the CD\n" \
84 " %p : The artist/performer/composer in the track\n" \
85 " %T : The track number\n" \
86 " %s : Number of seconds in this track\n" \
87 " %S : Number of seconds in the CD\n" \
88 " %t : The track title or MRL if no title\n" \
89 " %Y : The year 19xx or 20xx\n" \
92 #define TITLE_FMT_LONGTEXT N_( \
93 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
94 "Format specifiers that start with a percent sign. Specifiers are: \n" \
95 " %M : The current MRL\n" \
96 " %m : The CD-DA Media Catalog Number (MCN)\n" \
97 " %n : The number of tracks on the CD\n" \
98 " %T : The track number\n" \
99 " %s : Number of seconds in this track\n" \
100 " %S : Number of seconds in the CD\n" \
101 " %t : The track title or MRL if no title\n" \
104 #define PARANOIA_TEXT N_("Enable CD paranoia?")
105 #define PARANOIA_LONGTEXT N_( \
106 "Select whether to use CD Paranoia for jitter/error correction.\n" \
107 "none: no paranoia - fastest.\n" \
108 "overlap: do only overlap detection - not generally recommended.\n" \
109 "full: complete jitter and error correction detection - slowest.\n" )
111 /*****************************************************************************
113 *****************************************************************************/
116 add_usage_hint( N_("cddax://[device-or-file][@[T]track]") )
117 set_description( N_("Compact Disc Digital Audio (CD-DA) input") )
118 set_capability( "access", 10 /* compare with priority of cdda */ )
119 set_shortname( N_("Audio Compact Disc"))
120 set_callbacks( CDDAOpen, CDDAClose )
121 add_shortcut( "cddax" )
123 set_category( CAT_INPUT )
124 set_subcategory( SUBCAT_INPUT_ACCESS )
126 /* Configuration options */
127 add_integer ( MODULE_STRING "-debug", 0, CDDADebugCB,
128 N_("Additional debug"),
129 DEBUG_LONGTEXT, true )
131 add_integer( MODULE_STRING "-caching",
132 DEFAULT_PTS_DELAY / MILLISECONDS_PER_SEC, NULL,
133 N_("Caching value in microseconds"),
134 CACHING_LONGTEXT, true )
136 add_integer( MODULE_STRING "-blocks-per-read",
137 DEFAULT_BLOCKS_PER_READ, CDDABlocksPerReadCB,
138 N_("Number of blocks per CD read"),
139 BLOCKS_PER_READ_LONGTEXT, true )
141 add_string( MODULE_STRING "-title-format",
142 "Track %T. %t", NULL,
143 N_("Format to use in playlist \"title\" field when no CDDB"),
144 TITLE_FMT_LONGTEXT, true )
146 #if LIBCDIO_VERSION_NUM >= 73
147 add_bool( MODULE_STRING "-analog-output", false, NULL,
148 N_("Use CD audio controls and output?"),
149 N_("If set, audio controls and audio jack output are used"),
153 add_bool( MODULE_STRING "-cdtext-enabled", true, CDTextEnabledCB,
154 N_("Do CD-Text lookups?"),
155 N_("If set, get CD-Text information"),
158 add_bool( MODULE_STRING "-navigation-mode", true,
164 N_("Use Navigation-style playback?"),
165 N_("Tracks are navigated via Navagation rather than "
166 "a playlist entries"),
169 #if LIBCDIO_VERSION_NUM >= 72
170 add_string( MODULE_STRING "-paranoia", NULL, NULL,
174 change_string_list( psz_paranoia_list, psz_paranoia_list_text, 0 );
175 #endif /* LIBCDIO_VERSION_NUM >= 72 */
178 set_section( N_("CDDB" ), 0 )
179 add_string( MODULE_STRING "-cddb-title-format",
180 "Track %T. %t - %p %A", NULL,
181 N_("Format to use in playlist \"title\" field when using CDDB"),
182 CDDB_TITLE_FMT_LONGTEXT, true )
184 add_bool( MODULE_STRING "-cddb-enabled", true, CDDBEnabledCB,
186 N_("If set, lookup CD-DA track information using the CDDB "
190 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
192 N_( "Contact this CDDB server look up CD-DA information"),
195 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
196 N_("CDDB server port"),
197 N_("CDDB server uses this port number to communicate on"),
200 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
201 N_("email address reported to CDDB server"),
202 N_("email address reported to CDDB server"),
205 add_bool( MODULE_STRING "-cddb-enable-cache", true, NULL,
206 N_("Cache CDDB lookups?"),
207 N_("If set cache CDDB information about this CD"),
210 add_bool( MODULE_STRING "-cddb-httpd", false, NULL,
211 N_("Contact CDDB via the HTTP protocol?"),
212 N_("If set, the CDDB server gets information via the CDDB HTTP "
216 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
217 N_("CDDB server timeout"),
218 N_("Time (in seconds) to wait for a response from the "
222 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
223 N_("Directory to cache CDDB requests"),
224 N_("Directory to cache CDDB requests"),
227 add_bool( MODULE_STRING "-cdtext-prefer", true, CDTextPreferCB,
228 N_("Prefer CD-Text info to CDDB info?"),
229 N_("If set, CD-Text information will be preferred "
230 "to CDDB information when both are available"),
232 #endif /*HAVE_LIBCDDB*/