]> git.sesse.net Git - vlc/blob - modules/access/vcdx/vcd.c
a44471d5c20de02b5fe5a505e8610b59344a6631
[vlc] / modules / access / vcdx / vcd.c
1 /*****************************************************************************
2  * vcd.c : VCD input module for vlc
3  *****************************************************************************
4  * Copyright (C) 2000,2003 VideoLAN
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., 59 Temple Place - Suite 330, Boston, MA  02111, 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  E_(Open)         ( vlc_object_t * );
38 void E_(Close)        ( vlc_object_t * );
39 int  E_(OpenIntf)     ( vlc_object_t * );
40 void E_(CloseIntf)    ( vlc_object_t * );
41 int  E_(InitVCD)      ( vlc_object_t * );
42 void E_(EndVCD)       ( 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 /*****************************************************************************
49  * Option help text
50  *****************************************************************************/
51
52 #define DEBUG_LONGTEXT N_( \
53     "This integer when viewed in binary is a debugging mask\n" \
54     "meta info         1\n" \
55     "event info        2\n" \
56     "MRL               4\n" \
57     "external call     8\n" \
58     "all calls (10)   16\n" \
59     "LSN       (20)   32\n" \
60     "PBC       (40)   64\n" \
61     "libcdio   (80)  128\n" \
62     "seek-set (100)  256\n" \
63     "seek-cur (200)  512\n" \
64     "still    (400) 1024\n" \
65     "vcdinfo  (800) 2048\n" )
66
67 #define VCD_TITLE_FMT_LONGTEXT N_( \
68 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
69 "Format specifiers that start with a percent sign. Specifiers are: \n" \
70 "   %A : The album information\n" \
71 "   %C : The VCD volume count - the number of CDs in the collection\n" \
72 "   %c : The VCD volume num - the number of the CD in the collection.\n" \
73 "   %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" \
74 "   %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" \
75 "   %L : The playlist ID prefixed with \" LID\" if it exists\n" \
76 "   %N : The current number of the %I - a decimal number\n" \
77 "   %P : The publisher ID\n" \
78 "   %p : The preparer I\n" \
79 "   %S : If we are in a segment (menu), the kind of segment\n" \
80 "   %T : The track number\n" \
81 "   %V : The volume set I\n" \
82 "   %v : The volume I\n" \
83 "       A number between 1 and the volume count.\n" \
84 "   %% : a % \n")
85
86 /*****************************************************************************
87  * Module descriptor
88  *****************************************************************************/
89
90 vlc_module_begin();
91     add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") );
92     set_description( _("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") );
93     set_capability( "access", 85 /* slightly higher than vcd */ );
94     set_callbacks( E_(Open), E_(Close) );
95     add_shortcut( "vcd" );
96     add_shortcut( "vcdx" );
97
98     /* Configuration options */
99     add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback),
100                   N_("If nonzero, this gives additional debug information."),
101                   DEBUG_LONGTEXT, VLC_TRUE );
102
103     add_bool( MODULE_STRING "-PBC", 0, NULL,
104               N_("Use playback control?"),
105               N_("If VCD is authored with playback control, use it. "
106                  "Otherwise we play by tracks."),
107               VLC_FALSE );
108
109     add_string( MODULE_STRING "-author-format",
110                 "%v - %F disc %c of %C",
111                 NULL,
112                 N_("Format to use in playlist \"author\""),
113                 VCD_TITLE_FMT_LONGTEXT, VLC_TRUE );
114
115     add_string( MODULE_STRING "-title-format",
116                 "%I %N%L%S - %M",
117                 NULL,
118                 N_("Format to use in playlist \"title\" field"),
119                 VCD_TITLE_FMT_LONGTEXT, VLC_TRUE );
120
121 #ifdef FIXED
122     add_submodule();
123         set_capability( "demux", 0 );
124         set_callbacks( E_(InitVCD), E_(EndVCD) );
125 #endif
126
127     add_submodule();
128         set_capability( "interface", 0 );
129         set_callbacks( E_(OpenIntf), E_(CloseIntf) );
130 vlc_module_end();
131