diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2015-11-15 23:03:48 +0100 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2015-11-15 23:18:24 +0100 |
commit | bf0b178e71d76c839d6d17c42a83536e444ba31d (patch) | |
tree | de21f2f308d4f1c4558330d6fd9dbc9a9a325fa4 /player/misc.c | |
parent | 883d3114138a8f9a03f778165de553b7cdb99bee (diff) | |
download | mpv-bf0b178e71d76c839d6d17c42a83536e444ba31d.tar.bz2 mpv-bf0b178e71d76c839d6d17c42a83536e444ba31d.tar.xz |
win32: support taskbar button progress indicator
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
Diffstat (limited to 'player/misc.c')
-rw-r--r-- | player/misc.c | 20 |
1 files changed, 20 insertions, 0 deletions
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) { |