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_(Open) ( vlc_object_t * );
36 void E_(Close) ( vlc_object_t * );
38 int E_(OpenIntf) ( vlc_object_t * );
39 void E_(CloseIntf) ( vlc_object_t * );
41 int E_(DebugCB) ( vlc_object_t *p_this, const char *psz_name,
42 vlc_value_t oldval, vlc_value_t val,
45 int E_(CDDBEnabledCB)( vlc_object_t *p_this, const char *psz_name,
46 vlc_value_t oldval, vlc_value_t val,
49 /*****************************************************************************
51 *****************************************************************************/
53 /*****************************************************************************
55 *****************************************************************************/
57 #define DEBUG_LONGTEXT N_( \
58 "This integer when viewed in binary is a debugging mask\n" \
63 "all calls (10) 16\n" \
66 "libcdio (80) 128\n" \
67 "libcddb (100) 256\n" )
69 #define CACHING_LONGTEXT N_( \
70 "Allows you to modify the default caching value for CDDA streams. This " \
71 "value should be set in millisecond units." )
73 #define CDDB_TITLE_FMT_LONGTEXT N_( \
74 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
75 "Format specifiers that start with a percent sign. Specifiers are: \n" \
76 " %a : The artist (for the album)\n" \
77 " %A : The album information\n" \
79 " %e : The extended data (for a track)\n" \
80 " %I : CDDB disk ID\n" \
82 " %M : The current MRL\n" \
83 " %m : The CD-DA Media Catalog Number (MCN)\n" \
84 " %n : The number of tracks on the CD\n" \
85 " %p : The artist/performer/composer in the track\n" \
86 " %T : The track number\n" \
87 " %s : Number of seconds in this track \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" \
102 /*****************************************************************************
104 *****************************************************************************/
107 add_usage_hint( N_("cddax://[device-or-file][@[T]num]") );
108 set_description( _("Compact Disc Digital Audio (CD-DA) input") );
109 set_capability( "access", 75 /* slightly higher than cdda */ );
110 set_callbacks( E_(Open), E_(Close) );
111 add_shortcut( "cdda" );
112 add_shortcut( "cddax" );
114 /* Configuration options */
115 add_integer ( MODULE_STRING "-debug", 0, E_(DebugCB),
116 N_("If nonzero, this gives additional debug information."),
117 DEBUG_LONGTEXT, VLC_TRUE );
119 add_integer( MODULE_STRING "-caching",
120 DEFAULT_PTS_DELAY / 1000, NULL,
121 N_("Caching value in microseconds"),
122 CACHING_LONGTEXT, VLC_TRUE );
124 add_string( MODULE_STRING "-author-format",
125 "%A - %a %C %I", NULL,
126 N_("Format to use in playlist \"author\" field"),
127 TITLE_FMT_LONGTEXT, VLC_TRUE );
129 add_string( MODULE_STRING "-title-format",
131 N_("Format to use in playlist \"title\" field when no CDDB"),
132 TITLE_FMT_LONGTEXT, VLC_TRUE );
135 add_string( MODULE_STRING "-cddb-title-format",
136 "Track %T. %t - %p", NULL,
137 N_("Format to use in playlist \"title\" field when using CDDB"),
138 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
140 add_bool( MODULE_STRING "-cddb-enabled", 1, E_(CDDBEnabledCB),
141 N_("Do CDDB lookups?"),
142 N_("If set, lookup CD-DA track information using the CDDB "
146 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
148 N_( "Contact this CDDB server look up CD-DA information"),
151 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
152 N_("CDDB server port"),
153 N_("CDDB server uses this port number to communicate on"),
156 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
157 N_("email address reported to CDDB server"),
158 N_("email address reported to CDDB server"),
161 add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
162 N_("Cache CDDB lookups?"),
163 N_("If set cache CDDB information about this CD"),
166 add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
167 N_("Contact CDDB via the HTTP protocol?"),
168 N_("If set, the CDDB server gets information via the CDDB HTTP "
172 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
173 N_("CDDB server timeout"),
174 N_("Time (in seconds) to wait for a response from the "
178 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
179 N_("Directory to cache CDDB requests"),
180 N_("Directory to cache CDDB requests"),