Mercurial > mplayer.hg
annotate input/input.h @ 32282:606e4157cd4c
Split alloc and init of context so that parameters can be set in the context
instead of requireing being passed through function parameters. This also
makes sws work with AVOptions.
author | michael |
---|---|
date | Sun, 26 Sep 2010 19:33:57 +0000 |
parents | a6c25d94e60e |
children | 7fd2de8d6f32 |
rev | line source |
---|---|
28112 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
26029 | 19 #ifndef MPLAYER_INPUT_H |
20 #define MPLAYER_INPUT_H | |
25553
6ac1ece1f9fe
Add multiple inclusion guards to all header files that lack them.
diego
parents:
25502
diff
changeset
|
21 |
30530
c5d1693acb35
Declare mp_input_register_options() in input/input.h.
diego
parents:
29263
diff
changeset
|
22 #include "m_config.h" |
c5d1693acb35
Declare mp_input_register_options() in input/input.h.
diego
parents:
29263
diff
changeset
|
23 |
10867 | 24 // All command IDs |
27066 | 25 typedef enum { |
26 MP_CMD_SEEK, | |
27 MP_CMD_AUDIO_DELAY, | |
28 MP_CMD_QUIT, | |
29 MP_CMD_PAUSE, | |
30 MP_CMD_GRAB_FRAMES, // deprecated: was a no-op command for years | |
31 MP_CMD_PLAY_TREE_STEP, | |
32 MP_CMD_PLAY_TREE_UP_STEP, | |
33 MP_CMD_PLAY_ALT_SRC_STEP, | |
34 MP_CMD_SUB_DELAY, | |
35 MP_CMD_OSD, | |
36 MP_CMD_VOLUME, | |
37 MP_CMD_MIXER_USEMASTER, | |
38 MP_CMD_CONTRAST, | |
39 MP_CMD_BRIGHTNESS, | |
40 MP_CMD_HUE, | |
41 MP_CMD_SATURATION, | |
42 MP_CMD_FRAMEDROPPING, | |
43 MP_CMD_TV_STEP_CHANNEL, | |
44 MP_CMD_TV_STEP_NORM, | |
45 MP_CMD_TV_STEP_CHANNEL_LIST, | |
46 MP_CMD_VO_FULLSCREEN, | |
47 MP_CMD_SUB_POS, | |
48 MP_CMD_DVDNAV, | |
49 MP_CMD_SCREENSHOT, | |
50 MP_CMD_PANSCAN, | |
51 MP_CMD_MUTE, | |
52 MP_CMD_LOADFILE, | |
53 MP_CMD_LOADLIST, | |
54 MP_CMD_VF_CHANGE_RECTANGLE, | |
55 MP_CMD_GAMMA, | |
56 MP_CMD_SUB_VISIBILITY, | |
57 MP_CMD_VOBSUB_LANG, // deprecated: combined with SUB_SELECT | |
58 MP_CMD_MENU, | |
59 MP_CMD_SET_MENU, | |
60 MP_CMD_GET_TIME_LENGTH, | |
61 MP_CMD_GET_PERCENT_POS, | |
62 MP_CMD_SUB_STEP, | |
63 MP_CMD_TV_SET_CHANNEL, | |
31956
a6c25d94e60e
Add new slave mode command for loading EDL file on demand.
reynaldo
parents:
31319
diff
changeset
|
64 MP_CMD_EDL_LOADFILE, |
27066 | 65 MP_CMD_EDL_MARK, |
66 MP_CMD_SUB_ALIGNMENT, | |
67 MP_CMD_TV_LAST_CHANNEL, | |
68 MP_CMD_OSD_SHOW_TEXT, | |
69 MP_CMD_TV_SET_FREQ, | |
70 MP_CMD_TV_SET_NORM, | |
71 MP_CMD_TV_SET_BRIGHTNESS, | |
72 MP_CMD_TV_SET_CONTRAST, | |
73 MP_CMD_TV_SET_HUE, | |
74 MP_CMD_TV_SET_SATURATION, | |
75 MP_CMD_GET_VO_FULLSCREEN, | |
76 MP_CMD_GET_SUB_VISIBILITY, | |
77 MP_CMD_SUB_FORCED_ONLY, | |
78 MP_CMD_VO_ONTOP, | |
79 MP_CMD_SUB_SELECT, | |
80 MP_CMD_VO_ROOTWIN, | |
81 MP_CMD_SWITCH_VSYNC, | |
82 MP_CMD_SWITCH_RATIO, | |
83 MP_CMD_FRAME_STEP, | |
84 MP_CMD_SPEED_INCR, | |
85 MP_CMD_SPEED_MULT, | |
86 MP_CMD_SPEED_SET, | |
87 MP_CMD_RUN, | |
88 MP_CMD_SUB_LOG, | |
89 MP_CMD_SWITCH_AUDIO, | |
90 MP_CMD_GET_TIME_POS, | |
91 MP_CMD_SUB_LOAD, | |
92 MP_CMD_SUB_REMOVE, | |
93 MP_CMD_KEYDOWN_EVENTS, | |
94 MP_CMD_VO_BORDER, | |
95 MP_CMD_SET_PROPERTY, | |
96 MP_CMD_GET_PROPERTY, | |
97 MP_CMD_OSD_SHOW_PROPERTY_TEXT, | |
30986
2186c040f9e0
Add osd_show_progression: Show progress bar and elapsed/total time.
cehoyos
parents:
30530
diff
changeset
|
98 MP_CMD_OSD_SHOW_PROGRESSION, |
27066 | 99 MP_CMD_SEEK_CHAPTER, |
100 MP_CMD_FILE_FILTER, | |
101 MP_CMD_GET_FILENAME, | |
102 MP_CMD_GET_VIDEO_CODEC, | |
103 MP_CMD_GET_VIDEO_BITRATE, | |
104 MP_CMD_GET_VIDEO_RESOLUTION, | |
105 MP_CMD_GET_AUDIO_CODEC, | |
106 MP_CMD_GET_AUDIO_BITRATE, | |
107 MP_CMD_GET_AUDIO_SAMPLES, | |
108 MP_CMD_GET_META_TITLE, | |
109 MP_CMD_GET_META_ARTIST, | |
110 MP_CMD_GET_META_ALBUM, | |
111 MP_CMD_GET_META_YEAR, | |
112 MP_CMD_GET_META_COMMENT, | |
113 MP_CMD_GET_META_TRACK, | |
114 MP_CMD_GET_META_GENRE, | |
115 MP_CMD_RADIO_STEP_CHANNEL, | |
116 MP_CMD_RADIO_SET_CHANNEL, | |
117 MP_CMD_RADIO_SET_FREQ, | |
118 MP_CMD_SET_MOUSE_POS, | |
119 MP_CMD_STEP_PROPERTY, | |
120 MP_CMD_RADIO_STEP_FREQ, | |
121 MP_CMD_TV_STEP_FREQ, | |
122 MP_CMD_LOOP, | |
123 MP_CMD_BALANCE, | |
124 MP_CMD_SUB_SCALE, | |
125 MP_CMD_TV_TELETEXT_ADD_DEC, | |
126 MP_CMD_TV_TELETEXT_GO_LINK, | |
127 MP_CMD_TV_START_SCAN, | |
128 MP_CMD_SUB_SOURCE, | |
129 MP_CMD_SUB_FILE, | |
130 MP_CMD_SUB_VOB, | |
131 MP_CMD_SUB_DEMUX, | |
132 MP_CMD_SWITCH_ANGLE, | |
133 MP_CMD_ASS_USE_MARGINS, | |
134 MP_CMD_SWITCH_TITLE, | |
135 MP_CMD_STOP, | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
136 |
27068 | 137 /// DVDNAV commands |
138 MP_CMD_DVDNAV_UP = 1000, | |
139 MP_CMD_DVDNAV_DOWN, | |
140 MP_CMD_DVDNAV_LEFT, | |
141 MP_CMD_DVDNAV_RIGHT, | |
142 MP_CMD_DVDNAV_MENU, | |
143 MP_CMD_DVDNAV_SELECT, | |
144 MP_CMD_DVDNAV_PREVMENU, | |
145 MP_CMD_DVDNAV_MOUSECLICK, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28112
diff
changeset
|
146 |
27066 | 147 /// DVB commands |
148 MP_CMD_DVB_SET_CHANNEL = 5101, | |
149 | |
150 /// Console commands | |
151 MP_CMD_CHELP = 7000, | |
152 MP_CMD_CEXIT, | |
153 MP_CMD_CHIDE, | |
30988
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
154 |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
155 /// Audio Filter commands |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
156 MP_CMD_AF_SWITCH, |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
157 MP_CMD_AF_ADD, |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
158 MP_CMD_AF_DEL, |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
159 MP_CMD_AF_CLR, |
8d840754a921
Add slave commands for loading and unloading audio filters at runtime.
cehoyos
parents:
30986
diff
changeset
|
160 |
27066 | 161 } mp_command_type; |
10568 | 162 |
10867 | 163 // The arg types |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
164 #define MP_CMD_ARG_INT 0 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
165 #define MP_CMD_ARG_FLOAT 1 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
166 #define MP_CMD_ARG_STRING 2 |
5473
39dae98304af
dvdnav event added, queue size 10->100, added void* event arg type - dvdnav patch by Kees Cook <mplayer@outflux.net>
arpi
parents:
5380
diff
changeset
|
167 #define MP_CMD_ARG_VOID 3 |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
168 |
5197 | 169 #ifndef MP_CMD_MAX_ARGS |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
170 #define MP_CMD_MAX_ARGS 10 |
5197 | 171 #endif |
172 | |
173 // Error codes for the drivers | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
174 |
11678
972d1998bde9
occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents:
11542
diff
changeset
|
175 // An error occurred but we can continue |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
176 #define MP_INPUT_ERROR -1 |
11678
972d1998bde9
occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents:
11542
diff
changeset
|
177 // A fatal error occurred, this driver should be removed |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
178 #define MP_INPUT_DEAD -2 |
10867 | 179 // No input was available |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
180 #define MP_INPUT_NOTHING -3 |
15825 | 181 //! Input will be available if you try again |
182 #define MP_INPUT_RETRY -4 | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
183 |
10867 | 184 // For the key's drivers, if possible you can send key up and key down |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28112
diff
changeset
|
185 // events. Key up is the default, to send a key down you must use the |
13634
9a270ee1682e
Comment clarified, patch by Sylvain Colinet <scolinet at gmail dot com>.
diego
parents:
13626
diff
changeset
|
186 // OR operator between the key code and MP_KEY_DOWN. |
4657
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
187 #define MP_KEY_DOWN (1<<29) |
5197 | 188 // Use this when the key shouldn't be auto-repeated (like mouse buttons) |
4657
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
189 #define MP_NO_REPEAT_KEY (1<<28) |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
190 |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
191 #ifndef MP_MAX_KEY_DOWN |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
192 #define MP_MAX_KEY_DOWN 32 |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
193 #endif |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
194 |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
195 typedef union mp_cmd_arg_value { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
196 int i; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
197 float f; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
198 char* s; |
5473
39dae98304af
dvdnav event added, queue size 10->100, added void* event arg type - dvdnav patch by Kees Cook <mplayer@outflux.net>
arpi
parents:
5380
diff
changeset
|
199 void* v; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
200 } mp_cmd_arg_value_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
201 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
202 typedef struct mp_cmd_arg { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
203 int type; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
204 mp_cmd_arg_value_t v; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
205 } mp_cmd_arg_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
206 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
207 typedef struct mp_cmd { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
208 int id; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
209 char* name; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
210 int nargs; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
211 mp_cmd_arg_t args[MP_CMD_MAX_ARGS]; |
13991 | 212 int pausing; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
213 } mp_cmd_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
214 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
215 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
216 typedef struct mp_cmd_bind { |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
217 int input[MP_MAX_KEY_DOWN+1]; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
218 char* cmd; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
219 } mp_cmd_bind_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
220 |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
221 typedef struct mp_key_name { |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
222 int key; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
223 char* name; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
224 } mp_key_name_t; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
225 |
10867 | 226 // These typedefs are for the drivers. They are the functions used to retrieve |
5197 | 227 // the next key code or command. |
228 | |
10867 | 229 // These functions should return the key code or one of the error codes |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
230 typedef int (*mp_key_func_t)(int fd); |
7912
e15e76559bd5
Reverse Arpi's commit and put the right fix in place.
albeu
parents:
7862
diff
changeset
|
231 // These functions should act like read but they must use our error code (if needed ;-) |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
232 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size); |
5197 | 233 // These are used to close the driver |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
234 typedef void (*mp_close_func_t)(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
235 |
10867 | 236 // Set this to grab all incoming key codes |
28054 | 237 extern int (*mp_input_key_cb)(int code); |
8196
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
238 // Should return 1 if the command was processed |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
239 typedef int (*mp_input_cmd_filter)(mp_cmd_t* cmd, int paused, void* ctx); |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
240 |
10867 | 241 // This function adds a new key driver. |
5197 | 242 // The first arg is a file descriptor (use a negative value if you don't use any fd) |
10867 | 243 // The second arg tells if we use select on the fd to know if something is available. |
244 // The third arg is optional. If null a default function wich reads an int from the | |
5197 | 245 // fd will be used. |
246 // The last arg can be NULL if nothing is needed to close the driver. The close | |
247 // function can be used | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
248 int |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
249 mp_input_add_cmd_fd(int fd, int select, mp_cmd_func_t read_func, mp_close_func_t close_func); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
250 |
10867 | 251 // This removes a cmd driver, you usually don't need to use it. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
252 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
253 mp_input_rm_cmd_fd(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
254 |
10867 | 255 // The args are the same as for the key's drivers. If you don't use any valid fd you MUST |
5197 | 256 // give a read_func. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
257 int |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
258 mp_input_add_key_fd(int fd, int select, mp_key_func_t read_func, mp_close_func_t close_func); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
259 |
10867 | 260 // As for the cmd one you usually don't need this function. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
261 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
262 mp_input_rm_key_fd(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
263 |
24132 | 264 int mp_input_add_event_fd(int fd, void (*read_func)(void)); |
265 | |
266 void mp_input_rm_event_fd(int fd); | |
267 | |
25263
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25129
diff
changeset
|
268 /// Get input key from its name. |
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25129
diff
changeset
|
269 int mp_input_get_key_from_name(const char *name); |
96d0992c7920
Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents:
25129
diff
changeset
|
270 |
10867 | 271 // This function can be used to put a command in the system again. It's used by libmpdemux |
272 // when it performs a blocking operation to resend the command it received to the main | |
5197 | 273 // loop. |
4821 | 274 int |
275 mp_input_queue_cmd(mp_cmd_t* cmd); | |
276 | |
10867 | 277 // This function retrieves the next available command waiting no more than time msec. |
5197 | 278 // If pause is true, the next input will always return a pause command. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
279 mp_cmd_t* |
13603 | 280 mp_input_get_cmd(int time, int paused, int peek_only); |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
281 |
8196
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
282 mp_cmd_t* |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
283 mp_input_parse_cmd(char* str); |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
284 |
25319
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
285 /** |
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
286 * Parse and queue commands separated by '\n'. |
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
287 * @return count of commands new queued. |
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
288 */ |
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
289 int mp_input_parse_and_queue_cmds(const char *str); |
50a30be5300c
Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents:
25263
diff
changeset
|
290 |
10867 | 291 /// These filters allow you to process the command before MPlayer. |
292 /// If a filter returns a true value mp_input_get_cmd will return NULL. | |
8196
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
293 void |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
294 mp_input_add_cmd_filter(mp_input_cmd_filter, void* ctx); |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
295 |
5197 | 296 // After getting a command from mp_input_get_cmd you need to free it using this |
297 // function | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
298 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
299 mp_cmd_free(mp_cmd_t* cmd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
300 |
10867 | 301 // This creates a copy of a command (used by the auto repeat stuff). |
4657
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
302 mp_cmd_t* |
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
303 mp_cmd_clone(mp_cmd_t* cmd); |
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
304 |
23477 | 305 // Set current input section |
306 void | |
307 mp_input_set_section(char *name); | |
308 | |
309 // Get current input section | |
310 char* | |
311 mp_input_get_section(void); | |
312 | |
10867 | 313 // When you create a new driver you should add it in these 2 functions. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
314 void |
31319 | 315 mp_input_init(void); |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
316 |
4431 | 317 void |
318 mp_input_uninit(void); | |
7862
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
319 |
30530
c5d1693acb35
Declare mp_input_register_options() in input/input.h.
diego
parents:
29263
diff
changeset
|
320 void mp_input_register_options(m_config_t* cfg); |
c5d1693acb35
Declare mp_input_register_options() in input/input.h.
diego
parents:
29263
diff
changeset
|
321 |
7862
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
322 // Interruptible usleep: (used by libmpdemux) |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
323 int |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
324 mp_input_check_interrupt(int time); |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
325 |
25623
b955a135e3a8
Do not use exit_player in the signal handler, this code just can not
reimar
parents:
25576
diff
changeset
|
326 extern int async_quit_request; |
b955a135e3a8
Do not use exit_player in the signal handler, this code just can not
reimar
parents:
25576
diff
changeset
|
327 |
26029 | 328 #endif /* MPLAYER_INPUT_H */ |