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.
This commit is contained in:
wm4 2013-02-16 21:17:59 +01:00
parent f897138c2d
commit 6d7e044ead
6 changed files with 14 additions and 3 deletions

View File

@ -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.

View File

@ -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,

View File

@ -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;
}

View File

@ -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

View File

@ -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) {

View File

@ -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;