]> git.sesse.net Git - vlc/blob - modules/access/vcdx/vcd.c
a63ed08286aa86fbcc9e95314c3f08674072a70d
[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 along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 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 #ifdef HAVE_CONFIG_H
33 # include "config.h"
34 #endif
35
36 #include <vlc_common.h>
37 #include <vlc_plugin.h>
38 #include <vlc_charset.h>
39
40 #include "vcd.h"
41 #include "access.h"
42
43 /*****************************************************************************
44  * Option help text
45  *****************************************************************************/
46
47 #define DEBUG_LONGTEXT \
48     "This integer when viewed in binary is a debugging mask\n" \
49     "meta info         1\n" \
50     "event info        2\n" \
51     "MRL               4\n" \
52     "external call     8\n" \
53     "all calls (10)   16\n" \
54     "LSN       (20)   32\n" \
55     "PBC       (40)   64\n" \
56     "libcdio   (80)  128\n" \
57     "seek-set (100)  256\n" \
58     "seek-cur (200)  512\n" \
59     "still    (400) 1024\n" \
60     "vcdinfo  (800) 2048\n"
61
62 #define VCD_TITLE_FMT_LONGTEXT \
63 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
64 "Format specifiers that start with a percent sign. Specifiers are: \n" \
65 "   %A : The album information\n" \
66 "   %C : The VCD volume count - the number of CDs in the collection\n" \
67 "   %c : The VCD volume num - the number of the CD in the collection.\n" \
68 "   %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" \
69 "   %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" \
70 "   %L : The playlist ID prefixed with \" LID\" if it exists\n" \
71 "   %N : The current number of the %I - a decimal number\n" \
72 "   %P : The publisher ID\n" \
73 "   %p : The preparer ID\n" \
74 "   %S : If we are in a segment (menu), the kind of segment\n" \
75 "   %T : The MPEG track number (starts at 1)\n" \
76 "   %V : The volume set ID\n" \
77 "   %v : The volume ID\n" \
78 "       A number between 1 and the volume count.\n" \
79 "   %% : a % \n"
80
81 /*****************************************************************************
82  * Module descriptor
83  *****************************************************************************/
84
85 vlc_module_begin ()
86     set_shortname( N_("(Super) Video CD"))
87     set_description( N_("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") )
88     add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") )
89     add_shortcut( "vcdx" )
90     set_category( CAT_INPUT )
91     set_subcategory( SUBCAT_INPUT_ACCESS )
92     set_capability( "access", 55 /* slightly lower than vcd */ )
93     set_callbacks( VCDOpen, VCDClose )
94
95     /* Configuration options */
96     add_integer ( MODULE_STRING "-debug", 0, NULL,
97                   N_("If nonzero, this gives additional debug information."),
98                   DEBUG_LONGTEXT, true )
99
100     add_integer ( MODULE_STRING "-blocks-per-read", 20,
101           NULL,
102                   N_("Number of CD blocks to get in a single read."),
103                   N_("Number of CD blocks to get in a single read."),
104           true )
105
106     add_bool( MODULE_STRING "-PBC", 0, NULL,
107               N_("Use playback control?"),
108               N_("If VCD is authored with playback control, use it. "
109                  "Otherwise we play by tracks."),
110               false )
111
112     add_bool( MODULE_STRING "-track-length", true,
113           NULL,
114               N_("Use track length as maximum unit in seek?"),
115               N_("If set, the length of the seek bar is the track rather than "
116          "the length of an entry."),
117               false )
118
119     add_bool( MODULE_STRING "-extended-info", 0, NULL,
120               N_("Show extended VCD info?"),
121               N_("Show the maximum amount of information under Stream and "
122                  "Media Info. Shows for example playback control navigation."),
123               false )
124
125     add_string( MODULE_STRING "-author-format",
126                 "%v - %F disc %c of %C",
127                 NULL,
128                 N_("Format to use in the playlist's \"author\" field."),
129                 VCD_TITLE_FMT_LONGTEXT, true )
130
131     add_string( MODULE_STRING "-title-format",
132                 "%I %N %L%S - %M %A %v - disc %c of %C %F",
133                 NULL,
134                 N_("Format to use in the playlist's \"title\" field."),
135                 VCD_TITLE_FMT_LONGTEXT, false )
136
137 vlc_module_end ()
138