[vlc-commits] win32: add audio events for updating audio button/slider

Daniel Amm git at videolan.org
Thu Dec 17 23:59:33 CET 2015


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Wed Dec 16 19:59:03 2015 +0100| [569f19c379f61e6cf24b8118cdd9bcb5f1e3e8ad] | committer: Jean-Baptiste Kempf

win32: add audio events for updating audio button/slider

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> https://code.videolan.org/videolan/npapi-vlc/commit/569f19c379f61e6cf24b8118cdd9bcb5f1e3e8ad
---

 common/win32_fullscreen.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 2f276be..2018516 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -423,6 +423,20 @@ void VLCControlsWnd::RegisterToVLCEvents()
         PostMessage(hPlayPauseButton, BM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM) RC().hPlayBitmap);
         PostMessage(hVideoPosScroll, (UINT) PBM_SETPOS, (WPARAM)0, 0);
     });
+
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 2, 0)
+    VP()->get_mp().eventManager().onAudioVolume([this](float vol) {
+        UpdateVolumeSlider( roundf(vol * 100) );
+    });
+
+    VP()->get_mp().eventManager().onMuted([this] {
+        UpdateMuteButton(true);
+    });
+
+    VP()->get_mp().eventManager().onUnmuted([this] {
+        UpdateMuteButton(false);
+    });
+#endif
 }
 
 void VLCControlsWnd::NeedShowControls()



More information about the vlc-commits mailing list