]> git.sesse.net Git - vlc/blob - modules/access/cdda/cdda.c
* ALL: removed a bunch of unused add_category_hint().
[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.17 2004/01/25 18:53:06 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 int  E_(DemuxOpen)    ( vlc_object_t * p_this);
41 void E_(DemuxClose)   ( vlc_object_t * p_this);
42
43 int  E_(DebugCB)      ( vlc_object_t *p_this, const char *psz_name,
44                         vlc_value_t oldval, vlc_value_t val,
45                         void *p_data );
46
47 int  E_(CDDBEnabledCB)( vlc_object_t *p_this, const char *psz_name,
48                         vlc_value_t oldval, vlc_value_t val,
49                         void *p_data );
50
51 /*****************************************************************************
52  * Module descriptor
53  *****************************************************************************/
54
55 /*****************************************************************************
56  * Option help text
57  *****************************************************************************/
58
59 #define DEBUG_LONGTEXT N_( \
60     "This integer when viewed in binary is a debugging mask\n" \
61     "meta info        1\n" \
62     "events           2\n" \
63     "MRL              4\n" \
64     "external call    8\n" \
65     "all calls (10)  16\n" \
66     "LSN       (20)  32\n" \
67     "seek      (40)  64\n" \
68     "libcdio   (80) 128\n" \
69     "libcddb  (100) 256\n" )
70
71 #define CACHING_LONGTEXT N_( \
72     "Allows you to modify the default caching value for CDDA streams. This " \
73     "value should be set in millisecond units." )
74
75 #define CDDB_TITLE_FMT_LONGTEXT N_( \
76 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
77 "Format specifiers that start with a percent sign. Specifiers are: \n" \
78 "   %a : The artist\n" \
79 "   %A : The album information\n" \
80 "   %C : Category\n" \
81 "   %I : CDDB disk ID\n" \
82 "   %G : Genre\n" \
83 "   %M : The current MRL\n" \
84 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
85 "   %n : The number of tracks on the CD\n" \
86 "   %p : The artist/performer/composer in the track\n" \
87 "   %T : The track number\n" \
88 "   %s : Number of seconds in this track \n" \
89 "   %t : The title\n" \
90 "   %Y : The year 19xx or 20xx\n" \
91 "   %% : a % \n")
92
93 #define TITLE_FMT_LONGTEXT N_( \
94 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
95 "Format specifiers that start with a percent sign. Specifiers are: \n" \
96 "   %M : The current MRL\n" \
97 "   %m : The CD-DA Media Catalog Number (MCN)\n" \
98 "   %n : The number of tracks on the CD\n" \
99 "   %T : The track number\n" \
100 "   %s : Number of seconds in this track \n" \
101 "   %% : a % \n")
102
103 /*****************************************************************************
104  * Module descriptor
105  *****************************************************************************/
106
107 vlc_module_begin();
108     add_usage_hint( N_("cddax://[device-or-file][@[T]num]") );
109     set_description( _("Compact Disc Digital Audio (CD-DA) input") );
110     set_capability( "access", 75 /* slightly higher than cdda */ );
111     set_callbacks( E_(Open), E_(Close) );
112     add_shortcut( "cdda" );
113     add_shortcut( "cddax" );
114
115     /* Configuration options */
116     add_integer ( MODULE_STRING "-debug", 0, E_(DebugCB),
117                   N_("If nonzero, this gives additional debug information."),
118                   DEBUG_LONGTEXT, VLC_TRUE );
119
120     add_integer( MODULE_STRING "-caching",
121                  DEFAULT_PTS_DELAY / 1000, NULL,
122                  N_("Caching value in microseconds"),
123                  CACHING_LONGTEXT, VLC_TRUE );
124
125     add_string( MODULE_STRING "-author-format",
126                 "%A - %a %C %I", NULL,
127                 N_("Format to use in playlist \"author\" field"),
128                 TITLE_FMT_LONGTEXT, VLC_TRUE );
129
130     add_string( MODULE_STRING "-title-format",
131                 "%T %M", NULL,
132                 N_("Format to use in playlist \"title\" field when no CDDB"),
133                 TITLE_FMT_LONGTEXT, VLC_TRUE );
134
135 #ifdef HAVE_LIBCDDB
136     add_string( MODULE_STRING "-cddb-title-format",
137                 "Track %T. %t - %p", NULL,
138                 N_("Format to use in playlist \"title\" field when using CDDB"),
139                 CDDB_TITLE_FMT_LONGTEXT, VLC_TRUE );
140
141     add_bool( MODULE_STRING "-cddb-enabled", 1, E_(CDDBEnabledCB),
142               N_("Do CDDB lookups?"),
143               N_("If set, lookup CD-DA track information using the CDDB "
144                  "protocol"),
145               VLC_FALSE );
146
147     add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
148                 N_("CDDB server"),
149                 N_( "Contact this CDDB server look up CD-DA information"),
150                  VLC_TRUE );
151
152     add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
153                  N_("CDDB server port"),
154                  N_("CDDB server uses this port number to communicate on"),
155                  VLC_TRUE );
156
157     add_string( MODULE_STRING "-cddb-email", "me@home", NULL,
158                 N_("email address reported to CDDB server"),
159                 N_("email address reported to CDDB server"),
160                  VLC_TRUE );
161
162     add_bool( MODULE_STRING "-cddb-enable-cache", 1, NULL,
163               N_("Cache CDDB lookups?"),
164               N_("If set cache CDDB information about this CD"),
165               VLC_FALSE );
166
167     add_bool( MODULE_STRING "-cddb-httpd", 0, NULL,
168               N_("Contact CDDB via the HTTP protocol?"),
169               N_("If set, the CDDB server gets information via the CDDB HTTP "
170                  "protocol"),
171               VLC_TRUE );
172
173     add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
174                  N_("CDDB server timeout"),
175                  N_("Time (in seconds) to wait for a response from the "
176                     "CDDB server"),
177                  VLC_FALSE );
178
179     add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
180                 N_("Directory to cache CDDB requests"),
181                 N_("Directory to cache CDDB requests"),
182                  VLC_TRUE );
183
184 #endif
185
186     add_submodule();
187         set_description( _("Audio CD demux") );
188         set_capability( "demux", 0 );
189         set_callbacks( E_(DemuxOpen), E_(DemuxClose) );
190         add_shortcut( "cdda" );
191
192 vlc_module_end();