summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-16 21:17:59 +0100
committerwm4 <wm4@nowhere>2013-02-16 21:41:24 +0100
commit6d7e044eadabeac30c5701f2da516bd8394692ca (patch)
treeadfe71084928593530094b3b26570cffec8af275
parentf897138c2d4647cf2a7bbd0c58dc08c1f400fd48 (diff)
downloadmpv-6d7e044eadabeac30c5701f2da516bd8394692ca.tar.bz2
mpv-6d7e044eadabeac30c5701f2da516bd8394692ca.tar.xz
osd: add --no-osd-bar option to disable the OSD bar
In addition to disabling the OSD bar physically, also add some fallbacks to OSD text in places the OSD bar would have been used.
-rw-r--r--DOCS/man/en/options.rst8
-rw-r--r--core/cfg-mplayer.h1
-rw-r--r--core/command.c4
-rw-r--r--core/defaultopts.c1
-rw-r--r--core/mplayer.c2
-rw-r--r--core/options.h1
6 files changed, 14 insertions, 3 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index ab3dee4616..46999b9ed8 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -1288,6 +1288,14 @@
search for video segments from other files, and will also ignore any
chapter order specified for the main file.
+--no-osd-bar, --osd-bar
+ Disable display of the OSD bar. This will make some things (like seeking)
+ use OSD text messages instead of the bar.
+
+ You can configure this on a per-command basis in input.conf using ``osd-``
+ prefixes, see ``Input command prefixes``. If you want to disable the OSD
+ completely, use ``--osd-level=0``.
+
--osd-bar-align-x=<-1..1>
Position of the OSD bar. -1 is far left, 0 is centered, 1 is far right.
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h
index 1bc01f5230..6de9b7e65c 100644
--- a/core/cfg-mplayer.h
+++ b/core/cfg-mplayer.h
@@ -499,6 +499,7 @@ const m_option_t common_opts[] = {
OPT_INTRANGE("ass-hinting", ass_hinting, 0, 0, 7),
OPT_CHOICE("ass-style-override", ass_style_override, 0,
({"no", 0}, {"yes", 1})),
+ OPT_FLAG("osd-bar", osd_bar_visible, 0),
OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0),
OPT_FLOATRANGE("osd-bar-align-y", osd_bar_align_y, 0, -1.0, +1.0),
OPT_GENERAL("osd", osd_style, M_OPT_PREFIXED,
diff --git a/core/command.c b/core/command.c
index 7b9f374e0d..ba005f80ff 100644
--- a/core/command.c
+++ b/core/command.c
@@ -1585,7 +1585,7 @@ static void show_property_osd(MPContext *mpctx, const char *pname,
set_osd_bar(mpctx, osd_progbar, osd_name,
prop.min, prop.max, f);
}
- if (osd_mode == MP_ON_OSD_AUTO)
+ if (osd_mode == MP_ON_OSD_AUTO && opts->osd_bar_visible)
return;
}
@@ -1742,7 +1742,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
}
if (bar_osd)
mpctx->add_osd_seek_info |= OSD_SEEK_INFO_BAR;
- if (msg_osd && !auto_osd)
+ if (msg_osd && !(auto_osd && opts->osd_bar_visible))
mpctx->add_osd_seek_info |= OSD_SEEK_INFO_TEXT;
break;
}
diff --git a/core/defaultopts.c b/core/defaultopts.c
index 2399b853df..1119ef0633 100644
--- a/core/defaultopts.c
+++ b/core/defaultopts.c
@@ -57,6 +57,7 @@ void set_default_mplayer_options(struct MPOpts *opts)
.drc_level = 1.,
.movie_aspect = -1.,
.sub_auto = 1,
+ .osd_bar_visible = 1,
#ifdef CONFIG_ASS
.ass_enabled = 1,
#endif
diff --git a/core/mplayer.c b/core/mplayer.c
index 29e06e0caa..40ab1ffad3 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1382,7 +1382,7 @@ void set_osd_bar(struct MPContext *mpctx, int type, const char *name,
double min, double max, double val)
{
struct MPOpts *opts = &mpctx->opts;
- if (opts->osd_level < 1)
+ if (opts->osd_level < 1 || !opts->osd_bar_visible)
return;
if (mpctx->sh_video && opts->term_osd != 1) {
diff --git a/core/options.h b/core/options.h
index f5e350f076..94842cbc53 100644
--- a/core/options.h
+++ b/core/options.h
@@ -117,6 +117,7 @@ typedef struct MPOpts {
char **sub_name;
char **sub_paths;
int sub_auto;
+ int osd_bar_visible;
float osd_bar_align_x;
float osd_bar_align_y;
struct osd_style_opts *osd_style;