[vlc-devel] [PATCH 3/6] win32: add audio events for updating audio button/slider

Daniel Amm da2424 at t-online.de
Tue Dec 15 22:15:34 CET 2015


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

diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 18768b3..b5f3251 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -414,6 +414,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(vol * 100 + 0.5); //+0.5 to prevent rounding imprecisions
+    });
+
+    VP()->get_mp().eventManager().onMuted([this] {
+        UpdateMuteButton(true);
+    });
+
+    VP()->get_mp().eventManager().onUnmuted([this] {
+        UpdateMuteButton(false);
+    });
+#endif
 }
 
 void VLCControlsWnd::NeedShowControls()
-- 
2.6.3.windows.1



More information about the vlc-devel mailing list