]> git.sesse.net Git - vlc/blob - modules/access/vcdx/vcd.c
0a956635a39bebafa3c3c4c497c0f584a2dec449
[vlc] / modules / access / vcdx / vcd.c
1 /*****************************************************************************
2  * vcd.c : VCD input module for vlc
3  *****************************************************************************
4  * Copyright (C) 2000, 2003, 2004, 2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Rocky Bernstein <rocky@panix.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * top-level module code - handles options, shortcuts, loads sub-modules.
26  *****************************************************************************/
27
28 /*****************************************************************************
29  * Preamble
30  *****************************************************************************/
31
32 #include <vlc/vlc.h>
33
34 /*****************************************************************************
35  * Exported prototypes
36  *****************************************************************************/
37 int  VCDOpen       ( vlc_object_t * );
38 void VCDClose      ( vlc_object_t * );
39 int  VCDOpenIntf   ( vlc_object_t * );
40 void VCDCloseIntf  ( vlc_object_t * );
41 int  E_(VCDInit)   ( vlc_object_t * );
42 void E_(VCDEnd)    ( vlc_object_t * );
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 int  E_(BlocksPerReadCallback) ( 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  * Option help text
54  *****************************************************************************/
55
56 #define DEBUG_LONGTEXT \
57     "This integer when viewed in binary is a debugging mask\n" \
58     "meta info         1\n" \
59     "event info        2\n" \
60     "MRL               4\n" \
61     "external call     8\n" \
62     "all calls (10)   16\n" \
63     "LSN       (20)   32\n" \
64     "PBC       (40)   64\n" \
65     "libcdio   (80)  128\n" \
66     "seek-set (100)  256\n" \
67     "seek-cur (200)  512\n" \
68     "still    (400) 1024\n" \
69     "vcdinfo  (800) 2048\n"
70
71 #define VCD_TITLE_FMT_LONGTEXT \
72 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
73 "Format specifiers that start with a percent sign. Specifiers are: \n" \
74 "   %A : The album information\n" \
75 "   %C : The VCD volume count - the number of CDs in the collection\n" \
76 "   %c : The VCD volume num - the number of the CD in the collection.\n" \
77 "   %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" \
78 "   %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" \
79 "   %L : The playlist ID prefixed with \" LID\" if it exists\n" \
80 "   %N : The current number of the %I - a decimal number\n" \
81 "   %P : The publisher ID\n" \
82 "   %p : The preparer ID\n" \
83 "   %S : If we are in a segment (menu), the kind of segment\n" \
84 "   %T : The MPEG track number (starts at 1)\n" \
85 "   %V : The volume set ID\n" \
86 "   %v : The volume ID\n" \
87 "       A number between 1 and the volume count.\n" \
88 "   %% : a % \n"
89
90 /*****************************************************************************
91  * Module descriptor
92  *****************************************************************************/
93
94 vlc_module_begin();
95     set_shortname( _("(Super) Video CD"));
96     set_description( _("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") );
97     add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") );
98     add_shortcut( "vcdx" );
99     set_category( CAT_INPUT );
100     set_subcategory( SUBCAT_INPUT_ACCESS );
101     set_capability( "access2", 55 /* slightly lower than vcd */ );
102     set_callbacks( VCDOpen, VCDClose );
103
104     /* Configuration options */
105     add_integer ( MODULE_STRING "-debug", 0, NULL,
106                   N_("If nonzero, this gives additional debug information."),
107                   DEBUG_LONGTEXT, VLC_TRUE );
108
109     add_integer ( MODULE_STRING "-blocks-per-read", 20, 
110                   NULL,
111                   N_("Number of CD blocks to get in a single read."),
112                   N_("Number of CD blocks to get in a single read."),
113                   VLC_TRUE );
114
115     add_bool( MODULE_STRING "-PBC", 0, NULL,
116               N_("Use playback control?"),
117               N_("If VCD is authored with playback control, use it. "
118                  "Otherwise we play by tracks."),
119               VLC_FALSE );
120
121     add_bool( MODULE_STRING "-track-length", VLC_TRUE, 
122               NULL,
123               N_("Use track length as maximum unit in seek?"),
124               N_("If set, the length of the seek bar is the track rather than "
125                  "the length of an entry."),
126               VLC_FALSE );
127
128     add_bool( MODULE_STRING "-extended-info", 0, NULL,
129               N_("Show extended VCD info?"),
130               N_("Show the maximum amount of information under Stream and "
131                  "Media Info. Shows for example playback control navigation."),
132               VLC_FALSE );
133
134     add_string( MODULE_STRING "-author-format",
135                 "%v - %F disc %c of %C",
136                 NULL,
137                 N_("Format to use in the playlist's \"author\" field."),
138                 VCD_TITLE_FMT_LONGTEXT, VLC_TRUE );
139
140     add_string( MODULE_STRING "-title-format",
141                 "%I %N %L%S - %M %A %v - disc %c of %C %F",
142                 NULL,
143                 N_("Format to use in the playlist's \"title\" field."),
144                 VCD_TITLE_FMT_LONGTEXT, VLC_FALSE );
145
146 vlc_module_end();
147