qt: playlist: use item title if available
[vlc.git] / include / vlc_actions.h
blobe8e2224c800382a0e4731c8be72f597f001c2f58
1 /*****************************************************************************
2 * vlc_actions.h: handle vlc actions
3 *****************************************************************************
4 * Copyright (C) 2003-2016 VLC authors and VideoLAN
6 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #ifndef VLC_ACTIONS_H
24 #define VLC_ACTIONS_H 1
26 # include <vlc_mouse.h>
28 /* Called from src/libvlc.c */
29 int
30 libvlc_InternalActionsInit(libvlc_int_t *p_libvlc);
32 /* Called from src/libvlc.c */
33 void
34 libvlc_InternalActionsClean(libvlc_int_t *p_libvlc);
36 /**
37 * \file
38 * This file defines keys and functions
41 #define KEY_MODIFIER 0xFF000000
42 #define KEY_MODIFIER_ALT 0x01000000
43 #define KEY_MODIFIER_SHIFT 0x02000000
44 #define KEY_MODIFIER_CTRL 0x04000000
45 #define KEY_MODIFIER_META 0x08000000
46 #define KEY_MODIFIER_COMMAND 0x10000000
48 #define KEY_UNSET 0x00000000
49 #define KEY_BACKSPACE 0x08
50 #define KEY_TAB 0x09
51 #define KEY_ENTER 0x0D
52 #define KEY_ESC 0x1B
53 /* End of Unicode range: 0x0010FFFF */
54 #define KEY_LEFT 0x00210000
55 #define KEY_RIGHT 0x00220000
56 #define KEY_UP 0x00230000
57 #define KEY_DOWN 0x00240000
58 #define KEY_F1 0x00270000
59 #define KEY_F2 0x00280000
60 #define KEY_F3 0x00290000
61 #define KEY_F4 0x002A0000
62 #define KEY_F5 0x002B0000
63 #define KEY_F6 0x002C0000
64 #define KEY_F7 0x002D0000
65 #define KEY_F8 0x002E0000
66 #define KEY_F9 0x002F0000
67 #define KEY_F10 0x00300000
68 #define KEY_F11 0x00310000
69 #define KEY_F12 0x00320000
70 #define KEY_HOME 0x00330000
71 #define KEY_END 0x00340000
72 #define KEY_INSERT 0x00350000
73 #define KEY_DELETE 0x00360000
74 #define KEY_MENU 0x00370000
75 #define KEY_PAGEUP 0x00390000
76 #define KEY_PAGEDOWN 0x003A0000
77 #define KEY_PRINT 0x003B0000
78 #define KEY_PAUSE 0x003D0000
80 #define KEY_BROWSER_BACK 0x003F0000
81 #define KEY_BROWSER_FORWARD 0x00400000
82 #define KEY_BROWSER_REFRESH 0x00410000
83 #define KEY_BROWSER_STOP 0x00420000
84 #define KEY_BROWSER_SEARCH 0x00430000
85 #define KEY_BROWSER_FAVORITES 0x00440000
86 #define KEY_BROWSER_HOME 0x00450000
87 #define KEY_VOLUME_MUTE 0x00460000
88 #define KEY_VOLUME_DOWN 0x00470000
89 #define KEY_VOLUME_UP 0x00480000
90 #define KEY_MEDIA_NEXT_TRACK 0x00490000
91 #define KEY_MEDIA_PREV_TRACK 0x004A0000
92 #define KEY_MEDIA_STOP 0x004B0000
93 #define KEY_MEDIA_PLAY_PAUSE 0x004C0000
94 #define KEY_MEDIA_RECORD 0x004D0000
95 #define KEY_MEDIA_REWIND 0x004E0000
96 #define KEY_MEDIA_FORWARD 0x004F0000
97 #define KEY_MEDIA_REPEAT 0x00500000
98 #define KEY_MEDIA_SHUFFLE 0x00510000
99 #define KEY_MEDIA_SUBTITLE 0x00520000
100 #define KEY_MEDIA_AUDIO 0x00530000
101 #define KEY_MEDIA_ANGLE 0x00540000
102 #define KEY_MEDIA_TIME 0x00550000
103 #define KEY_MEDIA_FRAME_PREV 0x00560000
104 #define KEY_MEDIA_FRAME_NEXT 0x00570000
105 #define KEY_MEDIA_SELECT 0x00580000
106 #define KEY_MEDIA_VIEW 0x00590000
107 #define KEY_MEDIA_MENU 0x005A0000
108 #define KEY_ZOOM_IN 0x00600000
109 #define KEY_ZOOM_OUT 0x00610000
110 #define KEY_BRIGHTNESS_UP 0x00620000
111 #define KEY_BRIGHTNESS_DOWN 0x00630000
113 #define KEY_MOUSEWHEELUP 0x00F00000
114 #define KEY_MOUSEWHEELDOWN 0x00F10000
115 #define KEY_MOUSEWHEELLEFT 0x00F20000
116 #define KEY_MOUSEWHEELRIGHT 0x00F30000
117 #define KEY_MOUSEWHEEL_FROM_BUTTON(button) \
118 (KEY_MOUSEWHEELUP | ((button - MOUSE_BUTTON_WHEEL_UP) << 16))
120 VLC_API char *vlc_keycode2str(uint_fast32_t i_key, bool locale) VLC_USED;
121 VLC_API uint_fast32_t vlc_str2keycode(const char *str) VLC_USED;
123 typedef enum vlc_action_id {
124 ACTIONID_NONE = 0,
125 ACTIONID_QUIT,
126 /* intf actions */
127 ACTIONID_INTF_TOGGLE_FSC,
128 ACTIONID_INTF_HIDE,
129 ACTIONID_INTF_BOSS,
130 ACTIONID_INTF_POPUP_MENU,
131 /* playlist interaction */
132 ACTIONID_PLAY_CLEAR,
133 ACTIONID_PREV,
134 ACTIONID_NEXT,
135 /* playback */
136 ACTIONID_LOOP,
137 ACTIONID_RANDOM,
138 /* playlist bookmarks */
139 ACTIONID_SET_BOOKMARK1,
140 ACTIONID_SET_BOOKMARK2,
141 ACTIONID_SET_BOOKMARK3,
142 ACTIONID_SET_BOOKMARK4,
143 ACTIONID_SET_BOOKMARK5,
144 ACTIONID_SET_BOOKMARK6,
145 ACTIONID_SET_BOOKMARK7,
146 ACTIONID_SET_BOOKMARK8,
147 ACTIONID_SET_BOOKMARK9,
148 ACTIONID_SET_BOOKMARK10,
149 ACTIONID_PLAY_BOOKMARK1,
150 ACTIONID_PLAY_BOOKMARK2,
151 ACTIONID_PLAY_BOOKMARK3,
152 ACTIONID_PLAY_BOOKMARK4,
153 ACTIONID_PLAY_BOOKMARK5,
154 ACTIONID_PLAY_BOOKMARK6,
155 ACTIONID_PLAY_BOOKMARK7,
156 ACTIONID_PLAY_BOOKMARK8,
157 ACTIONID_PLAY_BOOKMARK9,
158 ACTIONID_PLAY_BOOKMARK10,
159 /* player state */
160 ACTIONID_PLAY_PAUSE,
161 ACTIONID_PLAY,
162 ACTIONID_PAUSE,
163 ACTIONID_STOP,
164 ACTIONID_FRAME_NEXT,
165 /* input seeking */
166 ACTIONID_JUMP_BACKWARD_EXTRASHORT,
167 ACTIONID_JUMP_FORWARD_EXTRASHORT,
168 ACTIONID_JUMP_BACKWARD_SHORT,
169 ACTIONID_JUMP_FORWARD_SHORT,
170 ACTIONID_JUMP_BACKWARD_MEDIUM,
171 ACTIONID_JUMP_FORWARD_MEDIUM,
172 ACTIONID_JUMP_BACKWARD_LONG,
173 ACTIONID_JUMP_FORWARD_LONG,
174 ACTIONID_POSITION,
175 /* program SID, chapter and title navigation */
176 ACTIONID_PROGRAM_SID_PREV,
177 ACTIONID_PROGRAM_SID_NEXT,
178 ACTIONID_TITLE_PREV,
179 ACTIONID_TITLE_NEXT,
180 ACTIONID_CHAPTER_PREV,
181 ACTIONID_CHAPTER_NEXT,
182 ACTIONID_DISC_MENU,
183 /* audio / subtitle track */
184 ACTIONID_AUDIO_TRACK,
185 ACTIONID_SUBTITLE_REVERSE_TRACK,
186 ACTIONID_SUBTITLE_TRACK,
187 /* audio / subtitle delay */
188 ACTIONID_AUDIODELAY_DOWN,
189 ACTIONID_AUDIODELAY_UP,
190 ACTIONID_SUBDELAY_DOWN,
191 ACTIONID_SUBDELAY_UP,
192 /* subtitle toggle */
193 ACTIONID_SUBTITLE_TOGGLE,
194 /* dual subtitle control */
195 ACTIONID_SUBTITLE_CONTROL_SECONDARY,
196 /* subtitle sync */
197 ACTIONID_SUBSYNC_MARKAUDIO,
198 ACTIONID_SUBSYNC_MARKSUB,
199 ACTIONID_SUBSYNC_APPLY,
200 ACTIONID_SUBSYNC_RESET,
201 /* subtitle display */
202 ACTIONID_SUBPOS_DOWN,
203 ACTIONID_SUBPOS_UP,
204 ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL,
205 ACTIONID_SUBTITLE_TEXT_SCALE_DOWN,
206 ACTIONID_SUBTITLE_TEXT_SCALE_UP,
207 /* input rate */
208 ACTIONID_RATE_NORMAL,
209 ACTIONID_RATE_SLOWER,
210 ACTIONID_RATE_FASTER,
211 ACTIONID_RATE_SLOWER_FINE,
212 ACTIONID_RATE_FASTER_FINE,
213 /* input navigation */
214 ACTIONID_NAV_ACTIVATE,
215 ACTIONID_NAV_UP,
216 ACTIONID_NAV_DOWN,
217 ACTIONID_NAV_LEFT,
218 ACTIONID_NAV_RIGHT,
219 /* input recording */
220 ACTIONID_RECORD,
221 /* viewpoint */
222 ACTIONID_VIEWPOINT_FOV_IN,
223 ACTIONID_VIEWPOINT_FOV_OUT,
224 ACTIONID_VIEWPOINT_ROLL_CLOCK,
225 ACTIONID_VIEWPOINT_ROLL_ANTICLOCK,
226 /* aout actions */
227 ACTIONID_VOL_DOWN,
228 ACTIONID_VOL_UP,
229 ACTIONID_VOL_MUTE,
230 ACTIONID_AUDIODEVICE_CYCLE,
231 /* all vouts actions */
232 ACTIONID_TOGGLE_FULLSCREEN,
233 ACTIONID_LEAVE_FULLSCREEN,
234 ACTIONID_SNAPSHOT,
235 ACTIONID_WALLPAPER,
236 /* vout aspect ratio */
237 ACTIONID_ASPECT_RATIO,
238 /* vout cropping */
239 ACTIONID_CROP,
240 ACTIONID_CROP_TOP,
241 ACTIONID_UNCROP_TOP,
242 ACTIONID_CROP_LEFT,
243 ACTIONID_UNCROP_LEFT,
244 ACTIONID_CROP_BOTTOM,
245 ACTIONID_UNCROP_BOTTOM,
246 ACTIONID_CROP_RIGHT,
247 ACTIONID_UNCROP_RIGHT,
248 /* vout deinterlacing */
249 ACTIONID_DEINTERLACE,
250 ACTIONID_DEINTERLACE_MODE,
251 /* vout scaling / zooming */
252 ACTIONID_TOGGLE_AUTOSCALE,
253 ACTIONID_SCALE_UP,
254 ACTIONID_SCALE_DOWN,
255 ACTIONID_ZOOM,
256 ACTIONID_UNZOOM,
257 ACTIONID_ZOOM_QUARTER,
258 ACTIONID_ZOOM_HALF,
259 ACTIONID_ZOOM_ORIGINAL,
260 ACTIONID_ZOOM_DOUBLE,
261 /* Combo Actions */
262 ACTIONID_COMBO_VOL_FOV_DOWN,
263 ACTIONID_COMBO_VOL_FOV_UP,
264 } vlc_action_id_t;
267 * Get the action ID from an action key name
268 * \return the action ID or ACTIONID_NONE on error.
270 VLC_API vlc_action_id_t
271 vlc_actions_get_id(const char *psz_key_name);
274 * Get keycodes from a action key name and vlc configuration
275 * \return The number of keycodes for this action, or 0 in case of an error.
276 * The list needs to be released with free()
278 VLC_API size_t
279 vlc_actions_get_keycodes(vlc_object_t *p_obj, const char *psz_key_name,
280 bool b_global, uint_fast32_t **pp_keycodes );
281 #define vlc_actions_get_keycodes(a, b, c, d) vlc_actions_get_keycodes(VLC_OBJECT(a), b, c, d)
284 * Get a list a key names
285 * \return A NULL terminated list of const char *
287 VLC_API const char* const*
288 vlc_actions_get_key_names(vlc_object_t *p_obj);
289 #define vlc_actions_get_key_names(x) vlc_actions_get_key_names(VLC_OBJECT(x))
291 #endif