summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-23 14:23:37 +0200
committerwm4 <wm4@nowhere>2017-08-23 14:23:37 +0200
commitb62150bd6ba55cda3bd74a2db6d64ea5acd84f8e (patch)
tree5465be86f45105c22b46f758b47f67f9e2e80310 /player
parent60ba7eebd72c16aa4a5c010eb6c046d54877583b (diff)
downloadmpv-b62150bd6ba55cda3bd74a2db6d64ea5acd84f8e.tar.bz2
mpv-b62150bd6ba55cda3bd74a2db6d64ea5acd84f8e.tar.xz
command: restore OSD marker for video equalizer properties
Commit 03cf150ff3516 accidentally dropped these. Readd them in a simpler way (so only a property_osd_display[] entry is enough). This commit doesn't actually touch the video equalizer properties, because the default value of 0 for the marker is what they require anyway.
Diffstat (limited to 'player')
-rw-r--r--player/command.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c
index 124b029c3d..184d7d51d2 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1805,9 +1805,6 @@ static int mp_property_volume(void *ctx, struct m_property *prop,
.max = opts->softvol_max,
};
return M_PROPERTY_OK;
- case M_PROPERTY_GET_NEUTRAL:
- *(float *)arg = 100;
- return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
*(char **)arg = talloc_asprintf(NULL, "%i", (int)opts->softvol_volume);
return M_PROPERTY_OK;
@@ -4301,6 +4298,8 @@ static const struct property_osd_display {
int osd_progbar;
// Needs special ways to display the new value (seeks are delayed)
int seek_msg, seek_bar;
+ // Show a marker thing on OSD bar. Ignored if osd_progbar==0.
+ float marker;
// Free-form message (if NULL, osd_name or the property name is used)
const char *msg;
} property_osd_display[] = {
@@ -4315,10 +4314,10 @@ static const struct property_osd_display {
// audio
{ "volume", "Volume",
.msg = "Volume: ${?volume:${volume}% ${?mute==yes:(Muted)}}${!volume:${volume}}",
- .osd_progbar = OSD_VOLUME },
+ .osd_progbar = OSD_VOLUME, .marker = 100 },
{ "ao-volume", "AO Volume",
.msg = "AO Volume: ${?ao-volume:${ao-volume}% ${?ao-mute==yes:(Muted)}}${!ao-volume:${ao-volume}}",
- .osd_progbar = OSD_VOLUME },
+ .osd_progbar = OSD_VOLUME, .marker = 100 },
{ "mute", "Mute" },
{ "ao-mute", "AO Mute" },
{ "audio-delay", "A-V delay" },
@@ -4416,13 +4415,15 @@ static void show_property_osd(MPContext *mpctx, const char *name, int osd_mode)
if ((osd_mode & MP_ON_OSD_BAR) && (prop.flags & CONF_RANGE) == CONF_RANGE) {
if (prop.type == CONF_TYPE_INT) {
int n = prop.min;
- mp_property_do(name, M_PROPERTY_GET_NEUTRAL, &n, mpctx);
+ if (disp.osd_progbar)
+ n = disp.marker;
int i;
if (mp_property_do(name, M_PROPERTY_GET, &i, mpctx) > 0)
set_osd_bar(mpctx, disp.osd_progbar, prop.min, prop.max, n, i);
} else if (prop.type == CONF_TYPE_FLOAT) {
float n = prop.min;
- mp_property_do(name, M_PROPERTY_GET_NEUTRAL, &n, mpctx);
+ if (disp.osd_progbar)
+ n = disp.marker;
float f;
if (mp_property_do(name, M_PROPERTY_GET, &f, mpctx) > 0)
set_osd_bar(mpctx, disp.osd_progbar, prop.min, prop.max, n, f);