From bf0b178e71d76c839d6d17c42a83536e444ba31d Mon Sep 17 00:00:00 2001 From: Martin Herkt Date: Sun, 15 Nov 2015 23:03:48 +0100 Subject: win32: support taskbar button progress indicator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds support for the progress indicator taskbar extension that was introduced with Windows 7 and Windows Server 2008 R2. I don’t like this solution because it keeps its own state and introduces another VOCTRL, but I couldn’t come up with anything less messy. closes #2399 --- player/misc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'player/misc.c') diff --git a/player/misc.c b/player/misc.c index add73e5a17..1e67adbe32 100644 --- a/player/misc.c +++ b/player/misc.c @@ -153,6 +153,26 @@ bool mp_get_cache_idle(struct MPContext *mpctx) return idle; } +void update_vo_playback_state(struct MPContext *mpctx) +{ + if (mpctx->video_out) { + struct voctrl_playback_state oldstate = mpctx->vo_playback_state; + struct voctrl_playback_state newstate = { + .paused = mpctx->paused, + .percent_pos = get_percent_pos(mpctx), + }; + + if (oldstate.paused != newstate.paused || + oldstate.percent_pos != newstate.percent_pos) { + vo_control(mpctx->video_out, + VOCTRL_UPDATE_PLAYBACK_STATE, &newstate); + mpctx->vo_playback_state = newstate; + } + } else { + mpctx->vo_playback_state = (struct voctrl_playback_state){ 0 }; + } +} + void update_window_title(struct MPContext *mpctx, bool force) { if (!mpctx->video_out && !mpctx->ao) { -- cgit v1.2.3