annotate input/input.h @ 11156:0706b9c769d6

more files by Torinthiel <torinthiel@wp.pl> and crew
author diego
date Fri, 17 Oct 2003 08:23:12 +0000
parents d45870f67728
children 85e503ddf65f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
1 // All command IDs
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
2 #define MP_CMD_SEEK 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
3 #define MP_CMD_AUDIO_DELAY 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
4 #define MP_CMD_QUIT 2
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
5 #define MP_CMD_PAUSE 3
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
6 #define MP_CMD_GRAB_FRAMES 4
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
7 #define MP_CMD_PLAY_TREE_STEP 5
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
8 #define MP_CMD_PLAY_TREE_UP_STEP 6
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
9 #define MP_CMD_PLAY_ALT_SRC_STEP 7
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
10 #define MP_CMD_SUB_DELAY 8
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
11 #define MP_CMD_OSD 9
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
12 #define MP_CMD_VOLUME 10
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
13 #define MP_CMD_MIXER_USEMASTER 11
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
14 #define MP_CMD_CONTRAST 12
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
15 #define MP_CMD_BRIGHTNESS 13
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
16 #define MP_CMD_HUE 14
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
17 #define MP_CMD_SATURATION 15
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
18 #define MP_CMD_FRAMEDROPPING 16
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
19 #define MP_CMD_TV_STEP_CHANNEL 17
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
20 #define MP_CMD_TV_STEP_NORM 18
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
21 #define MP_CMD_TV_STEP_CHANNEL_LIST 19
4732
876f0ea71526 vo_fullscreen added
alex
parents: 4657
diff changeset
22 #define MP_CMD_VO_FULLSCREEN 20
5015
9842148f6053 -subpos key bindings with new input layer - patch by Tomas Konir <moje@molly.vabo.cz>
arpi
parents: 4858
diff changeset
23 #define MP_CMD_SUB_POS 21
5380
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
24 #define MP_CMD_DVDNAV 22
6112
69b3c25728fb Add the forgoten scrennshot command
albeu
parents: 5473
diff changeset
25 #define MP_CMD_SCREENSHOT 23
6304
ee65527096c2 pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents: 6112
diff changeset
26 #define MP_CMD_PANSCAN 24
6311
da2dda48b7ec add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
pontscho
parents: 6304
diff changeset
27 #define MP_CMD_MUTE 25
6818
b9a6817d9ff3 Add loadfile and loadlist commands. May be buggy if the filename contain some
albeu
parents: 6311
diff changeset
28 #define MP_CMD_LOADFILE 26
b9a6817d9ff3 Add loadfile and loadlist commands. May be buggy if the filename contain some
albeu
parents: 6311
diff changeset
29 #define MP_CMD_LOADLIST 27
6888
2dde1a1bc03a Add the input command "change_rectangle" to control the rectangle
kmkaplan
parents: 6818
diff changeset
30 #define MP_CMD_VF_CHANGE_RECTANGLE 28
7517
9d433771b6d0 -vf eq2, LUT-based brightness/contrast/gamma correction (Y-only)
arpi
parents: 7111
diff changeset
31 #define MP_CMD_GAMMA 29
7628
d6608342591d This patch adds the functionality to disable/enable subtitles while playing
arpi
parents: 7517
diff changeset
32 #define MP_CMD_SUB_VISIBILITY 30
7779
f3166c864e9e Mplayer can switch between subtitles of different languages during
kmkaplan
parents: 7628
diff changeset
33 #define MP_CMD_VOBSUB_LANG 31
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
34 #define MP_CMD_MENU 32
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
35 #define MP_CMD_SET_MENU 33
8364
137b7574c85f slave-mode commands to get movie length & pos
arpi
parents: 8225
diff changeset
36 #define MP_CMD_GET_TIME_LENGTH 34
137b7574c85f slave-mode commands to get movie length & pos
arpi
parents: 8225
diff changeset
37 #define MP_CMD_GET_PERCENT_POS 35
8365
423a19edc0a4 This patch makes it possible to navigate among the subtitles while
arpi
parents: 8364
diff changeset
38 #define MP_CMD_SUB_STEP 36
8627
14ab71b47a58 user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents: 8534
diff changeset
39 #define MP_CMD_TV_SET_CHANNEL 37
8531
1aa2c9b460af Merged EDL 0.5 patch - it's something like Quicktime's edit lists.
arpi
parents: 8494
diff changeset
40 #ifdef USE_EDL
1aa2c9b460af Merged EDL 0.5 patch - it's something like Quicktime's edit lists.
arpi
parents: 8494
diff changeset
41 #define MP_CMD_EDL_MARK 38
1aa2c9b460af Merged EDL 0.5 patch - it's something like Quicktime's edit lists.
arpi
parents: 8494
diff changeset
42 #endif
8534
922ce27eb683 This patch adds support for vertical subtitle alignment
arpi
parents: 8531
diff changeset
43 #define MP_CMD_SUB_ALIGNMENT 39
8627
14ab71b47a58 user friendly channel tuning + 10L fix in tvi_v4l (by Stephane Jourdois)
henry
parents: 8534
diff changeset
44 #define MP_CMD_TV_LAST_CHANNEL 40
10116
add63fea61ac new slave mode command to show text via osd, patch by Lars Gemeinhardt <lars.gemeinhardt at searchbroker.de> (reviewed by albeu)
faust3
parents: 8627
diff changeset
45 #define MP_CMD_OSD_SHOW_TEXT 41
10521
141141fdd250 I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents: 10116
diff changeset
46 #define MP_CMD_TV_SET_FREQ 42
141141fdd250 I'd like to change tv tuner frequency in the slave mode. So this patch
gabucino
parents: 10116
diff changeset
47 #define MP_CMD_TV_SET_NORM 43
10577
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
48 #define MP_CMD_TV_SET_BRIGHTNESS 44
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
49 #define MP_CMD_TV_SET_CONTRAST 45
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
50 #define MP_CMD_TV_SET_HUE 46
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
51 #define MP_CMD_TV_SET_SATURATION 47
10884
bbdaa93c469e slave mode commands to print out vo_fs and sub_visibility globals, patch by Mike Swieton <swietonm at student.gvsu.edu>
faust3
parents: 10867
diff changeset
52 #define MP_CMD_GET_VO_FULLSCREEN 48
bbdaa93c469e slave mode commands to print out vo_fs and sub_visibility globals, patch by Mike Swieton <swietonm at student.gvsu.edu>
faust3
parents: 10867
diff changeset
53 #define MP_CMD_GET_SUB_VISIBILITY 49
10917
d45870f67728 Forced subtitles patch by Arne Driescher <driescher@mpi-magdeburg.mpg.de>
attila
parents: 10884
diff changeset
54 #define MP_CMD_SUB_FORCED_ONLY 50
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
55
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
56 #define MP_CMD_GUI_EVENTS 5000
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
57 #define MP_CMD_GUI_LOADFILE 5001
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
58 #define MP_CMD_GUI_LOADSUBTITLE 5002
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
59 #define MP_CMD_GUI_ABOUT 5003
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
60 #define MP_CMD_GUI_PLAY 5004
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
61 #define MP_CMD_GUI_STOP 5005
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
62 #define MP_CMD_GUI_PLAYLIST 5006
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
63 #define MP_CMD_GUI_PREFERENCES 5007
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
64 #define MP_CMD_GUI_FULLSCREEN 5008
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
65 #define MP_CMD_GUI_SKINBROWSER 5009
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
66
10568
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
67 #ifdef HAS_DVBIN_SUPPORT
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
68 #define MP_CMD_DVB_SET_CHANNEL 5101
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
69 #endif
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
70
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
71 #define MP_CMD_DVDNAV_EVENT 6000
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
72
5380
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
73 #define MP_CMD_DVDNAV_UP 1
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
74 #define MP_CMD_DVDNAV_DOWN 2
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
75 #define MP_CMD_DVDNAV_LEFT 3
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
76 #define MP_CMD_DVDNAV_RIGHT 4
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
77 #define MP_CMD_DVDNAV_MENU 5
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
78 #define MP_CMD_DVDNAV_SELECT 6
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
79
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
80 /// Console commands
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
81 #define MP_CMD_CHELP 7000
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
82 #define MP_CMD_CEXIT 7001
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
83 #define MP_CMD_CHIDE 7002
8225
c032962b51a1 Add quoting support for string arguments (fix loading of file with space in
albeu
parents: 8196
diff changeset
84 #define MP_CMD_CRUN 7003
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
85
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
86 // The arg types
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
87 #define MP_CMD_ARG_INT 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
88 #define MP_CMD_ARG_FLOAT 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
89 #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
90 #define MP_CMD_ARG_VOID 3
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
91
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
92 #ifndef MP_CMD_MAX_ARGS
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
93 #define MP_CMD_MAX_ARGS 10
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
94 #endif
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
95
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
96 // Error codes for the drivers
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
97
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
98 // An error occured but we can continue
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
99 #define MP_INPUT_ERROR -1
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
100 // A fatal error occured, this driver should be removed
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
101 #define MP_INPUT_DEAD -2
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
102 // No input was available
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
103 #define MP_INPUT_NOTHING -3
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
104
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
105 // For the key's drivers, if possible you can send key up and key down
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
106 // events. Key up is the default, to send a key down you must or the key
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
107 // code with MP_KEY_DOWN.
4657
610a11e4db36 Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents: 4589
diff changeset
108 #define MP_KEY_DOWN (1<<29)
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
109 // 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
110 #define MP_NO_REPEAT_KEY (1<<28)
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
111
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
112 #ifndef MP_MAX_KEY_DOWN
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
113 #define MP_MAX_KEY_DOWN 32
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
114 #endif
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
115
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
116 typedef union mp_cmd_arg_value {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
117 int i;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
118 float f;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
119 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
120 void* v;
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
121 } mp_cmd_arg_value_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
122
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
123 typedef struct mp_cmd_arg {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
124 int type;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
125 mp_cmd_arg_value_t v;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
126 } mp_cmd_arg_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
127
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
128 typedef struct mp_cmd {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
129 int id;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
130 char* name;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
131 int nargs;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
132 mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
133 } mp_cmd_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
134
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
135
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
136 typedef struct mp_cmd_bind {
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
137 int input[MP_MAX_KEY_DOWN+1];
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
138 char* cmd;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
139 } mp_cmd_bind_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
140
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
141 typedef struct mp_key_name {
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
142 int key;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
143 char* name;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
144 } mp_key_name_t;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
145
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
146 // These typedefs are for the drivers. They are the functions used to retrieve
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
147 // the next key code or command.
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
148
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
149 // 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
150 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
151 // 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
152 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
153 // These are used to close the driver
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
154 typedef void (*mp_close_func_t)(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
155
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
156 // Set this to grab all incoming key codes
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
157 extern void (*mp_input_key_cb)(int code);
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
158 // 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
159 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
160
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
161 // This function adds a new key driver.
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
162 // The first arg is a file descriptor (use a negative value if you don't use any fd)
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
163 // The second arg tells if we use select on the fd to know if something is available.
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
164 // The third arg is optional. If null a default function wich reads an int from the
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
165 // fd will be used.
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
166 // The last arg can be NULL if nothing is needed to close the driver. The close
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
167 // function can be used
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
168 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
169 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
170
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
171 // 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
172 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
173 mp_input_rm_cmd_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
174
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
175 // The args are the same as for the key's drivers. If you don't use any valid fd you MUST
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
176 // give a read_func.
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
177 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
178 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
179
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
180 // 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
181 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
182 mp_input_rm_key_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
183
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
184 // This function can be used to put a command in the system again. It's used by libmpdemux
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
185 // when it performs a blocking operation to resend the command it received to the main
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
186 // loop.
4821
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
187 int
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
188 mp_input_queue_cmd(mp_cmd_t* cmd);
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
189
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
190 // This function retrieves the next available command waiting no more than time msec.
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
191 // 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
192 mp_cmd_t*
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
193 mp_input_get_cmd(int time, int paused);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
194
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
195 mp_cmd_t*
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
196 mp_input_parse_cmd(char* str);
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
197
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
198 /// These filters allow you to process the command before MPlayer.
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
199 /// 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
200 void
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
201 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
202
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
203 // After getting a command from mp_input_get_cmd you need to free it using this
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
204 // function
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
205 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
206 mp_cmd_free(mp_cmd_t* cmd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
207
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
208 // 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
209 mp_cmd_t*
610a11e4db36 Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents: 4589
diff changeset
210 mp_cmd_clone(mp_cmd_t* cmd);
610a11e4db36 Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents: 4589
diff changeset
211
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
212 // 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
213 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
214 mp_input_init(void);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
215
4431
44c23fd75005 Added uninit to input
albeu
parents: 4418
diff changeset
216 void
44c23fd75005 Added uninit to input
albeu
parents: 4418
diff changeset
217 mp_input_uninit(void);
7862
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
218
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
219 // Interruptible usleep: (used by libmpdemux)
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
220 int
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
221 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
222