diff options
author | wm4 <wm4@nowhere> | 2015-04-02 00:08:38 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-02 00:08:38 +0200 |
commit | 550d908ba8d505b70fb64c4979de4f05f2d452c6 (patch) | |
tree | f42b64c6216172e61928d2fe117da86917682253 /player/main.c | |
parent | 9b59c175e389e0a0561312139c0861eba37e4719 (diff) | |
download | mpv-550d908ba8d505b70fb64c4979de4f05f2d452c6.tar.bz2 mpv-550d908ba8d505b70fb64c4979de4f05f2d452c6.tar.xz |
player: add "pseudo-gui" profile
This can be set to select a number of default settings that help mpv
pretend that it has a GUI.
I haven't decided yet whether I really want to use the profile mechanism
for this. There are a number of weird details that are not so easy to
handle with profiles, such as disabling pseudo-gui mode again (you can't
unset profiles directly). So this might change. But for now it will do.
There also should be a better way to store builtin profiles.
Unfortunately, the old crappy MPlayer config file parser needs on-disk
files, so just use a bunch of function calls for now.
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c index b3fb14ef10..7f0e61f9e4 100644 --- a/player/main.c +++ b/player/main.c @@ -313,6 +313,13 @@ static int cfg_include(void *ctx, char *filename, int flags) return r; } +static void add_default_profiles(struct m_config *cfg) +{ + struct m_profile *ui = m_config_add_profile(cfg, "pseudo-gui"); + m_config_set_profile_option(cfg, ui, bstr0("terminal"), bstr0("no")); + m_config_set_profile_option(cfg, ui, bstr0("force-window"), bstr0("yes")); +} + struct MPContext *mp_create(void) { mp_time_init(); @@ -346,6 +353,7 @@ struct MPContext *mp_create(void) mpctx->mconfig->includefunc_ctx = mpctx; mpctx->mconfig->use_profiles = true; mpctx->mconfig->is_toplevel = true; + add_default_profiles(mpctx->mconfig); mpctx->global->opts = mpctx->opts; |