mirror of https://github.com/mpv-player/mpv
options: add options to control OSD bar marker size
This adds --osd-bar-marker-scale and --osd-bar-marker-min-size options which can be used to customize OSD bar marker size.
This commit is contained in:
parent
085a816c80
commit
ea8ac49f11
|
@ -0,0 +1 @@
|
||||||
|
add `--osd-bar-marker-scale` and `--osd-bar-marker-min-size` options
|
|
@ -4512,6 +4512,16 @@ OSD
|
||||||
|
|
||||||
Default: 0.5.
|
Default: 0.5.
|
||||||
|
|
||||||
|
``--osd-bar-marker-scale=<0-100>``
|
||||||
|
Factor for the OSD bar marker size relative to the OSD bar outline size.
|
||||||
|
|
||||||
|
Default: 1.3.
|
||||||
|
|
||||||
|
``--osd-bar-marker-min-size=<size>``
|
||||||
|
Minimum OSD bar marker size.
|
||||||
|
|
||||||
|
Default: 1.6.
|
||||||
|
|
||||||
``--osd-blur=<0..20.0>``
|
``--osd-blur=<0..20.0>``
|
||||||
Gaussian blur factor applied to the OSD font border.
|
Gaussian blur factor applied to the OSD font border.
|
||||||
0 means no blur applied (default).
|
0 means no blur applied (default).
|
||||||
|
|
|
@ -415,6 +415,8 @@ const struct m_sub_options mp_osd_render_sub_opts = {
|
||||||
{"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)},
|
{"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)},
|
||||||
{"osd-bar-outline-size", OPT_FLOAT(osd_bar_outline_size), M_RANGE(0, 1000.0)},
|
{"osd-bar-outline-size", OPT_FLOAT(osd_bar_outline_size), M_RANGE(0, 1000.0)},
|
||||||
{"osd-bar-border-size", OPT_ALIAS("osd-bar-outline-size")},
|
{"osd-bar-border-size", OPT_ALIAS("osd-bar-outline-size")},
|
||||||
|
{"osd-bar-marker-scale", OPT_FLOAT(osd_bar_marker_scale), M_RANGE(0, 100.0)},
|
||||||
|
{"osd-bar-marker-min-size", OPT_FLOAT(osd_bar_marker_min_size), M_RANGE(0, 1000.0)},
|
||||||
{"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)},
|
{"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)},
|
||||||
{"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)},
|
{"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)},
|
||||||
{"osd-scale-by-window", OPT_BOOL(osd_scale_by_window)},
|
{"osd-scale-by-window", OPT_BOOL(osd_scale_by_window)},
|
||||||
|
@ -427,6 +429,8 @@ const struct m_sub_options mp_osd_render_sub_opts = {
|
||||||
.osd_bar_w = 75.0,
|
.osd_bar_w = 75.0,
|
||||||
.osd_bar_h = 3.125,
|
.osd_bar_h = 3.125,
|
||||||
.osd_bar_outline_size = 0.5,
|
.osd_bar_outline_size = 0.5,
|
||||||
|
.osd_bar_marker_scale = 1.3,
|
||||||
|
.osd_bar_marker_min_size = 1.6,
|
||||||
.osd_scale = 1,
|
.osd_scale = 1,
|
||||||
.osd_scale_by_window = true,
|
.osd_scale_by_window = true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -150,6 +150,8 @@ struct mp_osd_render_opts {
|
||||||
float osd_bar_w;
|
float osd_bar_w;
|
||||||
float osd_bar_h;
|
float osd_bar_h;
|
||||||
float osd_bar_outline_size;
|
float osd_bar_outline_size;
|
||||||
|
float osd_bar_marker_scale;
|
||||||
|
float osd_bar_marker_min_size;
|
||||||
float osd_scale;
|
float osd_scale;
|
||||||
bool osd_scale_by_window;
|
bool osd_scale_by_window;
|
||||||
struct osd_style_opts *osd_style;
|
struct osd_style_opts *osd_style;
|
||||||
|
|
|
@ -471,7 +471,8 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj)
|
||||||
// chapter marks
|
// chapter marks
|
||||||
for (int n = 0; n < obj->progbar_state.num_stops; n++) {
|
for (int n = 0; n < obj->progbar_state.num_stops; n++) {
|
||||||
float s = obj->progbar_state.stops[n] * width;
|
float s = obj->progbar_state.stops[n] * width;
|
||||||
float size = MPMAX(border * 1.3, 1.6);
|
float size = MPMAX(border * osd->opts->osd_bar_marker_scale,
|
||||||
|
osd->opts->osd_bar_marker_min_size);
|
||||||
|
|
||||||
if (s > size && s < width - size) {
|
if (s > size && s < width - size) {
|
||||||
ass_draw_move_to(d, s + size, 0);
|
ass_draw_move_to(d, s + size, 0);
|
||||||
|
|
Loading…
Reference in New Issue