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