Mercurial > mplayer.hg
annotate input/input.h @ 16057:5324b396d7dc
Sync tag bump to 1.58
author | wight |
---|---|
date | Fri, 22 Jul 2005 20:50:10 +0000 |
parents | 8549fc0fb5b1 |
children | 60c6693b2b2b |
rev | line source |
---|---|
10867 | 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 | 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 | 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 |
13089 | 33 // #define MP_CMD_VOBSUB_LANG 31 // combined with SUB_SELECT |
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 | 36 #define MP_CMD_GET_TIME_LENGTH 34 |
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 | 48 #define MP_CMD_TV_SET_BRIGHTNESS 44 |
49 #define MP_CMD_TV_SET_CONTRAST 45 | |
50 #define MP_CMD_TV_SET_HUE 46 | |
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 |
11542 | 55 #define MP_CMD_VO_ONTOP 51 |
12841
96b807836eca
individual sub_select option not interferring with vobsub_lang
alex
parents:
11678
diff
changeset
|
56 #define MP_CMD_SUB_SELECT 52 |
13091 | 57 #define MP_CMD_VO_ROOTWIN 53 |
13228
a47aaa6b7324
slave mode command to en/disable vsync, patch by Aurelien Jacobs <aurel at gnuage.org>
faust3
parents:
13091
diff
changeset
|
58 #define MP_CMD_SWITCH_VSYNC 54 |
13339
1c787349d286
slave mode command to switch aspect ratio, patch by Aurelien Jacobs <aurel at gnuage.org>
faust3
parents:
13228
diff
changeset
|
59 #define MP_CMD_SWITCH_RATIO 55 |
13626
741649fe31cb
allow to step only one frame forward by pressing s.
reimar
parents:
13603
diff
changeset
|
60 #define MP_CMD_FRAME_STEP 56 |
13710 | 61 #define MP_CMD_SPEED_INCR 57 |
62 #define MP_CMD_SPEED_MULT 58 | |
63 #define MP_CMD_SPEED_SET 59 | |
14087 | 64 #define MP_CMD_RUN 60 |
14684 | 65 #define MP_CMD_SUB_LOG 61 |
15046
b7aa70b05d76
Added support of audio stream switching in the MPEG demuxer using the #-key
gpoirier
parents:
14684
diff
changeset
|
66 #define MP_CMD_SWITCH_AUDIO 62 |
15504 | 67 #define MP_CMD_GET_TIME_POS 63 |
15706 | 68 #define MP_CMD_SUB_LOAD 64 |
69 #define MP_CMD_SUB_REMOVE 65 | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
70 |
4858 | 71 #define MP_CMD_GUI_EVENTS 5000 |
72 #define MP_CMD_GUI_LOADFILE 5001 | |
73 #define MP_CMD_GUI_LOADSUBTITLE 5002 | |
74 #define MP_CMD_GUI_ABOUT 5003 | |
75 #define MP_CMD_GUI_PLAY 5004 | |
76 #define MP_CMD_GUI_STOP 5005 | |
77 #define MP_CMD_GUI_PLAYLIST 5006 | |
78 #define MP_CMD_GUI_PREFERENCES 5007 | |
79 #define MP_CMD_GUI_FULLSCREEN 5008 | |
80 #define MP_CMD_GUI_SKINBROWSER 5009 | |
81 | |
10568 | 82 #ifdef HAS_DVBIN_SUPPORT |
83 #define MP_CMD_DVB_SET_CHANNEL 5101 | |
84 #endif | |
85 | |
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
|
86 #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
|
87 |
5380
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
88 #define MP_CMD_DVDNAV_UP 1 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
89 #define MP_CMD_DVDNAV_DOWN 2 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
90 #define MP_CMD_DVDNAV_LEFT 3 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
91 #define MP_CMD_DVDNAV_RIGHT 4 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
92 #define MP_CMD_DVDNAV_MENU 5 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
93 #define MP_CMD_DVDNAV_SELECT 6 |
8a01cde9cf39
DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents:
5197
diff
changeset
|
94 |
10867 | 95 /// Console commands |
8196
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
96 #define MP_CMD_CHELP 7000 |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
97 #define MP_CMD_CEXIT 7001 |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
98 #define MP_CMD_CHIDE 7002 |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
99 |
10867 | 100 // The arg types |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
101 #define MP_CMD_ARG_INT 0 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
102 #define MP_CMD_ARG_FLOAT 1 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
103 #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
|
104 #define MP_CMD_ARG_VOID 3 |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
105 |
5197 | 106 #ifndef MP_CMD_MAX_ARGS |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
107 #define MP_CMD_MAX_ARGS 10 |
5197 | 108 #endif |
109 | |
110 // Error codes for the drivers | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
111 |
11678
972d1998bde9
occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents:
11542
diff
changeset
|
112 // An error occurred but we can continue |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
113 #define MP_INPUT_ERROR -1 |
11678
972d1998bde9
occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents:
11542
diff
changeset
|
114 // 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
|
115 #define MP_INPUT_DEAD -2 |
10867 | 116 // No input was available |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
117 #define MP_INPUT_NOTHING -3 |
15825 | 118 //! Input will be available if you try again |
119 #define MP_INPUT_RETRY -4 | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
120 |
10867 | 121 // For the key's drivers, if possible you can send key up and key down |
13634
9a270ee1682e
Comment clarified, patch by Sylvain Colinet <scolinet at gmail dot com>.
diego
parents:
13626
diff
changeset
|
122 // events. Key up is the default, to send a key down you must use the |
9a270ee1682e
Comment clarified, patch by Sylvain Colinet <scolinet at gmail dot com>.
diego
parents:
13626
diff
changeset
|
123 // 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
|
124 #define MP_KEY_DOWN (1<<29) |
5197 | 125 // 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
|
126 #define MP_NO_REPEAT_KEY (1<<28) |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
127 |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
128 #ifndef MP_MAX_KEY_DOWN |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
129 #define MP_MAX_KEY_DOWN 32 |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
130 #endif |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
131 |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
132 typedef union mp_cmd_arg_value { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
133 int i; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
134 float f; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
135 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
|
136 void* v; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
137 } mp_cmd_arg_value_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
138 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
139 typedef struct mp_cmd_arg { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
140 int type; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
141 mp_cmd_arg_value_t v; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
142 } mp_cmd_arg_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
143 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
144 typedef struct mp_cmd { |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
145 int id; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
146 char* name; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
147 int nargs; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
148 mp_cmd_arg_t args[MP_CMD_MAX_ARGS]; |
13991 | 149 int pausing; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
150 } mp_cmd_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
151 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
152 |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
153 typedef struct mp_cmd_bind { |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
154 int input[MP_MAX_KEY_DOWN+1]; |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
155 char* cmd; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
156 } mp_cmd_bind_t; |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
157 |
4589
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
158 typedef struct mp_key_name { |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
159 int key; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
160 char* name; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
161 } mp_key_name_t; |
4ce20c55a18a
Added support for key combination and mouse buttons key code
albeu
parents:
4431
diff
changeset
|
162 |
10867 | 163 // These typedefs are for the drivers. They are the functions used to retrieve |
5197 | 164 // the next key code or command. |
165 | |
10867 | 166 // 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
|
167 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
|
168 // 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
|
169 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size); |
5197 | 170 // These are used to close the driver |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
171 typedef void (*mp_close_func_t)(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
172 |
10867 | 173 // 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
|
174 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
|
175 // 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
|
176 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
|
177 |
10867 | 178 // This function adds a new key driver. |
5197 | 179 // The first arg is a file descriptor (use a negative value if you don't use any fd) |
10867 | 180 // The second arg tells if we use select on the fd to know if something is available. |
181 // The third arg is optional. If null a default function wich reads an int from the | |
5197 | 182 // fd will be used. |
183 // The last arg can be NULL if nothing is needed to close the driver. The close | |
184 // function can be used | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
185 int |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
186 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
|
187 |
10867 | 188 // 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
|
189 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
190 mp_input_rm_cmd_fd(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
191 |
10867 | 192 // The args are the same as for the key's drivers. If you don't use any valid fd you MUST |
5197 | 193 // give a read_func. |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
194 int |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
195 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
|
196 |
10867 | 197 // 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
|
198 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
199 mp_input_rm_key_fd(int fd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
200 |
10867 | 201 // This function can be used to put a command in the system again. It's used by libmpdemux |
202 // when it performs a blocking operation to resend the command it received to the main | |
5197 | 203 // loop. |
4821 | 204 int |
205 mp_input_queue_cmd(mp_cmd_t* cmd); | |
206 | |
10867 | 207 // This function retrieves the next available command waiting no more than time msec. |
5197 | 208 // 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
|
209 mp_cmd_t* |
13603 | 210 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
|
211 |
8196
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
212 mp_cmd_t* |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
213 mp_input_parse_cmd(char* str); |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
214 |
10867 | 215 /// These filters allow you to process the command before MPlayer. |
216 /// 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
|
217 void |
419bdbfdb660
Add the possibilty to grab the keys and to filter the commands
albeu
parents:
7912
diff
changeset
|
218 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
|
219 |
5197 | 220 // After getting a command from mp_input_get_cmd you need to free it using this |
221 // function | |
4418
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
222 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
223 mp_cmd_free(mp_cmd_t* cmd); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
224 |
10867 | 225 // 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
|
226 mp_cmd_t* |
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
227 mp_cmd_clone(mp_cmd_t* cmd); |
610a11e4db36
Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents:
4589
diff
changeset
|
228 |
10867 | 229 // 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
|
230 void |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
231 mp_input_init(void); |
8141d2c399e4
A new configurable input system and joystick support for this system
albeu
parents:
diff
changeset
|
232 |
4431 | 233 void |
234 mp_input_uninit(void); | |
7862
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
235 |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
236 // Interruptible usleep: (used by libmpdemux) |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
237 int |
013c255225d8
mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents:
7779
diff
changeset
|
238 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
|
239 |