summaryrefslogtreecommitdiffstats
path: root/input/cmd_list.c
Commit message (Collapse)AuthorAgeFilesLines
* command: add a change-list commandwm42018-01-251-0/+1
| | | | | | | | | | | | | Requested. See manpage additions. The main reason why this goes through the trouble to keep the action/operation parameter separate is so that we don't expose some option parser implementation details to the command (although that is a relatively weak reason), and also to make it more different from the "set" command, which can't support this type of option as it goes through the property layer. Fixes #5435.
* input: make command argument list a dynamic arraywm42018-01-101-2/+3
| | | | | | | | Replace the static array with dynamic memory allocation. This also requires some code to honor mp_cmd.nargs more strictly. Generally allocates more stuff. Fixes #5375 (although we could also just raise the static limit).
* player: remove internal `vo-resize` command againsfan52018-01-021-1/+0
| | | | Its only usecase was automated in the previous commit.
* player: add internal `vo-resize` commandsfan52017-12-271-0/+1
| | | | Intended to be used with the properties from previous commit.
* input: remove a stray HAVE_GPLwm42017-11-291-2/+0
| | | | | | | This was marked GPL, because the implementation in command.c (which is shared with the subtitle code) was marked as GPL. This has been changed, so this is unnecessary. The original commands for external audio tracks have been added to mpv by someone who agreed with the relicensing.
* player: change 3 remaining GPL-only code pieces to LGPLwm42017-11-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There has been no new developments or agreements, but I was uncertain about the copyright status of them. Thus this part of code was marked as being potentially GPL, and was not built in LGPL mode. Now I've taken a close look again, and decided that these can be relicensed using the existing relicensing agreements. OSD level 3 was introduced in commit 8d190244, with the author being unreachable. As I decided in commit 6ddd95fd, OSD level 3 itself can be kept, but the "osd" command had to go, and the "rendering" of OSD level 3 (the HAVE_GPL code in osd.c) was uncertain. But the code for this was rewritten: instead of duplicating the time/percent formatting code, it was changed to use common code, and some weird extra logic was removed. The code inside of the "if" is exactly the same as the code that formats the OSD status line (covered by LGPL relicensing). The current commands for adding/removing sub/audio tracks more or less originated from commit 2f376d1b39, with the author being unreachable. But the original code was very different, mostly due to MPlayer's incredibly messy handling of subtitles in general. Nothing of this remains in the current code. Even the command declarations were rewritten. The commands (as seen from the user side) are rather similar in naming and semantics, but we don't consider this copyrightable. So it doesn't look like anything copyrightable is left. The add/cycle commands were more or less based on step_property, introduced in commit 7a71da01d6, with the patch author disagreeing with the LGPL relicensing. But all code original to the patch has been replaced in later mpv changes, and the original code was mostly copied from MP_CMD_SET_PROPERTY anyway. The underlying property interface was completely changed, the error handling was redone, and all of this is very similar to the changes that were done on SET_PROPERTY. The command declarations are completely different in the first place, because the semantic change from step to add/cycle. The commit also seems to have been co-authored by reimar to some degree. He also had the idea to change the original patch from making the command modify a specific property to making it generic. (The error message line, especially with its %g formatting, might contain some level of originality, so change that just to be sure. This commit Copies and adapts the error message for SET_PROPERTY.) Although I'm a bit on the fence with all the above things, it really doesn't look like there's anything substantial that would cause issues. I thus claim that there is no problem with changing the license to LGPL for the above things. It's probably still slightly below the standard that was usually applied in the code relicensing in mpv, but probably still far above to the usual in open source relicensing (and above commercial standards as well, if you look what certain tech giants do).
* build: add preliminary LGPL modewm42017-09-211-0/+2
| | | | | | | See "Copyright" file for caveats. This changes the remaining "almost LGPL" files to LGPL, because we think that the conditions the author set for these was finally fulfilled.
* input: drop deprecated "osd" commandwm42017-07-211-3/+0
| | | | | Complicated situation due to changes by GPL-only author, but also unnecessary due to newer mechanisms.
* player: deprecate "osd" commandwm42017-06-231-0/+2
| | | | | | | | | | | It was extended by "seru" in 8d190244. This person could not be reached (or does not reply), and it's in the way of LGPL relicensing. Deprecate it, and mark the (probably) affected parts of the code with HAVE_GPL. To be fair, even though the osd.c parts were refactored from the original code, there's probably no copyright by seru on it. But for now play it save. The mere existence of a 3rd OSD level is certainly not copyrightable, so you still can set osd-level to 3 - just that it does nothing.
* input: mention GPL exceptions in license headerwm42017-06-201-0/+2
| | | | (Just to make our HAVE_GPL business explicit.)
* input: change license to LGPLwm42017-06-191-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cehoyos adds the step_property command in 7a71da01d, and it could be argued that copyright of this still applies to the later add/cycle commands (a668ae0ff90c4). While I'm not sure if this is really the case, stay conservative for now and mark these commands as GPL-only. Mark the command.c code too, although that is not being relicensed yet. I'm leaving the MP_CMD_* enum items, as they are obviously different. In commit 116ca0c7682, "veal" (essentially an anonymous author) adds an "osd_show_property_text" command (well, the commit message says "based on" that person's code, so it's not clear how much is from him or from albeu, who agreed to LGPL). This was later merged again with the "osd_show_text" command, and then all original code was removed in commit 58cc0f637f, so I claim that no copyright applies anymore. (Though technically the input.conf addition still might be copyrighted, so I'm just dropping it to get rid of the thought.) "kiriuja" added 2f376d1b39 (sub_load etc.) and be54f4813 (switch_audio). The latter is gone. I would argue that the former is fully rewritten with commits b7052b431c9 and 0f155921b0. But like in the step_property case, I will be overly conservative for now, and mark them as GPL-only, as this is potentially shaky and should be thought through first. (Not bothering with the command define/enum in the header, as it will be unused in LGPL mode anyway.) keycodes.c/h can be GPL, except for commit 2b1f95dcc2f8, which is a patch by someone who wasn't asked yet. Before doing something radical, I will wait for a reply.
* command: mark some commands as "scalable"James Ross-Gowan2017-05-121-2/+11
| | | | | | | | | | Scalable commands (seek, cycle and add) understand the cmd->scale parameter and will "scale" their action accordingly, for example, a seek with scale = 0.5 will only seek half the specified amount and a seek with scale = 2.0 will seek twice as much. Mark these commands so in the next commit, input.c will be able to synthesize input with cmd->scale = 1 for non-scalable commands.
* command: add expand-text command to property-expand a stringAvi Halachmi (:avih)2017-03-261-0/+1
|
* command: add a load-script commandwm42016-09-221-0/+2
| | | | | | | The intention is to give libmpv users as much flexibility to load scripts as using mpv from CLI, but without restricting libmpv users from having to decide everything on creation time, or having to go through hacks like recreating the libmpv context to update state.
* command: add an apply-profile commandwm42016-09-171-0/+2
| | | | | This will actually update all associated options (which is trivial now with the recent changes).
* command: remove vo-cmdlinewm42016-09-021-2/+0
| | | | | | With the recent vo_opengl changes it doesn't do anything anymore. I don't think a deprecation period is necessary, because the command was always marked as experimental.
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-1/+1
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* command: add af-command commandwm42016-01-221-0/+1
| | | | Similar to vf-command. Requested. Untested.
* command: add vf-command commandwm42016-01-221-0/+1
|
* command: make "add <property> 0" not change the valuewm42015-09-101-1/+1
| | | | | | | | | | | | | | | The value 0 was treated specially, and effectively forced the increment to 1. Interestingly, passing 0 or no value also does not include the scale (from touchpads etc.), but this is probably an accidental behavior that was never intentionally added. Simplify it and make the default increment 1. 0 now means what it should: the value will not be changed. This is not particularly useful, but on the other hand there is no need for surprising and unintuitive semantics. OARG_CYCLEDIR() failed to apply the default value, because m_option_type_cycle_dir was missing a copy handler - add this too.
* lua: implement input_enable_section/input_disable_section via commandswm42015-08-061-2/+4
| | | | | | | | | | | | | | | Removes some more internal API calls from the Lua scripting backend. Which is good, because ideally the scripting backend would use libmpv functions only. One awkwardness is that mouse sections are still not supported by the public commands (and probably will never), so flags like allow-hide- cursor make no sense to an outside user. Also, the way flags are passed to the Lua function changes. But that's ok, because they're only undocumented internal functions, and not supposed to be used by script users. osc.lua only does due to historical reasons.
* command: add a command for defining input bindingswm42015-08-061-0/+6
| | | | | | This was requested. It was more or less present internally already and used for Lua scripting. Lua will switch to the "public" functions in the following commits.
* player: remove higher-level remains of DVD/BD menu supportwm42015-08-031-3/+0
| | | | | | | | | | | | | | | Nobody wanted to restore this, so it gets the boot. If anyone still wants to volunteer to restore menu support, this would be welcome. (I might even try it myself if I feel masochistic and like wasting a lot of time for nothing.) But if it does get restored, it should be done differently. There were many stupid things about how it was done. For example, it somehow tried to pull mp_nav_events through all the layers (including needing to "buffer" them in the demuxer), which was needlessly complicated. It could be done simpler. This code was already inactive, so this commit actually changes nothing. Also keep in mind that normal DVD/BD playback still works.
* player: use exit code 0 by default for quit, 4 for signals, etc.Philip Sequeira2015-07-111-2/+2
| | | | | | Default key bindings in encoding mode also use code 4, because scripts will probably want to fail if encoding is aborted (leaving an incomplete file).
* input: fix exit code for quit-watch-later commandwm42015-07-081-1/+1
| | | | It should have the same default as the "quit" command.
* command: add keypress, keydown, and keyup commands.torque2015-06-111-0/+3
| | | | | These commands are used to simulate keypresses using the key names from input.conf.
* player: use 4 as process exit code on user quitswm42015-06-101-1/+1
| | | | | | | | | | | | | So successful playback and user quit can be distinguished, for whatever reason you may want to do this. Normally, the "quit" command can be customized, but this does not work for quit commands sent by the terminal signal handler. One solution would be introducing something like "ON_SIGNAL" (equivalent to "CLOSE_WIN"), but considering there are a bunch of possible signals, I'd rather not get into this. So go with the dumb solution. Probably fixes #2029.
* command: remove deprecated get_property commandwm42015-05-271-1/+0
| | | | | | This command has been deprecated in the 0.8.x and 0.9.x releases - get rid of it. Its only point ever was MPlayer compatibility, which broke years ago anyway.
* input: allow - as separator between commands, instead of _wm42015-05-251-51/+51
| | | | | | | | | | Wnile it seems quite logical to me that commands use _ as word separator, while properties use -, I can't really explain the difference, and it tends to confuse users as well. So always prefer - as separator for everything. Using _ still works, and will probably forever. Not doing so would probably create too much chaos and confusion.
* input: add relative percentage seekrrooij2015-05-191-0/+1
| | | | | | | | | | | Only absolute percentage seeking was permitted first. It is now also possible to seek by relative percentage. MPSEEK_FACTOR is used as seek_type. Fixes #1950. Signed-off-by: wm4 <wm4@nowhere>
* command: add playlist_shuffle commandwm42015-05-171-0/+1
| | | | Fixes #965.
* command: change the default action for rescan_external_fileswm42015-04-281-1/+1
| | | | | | | | Now the rescan_external_files command will by default reselect the audio and subtitle streams. This should be more intuitive. Client API users and Lua scripts might break, but can be fixed in a backward-compatible way by setting the mode explicitly.
* client API: add a screenshot_raw commandwm42015-04-201-0/+5
| | | | | | | | | Requested. The wild code for setting up the mpv_node probably deserves to be cleaned up later. Fixes #1800.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: use flag option type for some input commandswm42015-03-041-13/+19
| | | | | | | | | | This gets rid of the need for a second (or more) parameters; instead it can be all in one parameter. The (now) redundant parameter is still parsed for compatibility, though. The way the flags make each other conflict is a bit tricky: they have overlapping bits, and the option parser disallows setting already set bits.
* input: remove numeric compatibility parameters from commandswm42015-03-041-14/+14
| | | | | | MPlayer requires numeric values for input command parameters. mplayer2 also did. mpv changed these to choices using symbolic strings a long time ago, but left numeric choices for compatibility.
* command: add rescan_external_fileswm42015-02-161-0/+5
| | | | | | | | | Requested. Hopefully will be useful for things that download and add external subtitles on demand. Or something. Closes #1586.
* command: new commands audio_add/audio_remove/audio_reloadxylosper2015-02-031-0/+6
| | | | | | | | These commands are counterparts of sub_add/sub_remove/sub_reload which work for external audio file. Signed-off-by: wm4 <wm4@nowhere> (minor simplification)
* input, player: new command for mouse eventxylosper2015-01-231-0/+7
| | | | | | | New command `mouse <x> <y> [<button> [single|double]]` is introduced. This will update mouse position with given coordinate (`<x>`, `<y>`), and additionally, send single-click or double-click event if `<button>` is given.
* command: extend revert_seek commandwm42014-12-171-1/+3
| | | | | "revert_seek mark" basically forces the seekback point. It's basically a one-way bookmark.
* input: simplifywm42014-11-241-2/+3
|
* lua: always handle key repeat on the script sidewm42014-11-241-1/+3
| | | | | | Simpler, and leaves the decision to repeat or not fully to the script (instead of requiring the user to care about it when remapping a script binding).
* input, lua: redo input handlingwm42014-11-231-1/+1
| | | | | Much of it is the same, but now there's the possibility to distinguish key down/up events in the Lua API.
* input: add a prefix to make any binding act on key repeatwm42014-11-201-1/+2
| | | | | | The fact that it's a generic command prefix that is parsed even when using the client API is a bit unclean (because this flag makes sense for actual key-bindings only), but it's less code this way.
* command: add drop_bufferswm42014-11-201-0/+2
| | | | | | | | | | | | | | | This command was actually requested on IRC ages ago, but I forgot about it. The main purpose is that the decoding state can be reset without issuing a seek, in particular in situations where you can't seek. This restarts decoding from the middle of the packet stream; since it discards the packet buffer intentionally, and the decoder will typically not output "incomplete" frames until it has recovered, it can skip a large amount of data. It doesn't clear the byte stream cache - I'm not sure if it should.
* command: add an ab_loop commandwm42014-11-181-0/+2
| | | | | | As suggested in #1241; to make using the feature easier. Also add better OSD-formatting for the ab-loop-a/b properties.
* audio: add command/function to reload audio outputwm42014-10-271-0/+1
| | | | | Anticipated use: simple solution for dealing with audio APIs which request configuration changes via events.
* command: add a "cached" mode to sub_addwm42014-10-231-1/+1
| | | | | This avoids reloading a subtitle if it was already added. In all cases, the subtitle is selected.
* command: make trailing sub_add actually optionalwm42014-10-221-1/+2
| | | | This was always intended. Also fixes subtitle-file drag & drop.
* command: extend sub_add commandwm42014-10-211-1/+3
|
* command: add a mechanism to allow scripts to intercept file loadswm42014-10-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | A vague idea to get something similar what libquvi did. Undocumented because it might change a lot, or even be removed. To give an idea what it does, a Lua script could do the following: -- type ID priority mp.commandv("hook_add", "on_load", 0, 0) mp.register_script_message("hook_run", function(param, param2) -- param is "0", the user-chosen ID from the hook_add command -- param2 is the magic value that has to be passed to finish -- the hook mp.resume_all() -- do something, maybe set options that are reset on end: mp.set_property("file-local-options/name", "value") -- or change the URL that's being opened: local url = mp.get_property("stream-open-filename") mp.set_property("stream-open-filename", url .. ".png") -- let the player (or the next script) continue mp.commandv("hook_ack", param2) end)
* input: fix nested commandswm42014-09-131-1/+1
| | | | Regression from today.
* input: distinguish playlist navigation and quit commands for abortwm42014-09-131-14/+19
| | | | | | | Refine the ugly hack from the previous commit, and let the "quit" command and some others abort playback immediately. For playlist_next/playlist_prev, still use the old hack, because we can't know if they would stop playback or not.
* input: "quit_watch_later" and "stop" are abort commandswm42014-09-131-0/+2
| | | | | | | | | This means they get special handling for asynchronously aborting playback, even if the player is "stuck". Also document "stop". It seems somewhat useful for client API users (although that will be implemented properly only in the following commits.)
* input: don't autorepeat cycle_values commandwm42014-09-131-1/+1
| | | | | | | Not sure why this was originally added as autorepeated. It makes no sense, because switching between choices should never autorepeat. (For the normal "add"/"cycle" commands, autorepeat is usually enabled, but command.c tries to disable it specifically for choice properties.)
* command: add append-play loadfile modewm42014-07-231-1/+2
| | | | | | | | "loadfile filename append-play" will now always append the file to the playlist, and if nothing is playing yet, start playback. I don't want to change the semantics of "append" mode, so a new mode is needed. Probably fixes issue #950.
* command: redo ancient TV/DVB/PVR commandswm42014-06-111-10/+0
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* input: make combined commands repeatablewm42014-05-261-0/+6