1 /*****************************************************************************
2 * cdda.c : CD digital audio input module for vlc using libcdio
3 *****************************************************************************
4 * Copyright (C) 2000, 2003, 2004, 2005 VideoLAN
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
30 #include <cdio/version.h>
32 /*****************************************************************************
34 *****************************************************************************/
36 /*****************************************************************************
38 *****************************************************************************/
40 #define DEBUG_LONGTEXT N_( \
41 "This integer when viewed in binary is a debugging mask\n" \
46 "all calls (0x10) 16\n" \
49 "libcdio (0x80) 128\n" \
50 "libcddb (0x100) 256\n" )
52 #define CACHING_LONGTEXT N_( \
53 "Allows you to modify the default caching value for CDDA streams. This " \
54 "value should be set in millisecond units." )
56 #define BLOCKS_PER_READ_LONGTEXT N_( \
57 "Allows you to specify how many CD blocks to get on a single CD read. " \
58 "Generally on newer/faster CDs, this increases throughput at the " \
59 "expense of a little more memory usage and initial delay. SCSI-MMC " \
60 "limitations generally don't allow for more than 25 blocks per access.")
62 #define CDDB_TITLE_FMT_LONGTEXT N_( \
63 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
64 "Format specifiers that start with a percent sign. Specifiers are: \n" \
65 " %a : The artist (for the album)\n" \
66 " %A : The album information\n" \
68 " %e : The extended data (for a track)\n" \
69 " %I : CDDB disk ID\n" \
71 " %M : The current MRL\n" \
72 " %m : The CD-DA Media Catalog Number (MCN)\n" \
73 " %n : The number of tracks on the CD\n" \
74 " %p : The artist/performer/composer in the track\n" \
75 " %T : The track number\n" \
76 " %s : Number of seconds in this track\n" \
77 " %S : Number of seconds in the CD\n" \
78 " %t : The track title or MRL if no title\n" \
79 " %Y : The year 19xx or 20xx\n" \
82 #define TITLE_FMT_LONGTEXT N_( \
83 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
84 "Format specifiers that start with a percent sign. Specifiers are: \n" \
85 " %M : The current MRL\n" \
86 " %m : The CD-DA Media Catalog Number (MCN)\n" \
87 " %n : The number of tracks on the CD\n" \
88 " %T : The track number\n" \
89 " %s : Number of seconds in this track\n" \
90 " %S : Number of seconds in the CD\n" \
91 " %t : The track title or MRL if no title\n" \
94 /*****************************************************************************
96 *****************************************************************************/
99 add_usage_hint( N_("cddax://[device-or-file][@[T]track]") );
100 set_description( _("Compact Disc Digital Audio (CD-DA) input") );
101 set_capability( "access2", 10 /* compare with priority of cdda */ );
102 set_shortname( N_("Audio CD"));
103 set_callbacks( CDDAOpen, CDDAClose );
104 add_shortcut( "cddax" );
105 add_shortcut( "cd" );
106 set_category( CAT_INPUT );
107 set_subcategory( SUBCAT_INPUT_ACCESS );
109 /* Configuration options */
110 add_integer ( MODULE_STRING "-debug", 0, CDDADebugCB,
111 N_("If nonzero, this gives additional debug information."),
112 DEBUG_LONGTEXT, VLC_TRUE );
114 add_integer( MODULE_STRING "-caching",
115 DEFAULT_PTS_DELAY / MILLISECONDS_PER_SEC, NULL,
116 N_("Caching value in microseconds"),
117 CACHING_LONGTEXT, VLC_TRUE );
119 add_integer( MODULE_STRING "-blocks-per-read",
120 DEFAULT_BLOCKS_PER_READ, CDDABlocksPerReadCB,
121 N_("Number of blocks per CD read"),
122 BLOCKS_PER_READ_LONGTEXT, VLC_TRUE );
124 add_string( MODULE_STRING "-title-format",
125 "Track %T. %t", NULL,
126 N_("Format to use in playlist \"title\" field when no CDDB"),
127 TITLE_FMT_LONGTEXT, VLC_TRUE );
130 add_string( MODULE_STRING "-cddb-title-format",
131 "Track %T. %t - %p %A", NULL,
132 N_("Format to use in playlist \"title\" field when using CDDB"),
133 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
135 add_bool( MODULE_STRING "-cddb-enabled", VLC_TRUE, CDDBEnabledCB,
136 N_("Do CDDB lookups?"),
137 N_("If set, lookup CD-DA track information using the CDDB "
141 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
143 N_( "Contact this CDDB server look up CD-DA information"),
146 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
147 N_("CDDB server port"),
148 N_("CDDB server uses this port number to communicate on"),
151 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
152 N_("email address reported to CDDB server"),
153 N_("email address reported to CDDB server"),
156 add_bool( MODULE_STRING "-cddb-enable-cache", VLC_TRUE, NULL,
157 N_("Cache CDDB lookups?"),
158 N_("If set cache CDDB information about this CD"),
161 add_bool( MODULE_STRING "-cddb-httpd", VLC_FALSE, NULL,
162 N_("Contact CDDB via the HTTP protocol?"),
163 N_("If set, the CDDB server gets information via the CDDB HTTP "
167 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
168 N_("CDDB server timeout"),
169 N_("Time (in seconds) to wait for a response from the "
173 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
174 N_("Directory to cache CDDB requests"),
175 N_("Directory to cache CDDB requests"),
178 add_bool( MODULE_STRING "-cdtext-prefer", VLC_TRUE, CDTextPreferCB,
179 N_("Prefer CD-Text info to CDDB info?"),
180 N_("If set, CD-Text information will be preferred "
181 "to CDDB information when both are available"),
186 add_bool( MODULE_STRING "-cdtext-enabled", VLC_TRUE, CDTextEnabledCB,
187 N_("Do CD-Text lookups?"),
188 N_("If set, get CD-Text information"),
191 add_bool( MODULE_STRING "-navigation-mode", VLC_TRUE,
197 N_("Use Navigation-style playback?"),
198 N_("If set, tracks are navigated via Navagation rather than "
199 "a playlist entries"),
202 #if LIBCDIO_VERSION_NUM >= 72
203 add_bool( MODULE_STRING "-paranoia-enabled",
206 N_("Enable CD paranoia?"),
207 N_("If set, CD-DA reading will go through paranoia "
208 "jitter/error correction"),