VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_config_cat.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_config_cat.h : Definition of configuration categories
3 *****************************************************************************
4 * Copyright (C) 2003 VLC authors and VideoLAN
5 * Copyright (C) 2023 Videolabs
6 *
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Anil Daoud <anil@videolan.org>
9 * Alexandre Janniaux <ajanni@videolabs.io>
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
25
26#ifndef VLC_CONFIG_CAT_H
27#define VLC_CONFIG_CAT_H
28
29# include <vlc_plugin.h>
30
31#define MAIN_TITLE N_( "VLC preferences" )
33/* - Titles -
34 * These are used for simple prefs view tabs, for advanced prefs view
35 * cat & subcat nodes, and for the panel titles of general subcat panels.
36 */
37
38#define INTF_TITLE N_( "Interface" )
39#define AUDIO_TITLE N_( "Audio" )
40#define VIDEO_TITLE N_( "Video" )
41#define INPUT_TITLE N_( "Input / Codecs" )
42#define SOUT_TITLE N_( "Stream output" )
43#define PLAYLIST_TITLE N_( "Playlist" )
44#define AADVANCED_TITLE N_( "Advanced" )
45#define SUBPIC_TITLE N_( "Subtitles / OSD" )
46#define HOTKEYS_TITLE N_( "Hotkeys" )
47#define ML_TITLE N_( "Media Library" )
49/* - Tooltip text -
50 * These are used for simple prefs view tabs.
51 */
52
53#define INTF_TOOLTIP N_( "Interface Settings" )
54#define AUDIO_TOOLTIP N_( "Audio Settings" )
55#define VIDEO_TOOLTIP N_( "Video Settings" )
56#define SUBPIC_TOOLTIP N_( "Subtitle & On Screen Display Settings" )
57#define INPUT_TOOLTIP N_( "Input & Codec Settings" )
58#define HOTKEYS_TOOLTIP N_( "Hotkeys Settings" )
59#define ML_TOOLTIP N_( "Media Library Settings" )
61/* - Help text -
62 * These are shown on advanced view panels.
63 */
64
65/* Interface */
66#define INTF_HELP N_( "Settings for VLC's interfaces" )
67#define INTF_GENERAL_HELP N_( "Main interfaces settings" )
68#define INTF_MAIN_HELP N_( "Settings for the main interface" )
69#define INTF_CONTROL_HELP N_( "Settings for VLC's control interfaces" )
70#define INTF_HOTKEYS_HELP N_( "Hotkeys settings" )
72/* Audio */
73#define AUDIO_HELP N_( "Audio settings" )
74#define AUDIO_GENERAL_HELP N_("General audio settings")
75#define AFILTER_HELP N_( "Audio filters are used to process the audio stream." )
76#define AVISUAL_HELP N_( "Audio visualizations" )
77#define AOUT_HELP N_("General settings for audio output modules.")
79/* Video */
80#define VIDEO_HELP N_("Video settings")
81#define VIDEO_GENERAL_HELP N_( "General video settings" )
82#define VOUT_HELP N_("General settings for video output modules.")
83#define VFILTER_HELP N_("Video filters are used to process the video stream." )
84#define SUBPIC_HELP N_( "Settings related to On-Screen-Display,"\
85 " subtitles and \"overlay subpictures\"")
86#define SPLITTER_HELP N_("Video splitters separate the stream into multiple videos.")
88/* Input */
89#define INPUT_HELP N_( "Settings for input, demultiplexing, " \
90 "decoding and encoding")
91#define ACCESS_HELP N_( \
92 "Settings related to the various access methods. " \
93 "Common settings you may want to alter are HTTP proxy or " \
94 "caching settings." )
95#define STREAM_FILTER_HELP N_( \
96 "Stream filters are special modules that allow advanced operations on " \
97 "the input side of VLC. Use with care..." )
98#define DEMUX_HELP N_( "Demuxers are used to separate audio and video streams." )
99#define VDEC_HELP N_( "Settings for the video, images or video+audio decoders and encoders." )
100#define ADEC_HELP N_( "Settings for the audio-only decoders and encoders." )
101#define SDEC_HELP N_( "Settings for subtitle, teletext and CC decoders and encoders." )
103/* Sout */
104#define SOUT_HELP N_( \
105 "Stream output settings are used when acting as a streaming server " \
106 "or when saving incoming streams.\n" \
107 "Streams are first muxed and then sent through an \"access output\" "\
108 "module that can either save the stream to a file, or stream " \
109 "it (UDP, HTTP, RTP/RTSP).\n" \
110 "Sout streams modules allow advanced stream processing (transcoding, "\
111 "duplicating...).")
112#define SOUT_GENERAL_HELP N_( "General stream output settings")
113#define SOUT_MUX_HELP N_( \
114 "Muxers create the encapsulation formats that are used to " \
115 "put all the elementary streams (video, audio, ...) " \
116 "together. This setting allows you to always force a specific muxer. " \
117 "You should probably not do that.\n" \
118 "You can also set default parameters for each muxer." )
119#define SOUT_ACO_HELP N_( \
120 "Access output modules control the ways the muxed streams are sent. " \
121 "This setting allows you to always force a specific access output method. " \
122 "You should probably not do that.\n" \
123 "You can also set default parameters for each access output.")
124#define SOUT_PACKET_HELP N_( \
125 "Packetizers are used to \"preprocess\" the elementary "\
126 "streams before muxing. " \
127 "This setting allows you to always force a packetizer. " \
128 "You should probably not do that.\n" \
129 "You can also set default parameters for each packetizer." )
130#define SOUT_RENDER_HELP N_( "External renderer discovery related settings." )
131#define SOUT_STREAM_HELP N_( "Sout stream modules allow to build a sout " \
132 "processing chain. Please refer to the Streaming 'how-to' for " \
133 "more information. You can configure default options for " \
134 "each sout stream module here.")
135#define SOUT_VOD_HELP N_( "VLC's implementation of Video On Demand" )
137/* Playlist */
138#define PLAYLIST_HELP N_( "Settings related to playlist behaviour " \
139 "(e.g. playback mode) and to modules that automatically add "\
140 "items to the playlist (\"service discovery\" modules).")
141#define PGENERAL_HELP N_( "General playlist behaviour")
142#define SD_HELP N_("Services discovery modules are facilities "\
143 "that automatically add items to playlist.")
144#define PEXPORT_HELP N_( "Settings relating to exporting playlists." )
146/* Advanced */
147#define AADVANCED_HELP N_( "Advanced settings. Use with care...")
148#define ANETWORK_HELP N_( "Advanced network settings." )
161 const char *name;
162 const char *help;
164
165/**
166 * Fetch category information from VLC
167 */
170
172vlc_config_cat_GetAt(size_t index);
173
176
178vlc_config_subcat_GetAt(size_t index);
179
180VLC_API VLC_USED size_t
182
183VLC_API VLC_USED size_t
185
186/** Get the "general" subcategory for a given category.
187 *
188 * In a cat/subcat preference tree, subcategories typically appear as child
189 * nodes under their respective parent category node. Core config items, which
190 * are always associated with a particular subcategory, are shown when that
191 * subcategory node is selected. Each category however has a "general"
192 * subcategory which is not shown as a child node, instead the options for
193 * this are shown when the category node itself is selected in the tree.
194 *
195 * One or more nodes are also created in the tree per plugin, with the
196 * location relating to the subcategory association of its config items. Plugin
197 * nodes associated with general subcategories naturally appear as child nodes
198 * of the category node (as a sibling to its subcategory nodes), rather than as
199 * a child node of a subcategory node.
200 */
204 const struct config_category_t *c = vlc_config_cat_Find(cat);
205 if (c == NULL)
206 return SUBCAT_UNKNOWN;
207 return c->general_subcat;
208}
209
210/** Get the name for a subcategory. */
212static inline const char *vlc_config_subcat_GetName( enum vlc_config_subcat subcat )
214 const struct config_subcategory_t *s = vlc_config_subcat_Find(subcat);
215 if (s == NULL)
216 return NULL;
217 return vlc_gettext(s->name);
218}
219
220/** Get the help text for a subcategory. */
222static inline const char *vlc_config_subcat_GetHelp( enum vlc_config_subcat subcat )
224 const struct config_subcategory_t *s = vlc_config_subcat_Find(subcat);
225 if (s == NULL)
226 return NULL;
227 return vlc_gettext(s->help);
228}
229
230/** Get the name for a category. */
232static inline const char *vlc_config_cat_GetName( enum vlc_config_cat cat )
235 return vlc_config_subcat_GetName( subcat );
236}
237
238/** Get the help text for a category. */
240static inline const char *vlc_config_cat_GetHelp( enum vlc_config_cat cat )
242 const struct config_category_t *c = vlc_config_cat_Find(cat);
243 if (c == NULL)
244 return NULL;
245 return vlc_gettext(c->help);
246}
247
248/** Get the parent category for the given subcategory. */
250static inline enum vlc_config_cat vlc_config_cat_FromSubcat( enum vlc_config_subcat subcat )
252 const struct config_subcategory_t *s = vlc_config_subcat_Find(subcat);
253 if (s == NULL)
254 return CAT_UNKNOWN;
255 return s->cat;
256}
257
258/** Check if the given subcategory is a "general" one. */
260static inline bool vlc_config_subcat_IsGeneral( enum vlc_config_subcat subcat )
262 if( subcat == SUBCAT_UNKNOWN )
263 return false;
265 return (subcat == vlc_config_cat_GetGeneralSubcat( cat ));
266}
267
268#endif /* VLC_CONFIG_CAT_H */
#define VLC_USED
Definition fourcc_gen.c:32
#define VLC_API
Definition fourcc_gen.c:31
Definition vlc_config_cat.h:152
const char * help
Definition vlc_config_cat.h:155
enum vlc_config_subcat general_subcat
Definition vlc_config_cat.h:154
enum vlc_config_cat id
Definition vlc_config_cat.h:153
Definition vlc_config_cat.h:159
const char * help
Definition vlc_config_cat.h:163
enum vlc_config_cat cat
Definition vlc_config_cat.h:161
const char * name
Definition vlc_config_cat.h:162
enum vlc_config_subcat id
Definition vlc_config_cat.h:160
const char * vlc_gettext(const char *msgid)
In-tree plugins share their gettext domain with LibVLC.
Definition textdomain.c:80
This file is a collection of common definitions and types.
const struct config_subcategory_t * vlc_config_subcat_Find(enum vlc_config_subcat subcat)
Definition cat.c:110
size_t vlc_config_cat_Count(void)
Definition cat.c:128
static const char * vlc_config_cat_GetName(enum vlc_config_cat cat)
Get the name for a category.
Definition vlc_config_cat.h:233
static enum vlc_config_cat vlc_config_cat_FromSubcat(enum vlc_config_subcat subcat)
Get the parent category for the given subcategory.
Definition vlc_config_cat.h:251
size_t vlc_config_subcat_Count(void)
Definition cat.c:134
static const char * vlc_config_subcat_GetName(enum vlc_config_subcat subcat)
Get the name for a subcategory.
Definition vlc_config_cat.h:213
const struct config_category_t * vlc_config_cat_Find(enum vlc_config_cat cat)
Fetch category information from VLC.
Definition cat.c:92
const struct config_category_t * vlc_config_cat_GetAt(size_t index)
Definition cat.c:103
const struct config_subcategory_t * vlc_config_subcat_GetAt(size_t index)
Definition cat.c:121
static const char * vlc_config_cat_GetHelp(enum vlc_config_cat cat)
Get the help text for a category.
Definition vlc_config_cat.h:241
static enum vlc_config_subcat vlc_config_cat_GetGeneralSubcat(enum vlc_config_cat cat)
Get the "general" subcategory for a given category.
Definition vlc_config_cat.h:203
static const char * vlc_config_subcat_GetHelp(enum vlc_config_subcat subcat)
Get the help text for a subcategory.
Definition vlc_config_cat.h:223
static bool vlc_config_subcat_IsGeneral(enum vlc_config_subcat subcat)
Check if the given subcategory is a "general" one.
Definition vlc_config_cat.h:261
This file implements plugin (module) macros used to define a vlc module.
vlc_config_cat
Definition vlc_plugin.h:152
@ CAT_UNKNOWN
Definition vlc_plugin.h:158
vlc_config_subcat
Definition vlc_plugin.h:171
@ SUBCAT_UNKNOWN
Definition vlc_plugin.h:177