]> git.sesse.net Git - vlc/blob - modules/access/cdda/cdda.c
Split out cdda to facilitate later changes.
[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.2 2003/11/26 03:35:26 rocky Exp $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *          Gildas Bazin <gbazin@netcourrier.com>
9  *          Rocky Bernstein <rocky@panix.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_(DebugCallback)       ( vlc_object_t *p_this, const char *psz_name,
45                                vlc_value_t oldval, vlc_value_t val, 
46                                void *p_data );
47
48 /*****************************************************************************
49  * Module descriptor
50  *****************************************************************************/
51
52 /*****************************************************************************
53  * Option help text
54  *****************************************************************************/
55
56 #define DEBUG_TEXT N_("set debug mask for additional debugging.")
57 #define DEBUG_LONGTEXT N_( \
58     "This integer when viewed in binary is a debugging mask\n" \
59     "MRL             1\n" \
60     "events          2\n" \
61     "external call   4\n" \
62     "all calls       8\n" \
63     "LSN      (10)  16\n" \
64     "libcdio  (20)  32\n" \
65     "seeks    (40)  64\n" )
66
67 #define DEV_TEXT N_("CD-ROM device name")
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.")
71
72 #define CACHING_TEXT N_("Caching value in ms")
73 #define CACHING_LONGTEXT N_( \
74     "Allows you to modify the default caching value for cdda streams. This " \
75     "value should be set in millisecond units." )
76
77 /*****************************************************************************
78  * Module descriptor
79  *****************************************************************************/
80
81 vlc_module_begin();
82     add_usage_hint( N_("cddax://[device-or-file][@num]") );
83     set_description( _("Compact Disc Digital Audio (CD-DA) input") );
84     set_capability( "access", 75 /* slightly higher than cdda */ );
85     set_callbacks( E_(Open), E_(Close) );
86     add_shortcut( "cdda" );
87     add_shortcut( "cddax" );
88
89     /* Configuration options */
90     add_category_hint( N_("CDX"), NULL, VLC_TRUE );
91
92     add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback), DEBUG_TEXT, 
93                   DEBUG_LONGTEXT, VLC_TRUE );
94
95     add_integer( MODULE_STRING "-caching", 
96                  DEFAULT_PTS_DELAY / 1000, NULL, 
97                  CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
98
99     add_string( MODULE_STRING "-device", "", NULL, DEV_TEXT, 
100                 DEV_LONGTEXT, VLC_TRUE );
101
102     add_submodule();
103         set_description( _("CD Audio demux") );
104         set_capability( "demux", 0 );
105         set_callbacks( E_(DemuxOpen), E_(DemuxClose) );
106         add_shortcut( "cdda" );
107
108     add_submodule();
109         set_capability( "interface", 0 );
110         set_callbacks( E_(OpenIntf), E_(CloseIntf) );
111
112 vlc_module_end();