]> git.sesse.net Git - vlc/blob - modules/access/fs.c
modules: use the new add_shortcut capability (add multiple shortcuts at a time).
[vlc] / modules / access / fs.c
1 /*****************************************************************************
2  * fs.c: file system access plugin
3  *****************************************************************************
4  * Copyright (C) 2001-2006 the VideoLAN team
5  * Copyright © 2006-2007 Rémi Denis-Courmont
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *          Rémi Denis-Courmont <rem # videolan # org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <vlc_common.h>
30 #include "fs.h"
31 #include <vlc_plugin.h>
32
33 #define CACHING_TEXT N_("Caching value (ms)")
34 #define CACHING_LONGTEXT N_( \
35     "Caching value for files, in milliseconds." )
36
37 #define NETWORK_CACHING_TEXT N_("Extra network caching value (ms)")
38 #define NETWORK_CACHING_LONGTEXT N_( \
39     "Supplementary caching value for remote files, in milliseconds." )
40
41 #define RECURSIVE_TEXT N_("Subdirectory behavior")
42 #define RECURSIVE_LONGTEXT N_( \
43         "Select whether subdirectories must be expanded.\n" \
44         "none: subdirectories do not appear in the playlist.\n" \
45         "collapse: subdirectories appear but are expanded on first play.\n" \
46         "expand: all subdirectories are expanded.\n" )
47
48 static const char *const psz_recursive_list[] = { "none", "collapse", "expand" };
49 static const char *const psz_recursive_list_text[] = {
50     N_("none"), N_("collapse"), N_("expand") };
51
52 #define IGNORE_TEXT N_("Ignored extensions")
53 #define IGNORE_LONGTEXT N_( \
54         "Files with these extensions will not be added to playlist when " \
55         "opening a directory.\n" \
56         "This is useful if you add directories that contain playlist files " \
57         "for instance. Use a comma-separated list of extensions." )
58
59 vlc_module_begin ()
60     set_description( N_("File input") )
61     set_shortname( N_("File") )
62     set_category( CAT_INPUT )
63     set_subcategory( SUBCAT_INPUT_ACCESS )
64     add_integer( "file-caching", DEFAULT_PTS_DELAY / 1000, NULL,
65                  CACHING_TEXT, CACHING_LONGTEXT, true )
66         change_safe()
67     add_integer( "network-caching", 3 * DEFAULT_PTS_DELAY / 1000, NULL,
68                  NETWORK_CACHING_TEXT, NETWORK_CACHING_LONGTEXT, true )
69         change_safe()
70     add_obsolete_string( "file-cat" )
71     set_capability( "access", 50 )
72     add_shortcut( "file", "fd", "stream" )
73     set_callbacks( Open, Close )
74
75     add_submodule()
76     set_shortname( N_("Directory" ) )
77     set_description( N_("Directory input") )
78     set_capability( "access", 55 )
79     add_string( "recursive", "expand" , NULL, RECURSIVE_TEXT,
80                 RECURSIVE_LONGTEXT, false )
81       change_string_list( psz_recursive_list, psz_recursive_list_text, 0 )
82     add_string( "ignore-filetypes", "m3u,db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,sub,idx,srt,cue,ssa",
83                 NULL, IGNORE_TEXT, IGNORE_LONGTEXT, false )
84 #ifndef HAVE_FDOPENDIR
85     add_shortcut( "file", "directory", "dir" )
86 #else
87     add_shortcut( "directory", "dir" )
88 #endif
89     set_callbacks( DirOpen, DirClose )
90 vlc_module_end ()