1 /*****************************************************************************
2 * fs.c: file system access plugin
3 *****************************************************************************
4 * Copyright (C) 2001-2006 VLC authors and VideoLAN
5 * Copyright © 2006-2007 Rémi Denis-Courmont
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * Rémi Denis-Courmont <rem # videolan # org>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
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 Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
29 #include <vlc_common.h>
31 #include <vlc_plugin.h>
33 #define IGNORE_TEXT N_("Ignored extensions")
34 #define IGNORE_LONGTEXT N_( \
35 "Files with these extensions will not be added to playlist when " \
36 "opening a directory.\n" \
37 "This is useful if you add directories that contain playlist files " \
38 "for instance. Use a comma-separated list of extensions." )
40 static const char *const psz_sort_list[] = { "collate", "version", "none" };
41 static const char *const psz_sort_list_text[] = {
42 N_("Sort alphabetically according to the current language's collation rules."),
43 N_("Sort items in a natural order (for example: 1.ogg 2.ogg 10.ogg). This method does not take the current language's collation rules into account."),
44 N_("Do not sort the items.") };
46 #define SORT_TEXT N_("Directory sort order")
47 #define SORT_LONGTEXT N_( \
48 "Define the sort algorithm used when adding items from a directory." )
51 set_description( N_("File input") )
52 set_shortname( N_("File") )
53 set_category( CAT_INPUT )
54 set_subcategory( SUBCAT_INPUT_ACCESS )
55 add_obsolete_string( "file-cat" )
56 set_capability( "access", 50 )
57 add_shortcut( "file", "fd", "stream" )
58 set_callbacks( FileOpen, FileClose )
61 set_section( N_("Directory" ), NULL )
62 set_capability( "access", 55 )
63 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",
64 IGNORE_TEXT, IGNORE_LONGTEXT, false )
65 add_string( "directory-sort", "collate", SORT_TEXT, SORT_LONGTEXT, false )
66 change_string_list( psz_sort_list, psz_sort_list_text )
67 #ifndef HAVE_FDOPENDIR
68 add_shortcut( "file", "directory", "dir" )
70 add_shortcut( "directory", "dir" )
72 set_callbacks( DirOpen, DirClose )