]> git.sesse.net Git - vlc/blob - modules/access/cdda/cdda.c
* modules/access/cdda/*: forgot to remove demux in module declaration.
[vlc] / modules / access / cdda / cdda.c
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.18 2004/02/14 17:36:05 gbazin Exp $
6  *
7  * Authors: Rocky Bernstein <rocky@panix.com>
8  *          Laurent Aimar <fenrir@via.ecp.fr>
9  *          Gildas Bazin <gbazin@netcourrier.com>
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29
30 #include <vlc/vlc.h>
31
32 /*****************************************************************************
33  * prototypes
34  *****************************************************************************/
35 int  E_(Open)         ( vlc_object_t * );
36 void E_(Close)        ( vlc_object_t * );
37
38 int  E_(OpenIntf)     ( vlc_object_t * );
39 void E_(CloseIntf)    ( vlc_object_t * );
40
41 int  E_(DebugCB)      ( vlc_object_t *p_this, const char *psz_name,
42                         vlc_value_t oldval, vlc_value_t val,
43                         void *p_data );
44
45 int  E_(CDDBEnabledCB)( vlc_object_t *p_this, const char *psz_name,
46                         vlc_value_t oldval, vlc_value_t val,
47                         void *p_data );
48
49 /*****************************************************************************
50  * Module descriptor
51  *****************************************************************************/
52
53 /*****************************************************************************
54  * Option help text
55  *****************************************************************************/
56
57 #define DEBUG_LONGTEXT N_( \
58     "This integer when viewed in binary is a debugging mask\n" \
59     "meta info        1\n" \
60     "events           2\n" \
61     "MRL              4\n" \
62     "external call    8\n" \
63     "all calls (10)  16\n" \
64     "LSN       (20)  32\n" \
65     "seek      (40)  64\n" \
66     "libcdio   (80) 128\n" \
67     "libcddb  (100) 256\n" )
68
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." )
72
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\n" \
77 "   %A : The album information\n" \
78 "   %C : Category\n" \
79 "   %I : CDDB disk ID\n" \
80 "   %G : Genre\n" \
81 "   %M : The current MRL\n" \
82 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
83 "   %n : The number of tracks on the CD\n" \
84 "   %p : The artist/performer/composer in the track\n" \
85 "   %T : The track number\n" \
86 "   %s : Number of seconds in this track \n" \
87 "   %t : The title\n" \
88 "   %Y : The year 19xx or 20xx\n" \
89 "   %% : a % \n")
90
91 #define TITLE_FMT_LONGTEXT N_( \
92 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
93 "Format specifiers that start with a percent sign. Specifiers are: \n" \
94 "   %M : The current MRL\n" \
95 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
96 "   %n : The number of tracks on the CD\n" \
97 "   %T : The track number\n" \
98 "   %s : Number of seconds in this track \n" \
99 "   %% : a % \n")
100
101 /*****************************************************************************
102  * Module descriptor
103  *****************************************************************************/
104
105 vlc_module_begin();
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" );
112
113     /* Configuration options */
114     add_integer ( MODULE_STRING "-debug", 0, E_(DebugCB),
115                   N_("If nonzero, this gives additional debug information."),
116                   DEBUG_LONGTEXT, VLC_TRUE );
117
118     add_integer( MODULE_STRING "-caching",
119                  DEFAULT_PTS_DELAY / 1000, NULL,
120                  N_("Caching value in microseconds"),
121                  CACHING_LONGTEXT, VLC_TRUE );
122
123     add_string( MODULE_STRING "-author-format",
124                 "%A - %a %C %I", NULL,
125                 N_("Format to use in playlist \"author\" field"),
126                 TITLE_FMT_LONGTEXT, VLC_TRUE );
127
128     add_string( MODULE_STRING "-title-format",
129                 "%T %M", NULL,
130                 N_("Format to use in playlist \"title\" field when no CDDB"),
131                 TITLE_FMT_LONGTEXT, VLC_TRUE );
132
133 #ifdef HAVE_LIBCDDB
134     add_string( MODULE_STRING "-cddb-title-format",
135                 "Track %T. %t - %p", NULL,
136                 N_("Format to use in playlist \"title\" field when using CDDB"),
137                 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
138
139     add_bool( MODULE_STRING "-cddb-enabled", 1, E_(CDDBEnabledCB),
140               N_("Do CDDB lookups?"),
141               N_("If set, lookup CD-DA track information using the CDDB "
142                  "protocol"),
143               VLC_FALSE );
144
145     add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
146                 N_("CDDB server"),
147                 N_( "Contact this CDDB server look up CD-DA information"),
148                  VLC_TRUE );
149
150     add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
151                  N_("CDDB server port"),
152                  N_("CDDB server uses this port number to communicate on"),
153                  VLC_TRUE );
154
155     add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
156                 N_("email address reported to CDDB server"),
157                 N_("email address reported to CDDB server"),
158                  VLC_TRUE );
159
160     add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
161               N_("Cache CDDB lookups?"),
162               N_("If set cache CDDB information about this CD"),
163               VLC_FALSE );
164
165     add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
166               N_("Contact CDDB via the HTTP protocol?"),
167               N_("If set, the CDDB server gets information via the CDDB HTTP "
168                  "protocol"),
169               VLC_TRUE );
170
171     add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
172                  N_("CDDB server timeout"),
173                  N_("Time (in seconds) to wait for a response from the "
174                     "CDDB server"),
175                  VLC_FALSE );
176
177     add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
178                 N_("Directory to cache CDDB requests"),
179                 N_("Directory to cache CDDB requests"),
180                  VLC_TRUE );
181
182 #endif
183
184 vlc_module_end();