diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2016-09-23 23:36:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-26 19:25:14 +0200 |
commit | f0ab9f05f1709ccda63e7e695031e1030dee6626 (patch) | |
tree | 1eb3156c30ec30d0ad154f6fc3fd7261e4f9dead | |
parent | dd339b200be99ecac1a0bb4a7509b338120c5bce (diff) | |
download | mpv-f0ab9f05f1709ccda63e7e695031e1030dee6626.tar.bz2 mpv-f0ab9f05f1709ccda63e7e695031e1030dee6626.tar.xz |
player: allow opts in pseudo-gui set by the user to override user's default
This should still allow user-set default options to override built-in
pseudo-gui while respecting user-set pseudo-gui options.
Pros:
- user option in default profile overrides built-in pseudo-gui's options
Ex: screenshot-directory overrides built-in pseudo-gui's
- user can "fix" pseudo-gui if some option like "force-window=no" is set
in default by setting "force-window=yes" in [pseudo-gui]
- `mpv --profile=pseudo-gui` will work as before
Cons:
- --show-profile=pseudo-gui won't display the built-in's options
Original idea from wm4.
Documentation edits mostly by wm4.
Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r-- | DOCS/man/mpv.rst | 16 | ||||
-rw-r--r-- | etc/builtin.conf | 3 | ||||
-rw-r--r-- | player/main.c | 7 |
3 files changed, 18 insertions, 8 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index 8ede4075f1..8b4d7c6065 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -737,20 +737,24 @@ Currently this happens only in the following cases: - if started from explorer.exe on Windows (technically, if it was started on Windows, and all of the stdout/stderr/stdin handles are unset) - started out of the bundle on OSX -- you can add ``--profile=pseudo-gui`` to the command line, but it will behave - subtly differently (since mpv 0.22.0) +- if you manually use ``--player-operation-mode=pseudo-gui`` on the command line -This mode implicitly performs the same action as ``--profile=pseudo-gui``, but -roughly before config files are loaded and the command line is applied. The -``pseudo-gui`` profile is predefined with the following contents: +This mode applies options from the builtin profile ``builtin-pseudo-gui``, but +only if these haven't been set in the user's config file or on the command line. +Also, for compatibility with the old pseudo-gui behavior, the options in the +``pseudo-gui`` profile are applied unconditionally. In addition, the profile +makes sure to enable the pseudo-GUI mode, so that ``--profile=pseudo-gui`` +works like in older mpv releases. The profiles are currently defined as follows: :: - [pseudo-gui] + [builtin-pseudo-gui] terminal=no force-window=yes idle=once screenshot-directory=~~desktop/ + [pseudo-gui] + player-operation-mode=pseudo-gui .. warning:: diff --git a/etc/builtin.conf b/etc/builtin.conf index da51495a71..533dce7127 100644 --- a/etc/builtin.conf +++ b/etc/builtin.conf @@ -3,6 +3,9 @@ # applied at later stages during loading. [pseudo-gui] +player-operation-mode=pseudo-gui + +[builtin-pseudo-gui] terminal=no force-window=yes idle=once diff --git a/player/main.c b/player/main.c index 678ef5a5a1..ad907e034a 100644 --- a/player/main.c +++ b/player/main.c @@ -408,8 +408,11 @@ int mp_initialize(struct MPContext *mpctx, char **options) return r == M_OPT_EXIT ? -2 : -1; } - if (opts->operation_mode == 1) - m_config_set_profile(mpctx->mconfig, "pseudo-gui", M_SETOPT_NO_OVERWRITE); + if (opts->operation_mode == 1) { + m_config_set_profile(mpctx->mconfig, "builtin-pseudo-gui", + M_SETOPT_NO_OVERWRITE); + m_config_set_profile(mpctx->mconfig, "pseudo-gui", 0); + } mp_get_resume_defaults(mpctx); |