annotate input/input.h @ 25661:293aeec83153

Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" with an almost-trivial implementation. This allows making the builtin codec structs const, and it also makes clearer that this "selected" status is not used outside the init functions.
author reimar
date Sat, 12 Jan 2008 14:05:46 +0000
parents b955a135e3a8
children 4ba9b9bdf123
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25502
diff changeset
1 #ifndef INPUT_H
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25502
diff changeset
2 #define INPUT_H
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25502
diff changeset
3
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
4 // All command IDs
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
5 #define MP_CMD_SEEK 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
6 #define MP_CMD_AUDIO_DELAY 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
7 #define MP_CMD_QUIT 2
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
8 #define MP_CMD_PAUSE 3
22255
5f1bf0a7ed42 Remove remnants of the nonfunctional "grab_frames" command.
uau
parents: 21042
diff changeset
9 // #define MP_CMD_GRAB_FRAMES 4 // was a no-op command for years
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
10 #define MP_CMD_PLAY_TREE_STEP 5
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
11 #define MP_CMD_PLAY_TREE_UP_STEP 6
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
12 #define MP_CMD_PLAY_ALT_SRC_STEP 7
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
13 #define MP_CMD_SUB_DELAY 8
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
14 #define MP_CMD_OSD 9
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
15 #define MP_CMD_VOLUME 10
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
16 #define MP_CMD_MIXER_USEMASTER 11
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
17 #define MP_CMD_CONTRAST 12
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
18 #define MP_CMD_BRIGHTNESS 13
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
19 #define MP_CMD_HUE 14
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
20 #define MP_CMD_SATURATION 15
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
21 #define MP_CMD_FRAMEDROPPING 16
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
22 #define MP_CMD_TV_STEP_CHANNEL 17
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
23 #define MP_CMD_TV_STEP_NORM 18
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
24 #define MP_CMD_TV_STEP_CHANNEL_LIST 19
4732
876f0ea71526 vo_fullscreen added
alex
parents: 4657
diff changeset
25 #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
26 #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
27 #define MP_CMD_DVDNAV 22
6112
69b3c25728fb Add the forgoten scrennshot command
albeu
parents: 5473
diff changeset
28 #define MP_CMD_SCREENSHOT 23
6304
ee65527096c2 pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents: 6112
diff changeset
29 #define MP_CMD_PANSCAN 24
6311
da2dda48b7ec add mute support ( step 1 ) and fixed panscan bugs (1000l for me)
pontscho
parents: 6304
diff changeset
30 #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
31 #define MP_CMD_LOADFILE 26
b9a6817d9ff3 Add loadfile and loadlist commands. May be buggy if the filename contain some
albeu
parents: 6311
diff changeset
32 #define MP_CMD_LOADLIST 27
6888
2dde1a1bc03a Add the input command "change_rectangle" to control the rectangle
kmkaplan
parents: 6818
diff changeset
33 #define MP_CMD_VF_CHANGE_RECTANGLE 28
7517
9d433771b6d0 -vf eq2, LUT-based brightness/contrast/gamma correction (Y-only)
arpi
parents: 7111
diff changeset
34 #define MP_CMD_GAMMA 29
7628
d6608342591d This patch adds the functionality to disable/enable subtitles while playing
arpi
parents: 7517
diff changeset
35 #define MP_CMD_SUB_VISIBILITY 30
13089
b9171604a4ac moved combined vobsub_lang into sub_select
joey
parents: 12841
diff changeset
36 // #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
37 #define MP_CMD_MENU 32
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
38 #define MP_CMD_SET_MENU 33
8364
137b7574c85f slave-mode commands to get movie length & pos
arpi
parents: 8225
diff changeset
39 #define MP_CMD_GET_TIME_LENGTH 34
137b7574c85f slave-mode commands to get movie length & pos
arpi
parents: 8225
diff changeset
40 #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
41 #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
42 #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
43 #define MP_CMD_EDL_MARK 38
8534
922ce27eb683 This patch adds support for vertical subtitle alignment
arpi
parents: 8531
diff changeset
44 #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
45 #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
46 #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
47 #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
48 #define MP_CMD_TV_SET_NORM 43
10577
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
49 #define MP_CMD_TV_SET_BRIGHTNESS 44
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
50 #define MP_CMD_TV_SET_CONTRAST 45
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
51 #define MP_CMD_TV_SET_HUE 46
7e5733a8c33b Hi, here are slave commands:
gabucino
parents: 10568
diff changeset
52 #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
53 #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
54 #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
55 #define MP_CMD_SUB_FORCED_ONLY 50
11542
85e503ddf65f runtime 'stay-on-top' functionality
joey
parents: 10917
diff changeset
56 #define MP_CMD_VO_ONTOP 51
12841
96b807836eca individual sub_select option not interferring with vobsub_lang
alex
parents: 11678
diff changeset
57 #define MP_CMD_SUB_SELECT 52
13091
25f51c72eb06 added runtime toggle of root window playback
joey
parents: 13089
diff changeset
58 #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
59 #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
60 #define MP_CMD_SWITCH_RATIO 55
13626
741649fe31cb allow to step only one frame forward by pressing s.
reimar
parents: 13603
diff changeset
61 #define MP_CMD_FRAME_STEP 56
13710
d7af73cc38da allow changing playback speed during playback.
reimar
parents: 13634
diff changeset
62 #define MP_CMD_SPEED_INCR 57
d7af73cc38da allow changing playback speed during playback.
reimar
parents: 13634
diff changeset
63 #define MP_CMD_SPEED_MULT 58
d7af73cc38da allow changing playback speed during playback.
reimar
parents: 13634
diff changeset
64 #define MP_CMD_SPEED_SET 59
14087
26937d8c5c9e enable the run slave commande even without libmenu
aurel
parents: 13991
diff changeset
65 #define MP_CMD_RUN 60
14684
a4767edef10d command to log current subtitle to file
henry
parents: 14087
diff changeset
66 #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
67 #define MP_CMD_SWITCH_AUDIO 62
15504
cec4a515061f new get_time_pos slave mode commando
reimar
parents: 15046
diff changeset
68 #define MP_CMD_GET_TIME_POS 63
15706
c6bedab03c97 Add sub_load and sub_remove slave commands.
reimar
parents: 15504
diff changeset
69 #define MP_CMD_SUB_LOAD 64
c6bedab03c97 Add sub_load and sub_remove slave commands.
reimar
parents: 15504
diff changeset
70 #define MP_CMD_SUB_REMOVE 65
16323
60c6693b2b2b add key_down_eventto slave mode, used to inject key down event with mplayer_put_key
nplourde
parents: 15825
diff changeset
71 #define MP_CMD_KEYDOWN_EVENTS 66
16968
e9d849bf8050 add a switch, slave command, and vo control to toggle borderless window.
joey
parents: 16323
diff changeset
72 #define MP_CMD_VO_BORDER 67
17911
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents: 17890
diff changeset
73 #define MP_CMD_SET_PROPERTY 68
52f95509cd05 Add the new property API and implement a couple properties.
albeu
parents: 17890
diff changeset
74 #define MP_CMD_GET_PROPERTY 69
18222
8c35bd43135f Add a new command: osd_show_property_text that show an expanded property
albeu
parents: 17911
diff changeset
75 #define MP_CMD_OSD_SHOW_PROPERTY_TEXT 70
19342
4e68a3881201 Add matroska chapter seeking capability.
eugeni
parents: 18312
diff changeset
76 #define MP_CMD_SEEK_CHAPTER 71
19491
10d8f2cae948 added new filter option to menu file browser to only display some files according to extension
ben
parents: 19342
diff changeset
77 #define MP_CMD_FILE_FILTER 72
19533
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
78 #define MP_CMD_GET_FILENAME 73
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
79 #define MP_CMD_GET_VIDEO_CODEC 74
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
80 #define MP_CMD_GET_VIDEO_BITRATE 75
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
81 #define MP_CMD_GET_VIDEO_RESOLUTION 76
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
82 #define MP_CMD_GET_AUDIO_CODEC 77
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
83 #define MP_CMD_GET_AUDIO_BITRATE 78
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
84 #define MP_CMD_GET_AUDIO_SAMPLES 79
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
85 #define MP_CMD_GET_META_TITLE 80
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
86 #define MP_CMD_GET_META_ARTIST 81
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
87 #define MP_CMD_GET_META_ALBUM 82
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
88 #define MP_CMD_GET_META_YEAR 83
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
89 #define MP_CMD_GET_META_COMMENT 84
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
90 #define MP_CMD_GET_META_TRACK 85
0fc9a4ca9e66 extended slave mode with metadata retrieval commands
ben
parents: 19491
diff changeset
91 #define MP_CMD_GET_META_GENRE 86
19568
bd821fd3e244 Radio support, patch by Vladimir Voroshilov (voroshil gmail com)
reimar
parents: 19533
diff changeset
92 #define MP_CMD_RADIO_STEP_CHANNEL 87
bd821fd3e244 Radio support, patch by Vladimir Voroshilov (voroshil gmail com)
reimar
parents: 19533
diff changeset
93 #define MP_CMD_RADIO_SET_CHANNEL 88
bd821fd3e244 Radio support, patch by Vladimir Voroshilov (voroshil gmail com)
reimar
parents: 19533
diff changeset
94 #define MP_CMD_RADIO_SET_FREQ 89
19850
4919b3ce8d5e report to mplayer with a slave command the coordinates of the pointer reported by x11; rescale coordinates to [0,1]x[0,1] range - patch by Jonas Jermann and me
nicodvb
parents: 19777
diff changeset
95 #define MP_CMD_SET_MOUSE_POS 90
20915
8fa904597f2a Introduce step_property command.
reimar
parents: 19912
diff changeset
96 #define MP_CMD_STEP_PROPERTY 91
21042
c549c2de24ce new slave command: radio_step_freq
voroshil
parents: 20915
diff changeset
97 #define MP_CMD_RADIO_STEP_FREQ 92
22667
e1859558b37d New slave command: tv_step_freq <offset in MHz>
voroshil
parents: 22255
diff changeset
98 #define MP_CMD_TV_STEP_FREQ 93
23727
2de8f66b3570 Add a loop command and property.
albeu
parents: 23725
diff changeset
99 #define MP_CMD_LOOP 94
23568
519e42b716aa The audio balance feature implemented with af_pan.
zuxy
parents: 23510
diff changeset
100 #define MP_CMD_BALANCE 96
23725
a0432f65040e Add the sub_scale property and command.
albeu
parents: 23573
diff changeset
101 #define MP_CMD_SUB_SCALE 97
23900
b5cc28c45d73 Teletext support.
voroshil
parents: 23727
diff changeset
102 #define MP_CMD_TV_TELETEXT_ADD_DEC 98
b5cc28c45d73 Teletext support.
voroshil
parents: 23727
diff changeset
103 #define MP_CMD_TV_TELETEXT_GO_LINK 99
24105
9e71e0345c35 Automatic TV channels scanning ability for MPlayer.
voroshil
parents: 23900
diff changeset
104 #define MP_CMD_TV_START_SCAN 100
25129
c04b64054255 Support select subtitle by source, add 4 properties:
ulion
parents: 24132
diff changeset
105 #define MP_CMD_SUB_SOURCE 101
c04b64054255 Support select subtitle by source, add 4 properties:
ulion
parents: 24132
diff changeset
106 #define MP_CMD_SUB_FILE 102
c04b64054255 Support select subtitle by source, add 4 properties:
ulion
parents: 24132
diff changeset
107 #define MP_CMD_SUB_VOB 103
c04b64054255 Support select subtitle by source, add 4 properties:
ulion
parents: 24132
diff changeset
108 #define MP_CMD_SUB_DEMUX 104
25576
54512595b406 properties to change angle; patch by oattila chello hu
nicodvb
parents: 25553
diff changeset
109 #define MP_CMD_SWITCH_ANGLE 105
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
110
4858
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
111 #define MP_CMD_GUI_EVENTS 5000
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
112 #define MP_CMD_GUI_LOADFILE 5001
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
113 #define MP_CMD_GUI_LOADSUBTITLE 5002
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
114 #define MP_CMD_GUI_ABOUT 5003
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
115 #define MP_CMD_GUI_PLAY 5004
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
116 #define MP_CMD_GUI_STOP 5005
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
117 #define MP_CMD_GUI_PLAYLIST 5006
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
118 #define MP_CMD_GUI_PREFERENCES 5007
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
119 #define MP_CMD_GUI_FULLSCREEN 5008
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
120 #define MP_CMD_GUI_SKINBROWSER 5009
65730cea02e7 add half new input support for gui
pontscho
parents: 4821
diff changeset
121
10568
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
122 #ifdef HAS_DVBIN_SUPPORT
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
123 #define MP_CMD_DVB_SET_CHANNEL 5101
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
124 #endif
02e4b1f77d6a dvbin fix by Nico <nsabbi@libero.it>
alex
parents: 10521
diff changeset
125
5380
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
126 #define MP_CMD_DVDNAV_UP 1
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
127 #define MP_CMD_DVDNAV_DOWN 2
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
128 #define MP_CMD_DVDNAV_LEFT 3
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
129 #define MP_CMD_DVDNAV_RIGHT 4
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
130 #define MP_CMD_DVDNAV_MENU 5
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
131 #define MP_CMD_DVDNAV_SELECT 6
19777
bb1b570ac7c1 permit to select previous dvdnav menu, in the order chapter->title->root
nicodvb
parents: 19568
diff changeset
132 #define MP_CMD_DVDNAV_PREVMENU 7
19912
3fdb44285fe7 introduced new MP_CMD_DVDNAV_MOUSECLICK command (bound to mouse0);
nicodvb
parents: 19911
diff changeset
133 #define MP_CMD_DVDNAV_MOUSECLICK 8
5380
8a01cde9cf39 DVDnav support patch by David Holm and Kees Cook <mplayer@outflux.net>
arpi
parents: 5197
diff changeset
134
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
135 /// Console commands
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
136 #define MP_CMD_CHELP 7000
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
137 #define MP_CMD_CEXIT 7001
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
138 #define MP_CMD_CHIDE 7002
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
139
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
140 // The arg types
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
141 #define MP_CMD_ARG_INT 0
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
142 #define MP_CMD_ARG_FLOAT 1
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
143 #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
144 #define MP_CMD_ARG_VOID 3
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
145
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
146 #ifndef MP_CMD_MAX_ARGS
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
147 #define MP_CMD_MAX_ARGS 10
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
148 #endif
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
149
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
150 // Error codes for the drivers
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
151
11678
972d1998bde9 occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents: 11542
diff changeset
152 // An error occurred but we can continue
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
153 #define MP_INPUT_ERROR -1
11678
972d1998bde9 occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents: 11542
diff changeset
154 // 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
155 #define MP_INPUT_DEAD -2
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
156 // No input was available
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
157 #define MP_INPUT_NOTHING -3
15825
8549fc0fb5b1 consume empty lirc events at once.
reimar
parents: 15706
diff changeset
158 //! Input will be available if you try again
8549fc0fb5b1 consume empty lirc events at once.
reimar
parents: 15706
diff changeset
159 #define MP_INPUT_RETRY -4
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
160
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
161 // 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
162 // 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
163 // 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
164 #define MP_KEY_DOWN (1<<29)
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
165 // 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
166 #define MP_NO_REPEAT_KEY (1<<28)
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
167
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
168 #ifndef MP_MAX_KEY_DOWN
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
169 #define MP_MAX_KEY_DOWN 32
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
170 #endif
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
171
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
172 typedef union mp_cmd_arg_value {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
173 int i;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
174 float f;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
175 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
176 void* v;
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
177 } mp_cmd_arg_value_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
178
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
179 typedef struct mp_cmd_arg {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
180 int type;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
181 mp_cmd_arg_value_t v;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
182 } mp_cmd_arg_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
183
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
184 typedef struct mp_cmd {
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
185 int id;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
186 char* name;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
187 int nargs;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
188 mp_cmd_arg_t args[MP_CMD_MAX_ARGS];
13991
28a6f0847c58 add "pausing" prefix for MPlayer commands
reimar
parents: 13710
diff changeset
189 int pausing;
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
190 } mp_cmd_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
191
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
192
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
193 typedef struct mp_cmd_bind {
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
194 int input[MP_MAX_KEY_DOWN+1];
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
195 char* cmd;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
196 } mp_cmd_bind_t;
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
197
4589
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
198 typedef struct mp_key_name {
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
199 int key;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
200 char* name;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
201 } mp_key_name_t;
4ce20c55a18a Added support for key combination and mouse buttons key code
albeu
parents: 4431
diff changeset
202
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
203 // These typedefs are for the drivers. They are the functions used to retrieve
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
204 // the next key code or command.
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
205
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
206 // 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
207 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
208 // 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
209 typedef int (*mp_cmd_func_t)(int fd,char* dest,int size);
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
210 // These are used to close the driver
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
211 typedef void (*mp_close_func_t)(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
212
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
213 // Set this to grab all incoming key codes
25502
605d4e3e403f From now on, libmenu does not steal all input keys from input modules.
ulion
parents: 25319
diff changeset
214 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
215 // 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
216 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
217
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
218 // This function adds a new key driver.
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
219 // 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
220 // 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
221 // 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
222 // fd will be used.
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
223 // The last arg can be NULL if nothing is needed to close the driver. The close
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
224 // function can be used
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
225 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
226 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
227
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
228 // 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
229 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
230 mp_input_rm_cmd_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
231
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
232 // 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
233 // give a read_func.
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
234 int
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
235 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
236
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
237 // 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
238 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
239 mp_input_rm_key_fd(int fd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
240
24132
9f234010c4be Add separate event input type for terminal+vo
uau
parents: 24105
diff changeset
241 int mp_input_add_event_fd(int fd, void (*read_func)(void));
9f234010c4be Add separate event input type for terminal+vo
uau
parents: 24105
diff changeset
242
9f234010c4be Add separate event input type for terminal+vo
uau
parents: 24105
diff changeset
243 void mp_input_rm_event_fd(int fd);
9f234010c4be Add separate event input type for terminal+vo
uau
parents: 24105
diff changeset
244
25263
96d0992c7920 Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents: 25129
diff changeset
245 /// Get input key from its name.
96d0992c7920 Remove hardcoded key->cmd bindings in libmenu, support custom key bindings
ulion
parents: 25129
diff changeset
246 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
247
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
248 // 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
249 // when it performs a blocking operation to resend the command it received to the main
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
250 // loop.
4821
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
251 int
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
252 mp_input_queue_cmd(mp_cmd_t* cmd);
5a71377d2759 Fixed bug with comments in input.conf parser
albeu
parents: 4732
diff changeset
253
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
254 // This function retrieves the next available command waiting no more than time msec.
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
255 // 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
256 mp_cmd_t*
13603
80fc8f48f14c Do not loose commands while paused.
reimar
parents: 13339
diff changeset
257 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
258
8196
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
259 mp_cmd_t*
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
260 mp_input_parse_cmd(char* str);
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
261
25319
50a30be5300c Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents: 25263
diff changeset
262 /**
50a30be5300c Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents: 25263
diff changeset
263 * 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
264 * @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
265 */
50a30be5300c Add new function for parsing and queueing multi-commands separated by \n or \r.
ulion
parents: 25263
diff changeset
266 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
267
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
268 /// These filters allow you to process the command before MPlayer.
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
269 /// 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
270 void
419bdbfdb660 Add the possibilty to grab the keys and to filter the commands
albeu
parents: 7912
diff changeset
271 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
272
5197
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
273 // After getting a command from mp_input_get_cmd you need to free it using this
f0e3dcefb7af Commentting session
albeu
parents: 5015
diff changeset
274 // function
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
275 void
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
276 mp_cmd_free(mp_cmd_t* cmd);
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
277
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
278 // 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
279 mp_cmd_t*
610a11e4db36 Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents: 4589
diff changeset
280 mp_cmd_clone(mp_cmd_t* cmd);
610a11e4db36 Added key autorepeat support. Options to enable/disable joystick and lirc
albeu
parents: 4589
diff changeset
281
23477
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
282 // Set current input section
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
283 void
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
284 mp_input_set_section(char *name);
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
285
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
286 // Get current input section
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
287 char*
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
288 mp_input_get_section(void);
15710094cb15 implement "bind sections"
voroshil
parents: 22667
diff changeset
289
10867
5b666694b437 spelling cosmetics
diego
parents: 10580
diff changeset
290 // 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
291 void
17890
633f3d0a621b Enable gui key bindings only when running the gui. Fix enter and esc
albeu
parents: 16968
diff changeset
292 mp_input_init(int use_gui);
4418
8141d2c399e4 A new configurable input system and joystick support for this system
albeu
parents:
diff changeset
293
4431
44c23fd75005 Added uninit to input
albeu
parents: 4418
diff changeset
294 void
44c23fd75005 Added uninit to input
albeu
parents: 4418
diff changeset
295 mp_input_uninit(void);
7862
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
296
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
297 // Interruptible usleep: (used by libmpdemux)
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
298 int
013c255225d8 mpdemux.c|h moved to libinput, mpdemux_check_interrupt() -> mp_input_check_interrupt()
arpi
parents: 7779
diff changeset
299 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
300
25623
b955a135e3a8 Do not use exit_player in the signal handler, this code just can not
reimar
parents: 25576
diff changeset
301 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
302
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 25502
diff changeset
303 #endif /* INPUT_H */