vcd.c 5.77 KB
Newer Older
Gildas Bazin's avatar
 
Gildas Bazin committed
1 2 3
/*****************************************************************************
 * vcd.c : VCD input module for vlc
 *****************************************************************************
4
 * Copyright (C) 2000, 2003, 2004 VideoLAN
5
 * $Id$
Gildas Bazin's avatar
 
Gildas Bazin committed
6
 *
Sam Hocevar's avatar
Sam Hocevar committed
7
 * Authors: Rocky Bernstein <rocky@panix.com>
Gildas Bazin's avatar
 
Gildas Bazin committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

24 25 26 27
/*****************************************************************************
 * top-level module code - handles options, shortcuts, loads sub-modules.
 *****************************************************************************/

Gildas Bazin's avatar
 
Gildas Bazin committed
28 29 30 31 32 33 34
/*****************************************************************************
 * Preamble
 *****************************************************************************/

#include <vlc/vlc.h>

/*****************************************************************************
35
 * Exported prototypes
Gildas Bazin's avatar
 
Gildas Bazin committed
36
 *****************************************************************************/
37 38
int  E_(VCDOpen)      ( vlc_object_t * );
void E_(VCDClose)     ( vlc_object_t * );
39 40
int  E_(OpenIntf)     ( vlc_object_t * );
void E_(CloseIntf)    ( vlc_object_t * );
41 42
int  E_(VCDInit)      ( vlc_object_t * );
void E_(VCDEnd)       ( vlc_object_t * );
Gildas Bazin's avatar
 
Gildas Bazin committed
43

44
int  E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
Sam Hocevar's avatar
Sam Hocevar committed
45 46
                         vlc_value_t oldval, vlc_value_t val,
                         void *p_data );
Gildas Bazin's avatar
 
Gildas Bazin committed
47

48 49 50 51
int  E_(BlocksPerReadCallback) ( vlc_object_t *p_this, const char *psz_name,
				 vlc_value_t oldval, vlc_value_t val,
				 void *p_data );

52 53 54
/*****************************************************************************
 * Option help text
 *****************************************************************************/
Gildas Bazin's avatar
 
Gildas Bazin committed
55 56 57

#define DEBUG_LONGTEXT N_( \
    "This integer when viewed in binary is a debugging mask\n" \
58 59 60 61 62 63 64 65 66 67 68 69
    "meta info         1\n" \
    "event info        2\n" \
    "MRL               4\n" \
    "external call     8\n" \
    "all calls (10)   16\n" \
    "LSN       (20)   32\n" \
    "PBC       (40)   64\n" \
    "libcdio   (80)  128\n" \
    "seek-set (100)  256\n" \
    "seek-cur (200)  512\n" \
    "still    (400) 1024\n" \
    "vcdinfo  (800) 2048\n" )
Gildas Bazin's avatar
 
Gildas Bazin committed
70

71 72 73 74
#define VCD_TITLE_FMT_LONGTEXT N_( \
"Format used in the GUI Playlist Title. Similar to the Unix date \n" \
"Format specifiers that start with a percent sign. Specifiers are: \n" \
"   %A : The album information\n" \
Sam Hocevar's avatar
Sam Hocevar committed
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" \
Sam Hocevar's avatar
Sam Hocevar committed
78 79
"   %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" \
"   %L : The playlist ID prefixed with \" LID\" if it exists\n" \
80 81
"   %N : The current number of the %I - a decimal number\n" \
"   %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 85 86
"   %T : The MPEG track number (starts at 1)\n" \
"   %V : The volume set ID\n" \
"   %v : The volume ID\n" \
87 88 89
"       A number between 1 and the volume count.\n" \
"   %% : a % \n")

Gildas Bazin's avatar
 
Gildas Bazin committed
90 91 92
/*****************************************************************************
 * Module descriptor
 *****************************************************************************/
93

Gildas Bazin's avatar
 
Gildas Bazin committed
94
vlc_module_begin();
95
    add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") );
Gildas Bazin's avatar
 
Gildas Bazin committed
96
    set_description( _("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") );
97
    set_capability( "access2", 55 /* slightly lower than vcd */ );
98
    set_shortname( N_("(Super) Video CD"));
99
    set_callbacks( E_(VCDOpen), E_(VCDClose) );
Gildas Bazin's avatar
 
Gildas Bazin committed
100
    add_shortcut( "vcdx" );
101 102
    set_category( CAT_INPUT );
    set_subcategory( SUBCAT_INPUT_ACCESS );
Gildas Bazin's avatar
 
Gildas Bazin committed
103 104

    /* Configuration options */
Sam Hocevar's avatar
Sam Hocevar committed
105
    add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback),
Rocky Bernstein's avatar
Rocky Bernstein committed
106
                  N_("If nonzero, this gives additional debug information."),
Gildas Bazin's avatar
 
Gildas Bazin committed
107 108
                  DEBUG_LONGTEXT, VLC_TRUE );

109 110 111 112 113 114
    add_integer ( MODULE_STRING "-blocks-per-read", 20, 
		  E_(BlocksPerReadCallback),
                  N_("Number of CD blocks to get in a single read."),
                  N_("Number of CD blocks to get in a single read."),
		  VLC_TRUE );

115
    add_bool( MODULE_STRING "-PBC", 0, NULL,
Sam Hocevar's avatar
Sam Hocevar committed
116 117 118
              N_("Use playback control?"),
              N_("If VCD is authored with playback control, use it. "
                 "Otherwise we play by tracks."),
119
              VLC_FALSE );
Sam Hocevar's avatar
Sam Hocevar committed
120 121 122 123 124

    add_string( MODULE_STRING "-author-format",
                "%v - %F disc %c of %C",
                NULL,
                N_("Format to use in playlist \"author\""),
125 126
                VCD_TITLE_FMT_LONGTEXT, VLC_TRUE );

Sam Hocevar's avatar
Sam Hocevar committed
127
    add_string( MODULE_STRING "-title-format",
128
                "%I %N %L%S - %M %A %v - disc %c of %C %F",
Sam Hocevar's avatar
Sam Hocevar committed
129 130
                NULL,
                N_("Format to use in playlist \"title\" field"),
131
                VCD_TITLE_FMT_LONGTEXT, VLC_FALSE );
132

Gildas Bazin's avatar
 
Gildas Bazin committed
133 134 135
#ifdef FIXED
    add_submodule();
        set_capability( "demux", 0 );
136
        set_callbacks( E_(VCDInit), E_(VCDEnd) );
Gildas Bazin's avatar
 
Gildas Bazin committed
137 138
    add_submodule();
        set_capability( "interface", 0 );
139
        set_callbacks( E_(OpenIntf), E_(CloseIntf) );
140 141
#endif

Gildas Bazin's avatar
 
Gildas Bazin committed
142 143
vlc_module_end();