1 /*****************************************************************************
2 * cddax.c : CD digital audio input module for vlc using libcdio
3 *****************************************************************************
4 * Copyright (C) 2000,2003 VideoLAN
7 * Authors: Rocky Bernstein <rocky@panix.com>
8 * Laurent Aimar <fenrir@via.ecp.fr>
9 * Gildas Bazin <gbazin@netcourrier.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
32 /*****************************************************************************
34 *****************************************************************************/
35 int E_(CDDAOpen) ( vlc_object_t * );
36 void E_(CDDAClose) ( vlc_object_t * );
38 int E_(CDDADebugCB) ( vlc_object_t *p_this, const char *psz_name,
39 vlc_value_t oldval, vlc_value_t val,
42 int E_(CDDBEnabledCB)( vlc_object_t *p_this, const char *psz_name,
43 vlc_value_t oldval, vlc_value_t val,
46 /*****************************************************************************
48 *****************************************************************************/
50 /*****************************************************************************
52 *****************************************************************************/
54 #define DEBUG_LONGTEXT N_( \
55 "This integer when viewed in binary is a debugging mask\n" \
60 "all calls (10) 16\n" \
63 "libcdio (80) 128\n" \
64 "libcddb (100) 256\n" )
66 #define CACHING_LONGTEXT N_( \
67 "Allows you to modify the default caching value for CDDA streams. This " \
68 "value should be set in millisecond units." )
70 #define CDDB_TITLE_FMT_LONGTEXT N_( \
71 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
72 "Format specifiers that start with a percent sign. Specifiers are: \n" \
73 " %a : The artist (for the album)\n" \
74 " %A : The album information\n" \
76 " %e : The extended data (for a track)\n" \
77 " %I : CDDB disk ID\n" \
79 " %M : The current MRL\n" \
80 " %m : The CD-DA Media Catalog Number (MCN)\n" \
81 " %n : The number of tracks on the CD\n" \
82 " %p : The artist/performer/composer in the track\n" \
83 " %T : The track number\n" \
84 " %s : Number of seconds in this track \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" \
99 /*****************************************************************************
101 *****************************************************************************/
104 add_usage_hint( N_("cddax://[device-or-file][@[T]track]") );
105 set_description( _("Compact Disc Digital Audio (CD-DA) input") );
106 set_capability( "access2", 10 /* slightly higher than cdda */ );
107 set_callbacks( E_(CDDAOpen), E_(CDDAClose) );
108 add_shortcut( "cddax" );
109 add_shortcut( "cd" );
111 /* Configuration options */
112 add_integer ( MODULE_STRING "-debug", 0, E_(CDDADebugCB),
113 N_("If nonzero, this gives additional debug information."),
114 DEBUG_LONGTEXT, VLC_TRUE );
116 add_integer( MODULE_STRING "-caching",
117 DEFAULT_PTS_DELAY / 1000, NULL,
118 N_("Caching value in microseconds"),
119 CACHING_LONGTEXT, VLC_TRUE );
121 add_string( MODULE_STRING "-author-format",
122 "%A - %a %C %I", NULL,
123 N_("Format to use in playlist \"author\" field"),
124 TITLE_FMT_LONGTEXT, VLC_TRUE );
126 add_string( MODULE_STRING "-title-format",
128 N_("Format to use in playlist \"title\" field when no CDDB"),
129 TITLE_FMT_LONGTEXT, VLC_TRUE );
132 add_string( MODULE_STRING "-cddb-title-format",
133 "Track %T. %t - %p", NULL,
134 N_("Format to use in playlist \"title\" field when using CDDB"),
135 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
137 add_bool( MODULE_STRING "-cddb-enabled", 1, E_(CDDBEnabledCB),
138 N_("Do CDDB lookups?"),
139 N_("If set, lookup CD-DA track information using the CDDB "
143 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
145 N_( "Contact this CDDB server look up CD-DA information"),
148 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
149 N_("CDDB server port"),
150 N_("CDDB server uses this port number to communicate on"),
153 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
154 N_("email address reported to CDDB server"),
155 N_("email address reported to CDDB server"),
158 add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
159 N_("Cache CDDB lookups?"),
160 N_("If set cache CDDB information about this CD"),
163 add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
164 N_("Contact CDDB via the HTTP protocol?"),
165 N_("If set, the CDDB server gets information via the CDDB HTTP "
169 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
170 N_("CDDB server timeout"),
171 N_("Time (in seconds) to wait for a response from the "
175 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
176 N_("Directory to cache CDDB requests"),
177 N_("Directory to cache CDDB requests"),