1 /*****************************************************************************
2 * cddax.c : CD digital audio input module for vlc using libcdio
3 *****************************************************************************
4 * Copyright (C) 2000,2003 VideoLAN
5 * $Id: cdda.c,v 1.6 2003/12/01 03:34:30 rocky Exp $
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 *****************************************************************************/
33 /*****************************************************************************
35 *****************************************************************************/
36 int E_(Open) ( vlc_object_t * );
37 void E_(Close) ( vlc_object_t * );
39 int E_(OpenIntf) ( vlc_object_t * );
40 void E_(CloseIntf) ( vlc_object_t * );
41 int E_(DemuxOpen) ( vlc_object_t * p_this);
42 void E_(DemuxClose) ( vlc_object_t * p_this);
44 int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
45 vlc_value_t oldval, vlc_value_t val,
48 /*****************************************************************************
50 *****************************************************************************/
52 /*****************************************************************************
54 *****************************************************************************/
56 #define DEBUG_LONGTEXT N_( \
57 "This integer when viewed in binary is a debugging mask\n" \
62 "all calls (10) 16\n" \
65 "libcdio (80) 128\n" \
66 "libcddb (100) 256\n" )
68 #define DEV_LONGTEXT N_( \
69 "Specify the name of the CD-ROM device that will be used by default. " \
70 "If you don't specify anything, we'll scan for a suitable CD-ROM device.")
72 #define CACHING_LONGTEXT N_( \
73 "Allows you to modify the default caching value for cdda streams. This " \
74 "value should be set in millisecond units." )
76 #define TITLE_FMT_LONGTEXT N_( \
77 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
78 "Format specifiers that start with a percent sign. Specifiers are: \n" \
79 " %a : The artist **\n" \
80 " %A : The album information **\n" \
81 " %C : Category **\n" \
82 " %I : CDDB disk ID\n" \
84 " %M : The current MRL\n" \
85 " %m : The CD-DA Media Catalog Number (MCN)\n" \
86 " %n : The number of tracks on the CD\n" \
87 " %p : The artist/performer/composer in the track **\n" \
88 " %T : The track number\n" \
89 " %s : Number of seconds in this track \n" \
90 " %t : The title **\n" \
91 " %Y : The year 19xx or 20xx\n **\n" \
93 "\n\n ** Only available if CDDB is enabled")
96 #define DEFAULT_TITLE_FORMAT "Track %T. %t - %p",
98 #define DEFAULT_TITLE_FORMAT "%T %M",
101 /*****************************************************************************
103 *****************************************************************************/
106 add_usage_hint( N_("cddax://[device-or-file][@[T]num]") );
107 set_description( _("Compact Disc Digital Audio (CD-DA) input") );
108 set_capability( "access", 75 /* slightly higher than cdda */ );
109 set_callbacks( E_(Open), E_(Close) );
110 add_shortcut( "cdda" );
111 add_shortcut( "cddax" );
113 /* Configuration options */
114 add_category_hint( N_("CDX"), NULL, VLC_TRUE );
116 add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback),
117 N_("set debug mask for additional debugging."),
118 DEBUG_LONGTEXT, VLC_TRUE );
120 add_integer( MODULE_STRING "-caching",
121 DEFAULT_PTS_DELAY / 1000, NULL,
122 N_("Caching value in ms"),
123 CACHING_LONGTEXT, VLC_TRUE );
125 add_string( MODULE_STRING "-device", "", NULL,
126 N_("CD-ROM device name"),
127 DEV_LONGTEXT, VLC_FALSE );
129 add_string( MODULE_STRING "-title-format", DEFAULT_TITLE_FORMAT, NULL,
130 N_("Format to use in playlist 'title' field"),
131 TITLE_FMT_LONGTEXT, VLC_TRUE );
134 add_bool( MODULE_STRING "-cddb-enabled", 1, NULL,
135 N_("Do CDDB lookups?"),
136 N_("If set, lookup CD-DA track information using the CDDB "
140 add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
142 N_( "Contact this CDDB server look up CD-DA information"),
145 add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
146 N_("CDDB server port"),
147 N_("CDDB server uses this port number to communicate on"),
150 add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
151 N_("email address reported to CDDB server"),
152 N_("email address reported to CDDB server"),
155 add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
156 N_("Cache CDDB lookups?"),
157 N_("If set cache CDDB information about this CD"),
160 add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
161 N_("Contact CDDB via the HTTP protocol?"),
162 N_("If set, the CDDB server get information via the CDDB HTTP "
166 add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
167 N_("CDDB server timeout"),
168 N_("Time (in seconds) to wait for a response from the "
172 add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
173 N_("Directory to cache CDDB requests"),
174 N_("Directory to cache CDDB requests"),
180 set_description( _("CD Audio demux") );
181 set_capability( "demux", 0 );
182 set_callbacks( E_(DemuxOpen), E_(DemuxClose) );
183 add_shortcut( "cdda" );
186 set_capability( "interface", 0 );
187 set_callbacks( E_(OpenIntf), E_(CloseIntf) );