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>
32 /*****************************************************************************
34 *****************************************************************************/
36 /*****************************************************************************
38 *****************************************************************************/
40 #if LIBCDIO_VERSION_NUM >= 72
41 static const char *psz_paranoia_list[] = { "none", "overlap", "full" };
42 static const char *psz_paranoia_list_text[] = { N_("none"), N_("overlap"),
46 #define DEBUG_LONGTEXT N_( \
47 "This integer when viewed in binary is a debugging mask\n" \
52 "all calls (0x10) 16\n" \
55 "libcdio (0x80) 128\n" \
56 "libcddb (0x100) 256\n" )
58 #define CACHING_LONGTEXT N_( \
59 "Caching value for CDDA streams. This " \
60 "value should be set in millisecond units." )
62 #define BLOCKS_PER_READ_LONGTEXT N_( \
63 "How many CD blocks to get on a single CD read. " \
64 "Generally on newer/faster CDs, this increases throughput at the " \
65 "expense of a little more memory usage and initial delay. SCSI-MMC " \
66 "limitations generally don't allow for more than 25 blocks per access.")
68 #define CDDB_TITLE_FMT_LONGTEXT N_( \
69 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
70 "Format specifiers that start with a percent sign. Specifiers are: \n" \
71 " %a : The artist (for the album)\n" \
72 " %A : The album information\n" \
74 " %e : The extended data (for a track)\n" \
75 " %I : CDDB disk ID\n" \
77 " %M : The current MRL\n" \
78 " %m : The CD-DA Media Catalog Number (MCN)\n" \
79 " %n : The number of tracks on the CD\n" \
80 " %p : The artist/performer/composer in the track\n" \
81 " %T : The track number\n" \
82 " %s : Number of seconds in this track\n" \
83 " %S : Number of seconds in the CD\n" \
84 " %t : The track title or MRL if no title\n" \
85 " %Y : The year 19xx or 20xx\n" \
88 #define TITLE_FMT_LONGTEXT N_( \
89 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
90 "Format specifiers that start with a percent sign. Specifiers are: \n" \
91 " %M : The current MRL\n" \
92 " %m : The CD-DA Media Catalog Number (MCN)\n" \
93 " %n : The number of tracks on the CD\n" \
94 " %T : The track number\n" \
95 " %s : Number of seconds in this track\n" \
96 " %S : Number of seconds in the CD\n" \
97 " %t : The track title or MRL if no title\n" \
100 #define PARANOIA_TEXT N_("Enable CD paranoia?")
101 #define PARANOIA_LONGTEXT N_( \
102 "Select whether to use CD Paranoia for jitter/error correction.\n" \
103 "none: no paranoia - fastest.\n" \
104 "overlap: do only overlap detection - not generally recommended.\n" \
105 "full: complete jitter and error correction detection - slowest.\n" )
107 /*****************************************************************************
109 *****************************************************************************/
112 add_usage_hint( N_("cddax://[device-or-file][@[T]track]") );
113 set_description( _("Compact Disc Digital Audio (CD-DA) input") );
114 set_capability( "access2", 10 /* compare with priority of cdda */ );
115 set_shortname( _("Audio Compact Disc"));
116 set_callbacks( CDDAOpen, CDDAClose );
117 add_shortcut( "cddax" );
118 add_shortcut( "cd" );
119 set_category( CAT_INPUT );
120 set_subcategory( SUBCAT_INPUT_ACCESS );
122 /* Configuration options */
123 add_integer ( MODULE_STRING "-debug", 0, CDDADebugCB,
124 N_("Additional debug"),
125 DEBUG_LONGTEXT, VLC_TRUE );
127 add_integer( MODULE_STRING "-caching",
128 DEFAULT_PTS_DELAY / MILLISECONDS_PER_SEC, NULL,
129 N_("Caching value in microseconds"),
130 CACHING_LONGTEXT, VLC_TRUE );
132 add_integer( MODULE_STRING "-blocks-per-read",
133 DEFAULT_BLOCKS_PER_READ, CDDABlocksPerReadCB,
134 N_("Number of blocks per CD read"),
135 BLOCKS_PER_READ_LONGTEXT, VLC_TRUE );
137 add_string( MODULE_STRING "-title-format",
138 "Track %T. %t", NULL,
139 N_("Format to use in playlist \"title\" field when no CDDB"),
140 TITLE_FMT_LONGTEXT, VLC_TRUE );
142 #if LIBCDIO_VERSION_NUM >= 73
143 add_bool( MODULE_STRING "-analog-output", VLC_FALSE, NULL,
144 N_("Use CD audio controls and output?"),
145 N_("If set, audio controls and audio jack output are used"),
149 add_bool( MODULE_STRING "-cdtext-enabled", VLC_TRUE, CDTextEnabledCB,
150 N_("Do CD-Text lookups?"),
151 N_("If set, get CD-Text information"),
154 add_bool( MODULE_STRING "-navigation-mode", VLC_TRUE,
160 N_("Use Navigation-style playback?"),
161 N_("Tracks are navigated via Navagation rather than "
162 "a playlist entries"),
165 #if LIBCDIO_VERSION_NUM >= 72
166 add_string( MODULE_STRING "-paranoia", NULL, NULL,
170 change_string_list( psz_paranoia_list, psz_paranoia_list_text, 0 );
171 #endif /* LIBCDIO_VERSION_NUM >= 72 */
174 set_section( N_("CDDB" ), 0 );
175 add_string( MODULE_STRING "-cddb-title-format",
176 "Track %T. %t - %p %A", NULL,
177 N_("Format to use in playlist \"title\" field when using CDDB"),
178 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
180 add_bool( MODULE_STRING "-cddb-enabled", VLC_TRUE, CDDBEnabledCB,
182 N_("If set, lookup CD-DA track information using the CDDB "
186 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
188 N_( "Contact this CDDB server look up CD-DA information"),
191 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
192 N_("CDDB server port"),
193 N_("CDDB server uses this port number to communicate on"),
196 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
197 N_("email address reported to CDDB server"),
198 N_("email address reported to CDDB server"),
201 add_bool( MODULE_STRING "-cddb-enable-cache", VLC_TRUE, NULL,
202 N_("Cache CDDB lookups?"),
203 N_("If set cache CDDB information about this CD"),
206 add_bool( MODULE_STRING "-cddb-httpd", VLC_FALSE, NULL,
207 N_("Contact CDDB via the HTTP protocol?"),
208 N_("If set, the CDDB server gets information via the CDDB HTTP "
212 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
213 N_("CDDB server timeout"),
214 N_("Time (in seconds) to wait for a response from the "
218 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
219 N_("Directory to cache CDDB requests"),
220 N_("Directory to cache CDDB requests"),
223 add_bool( MODULE_STRING "-cdtext-prefer", VLC_TRUE, CDTextPreferCB,
224 N_("Prefer CD-Text info to CDDB info?"),
225 N_("If set, CD-Text information will be preferred "
226 "to CDDB information when both are available"),
228 #endif /*HAVE_LIBCDDB*/