[banshee] OSX: Fix volume reset between playback (bgo#681639)



commit 9d6789e2ba5c8ef4b3145cbd92d0db5470ce3fbe
Author: Timo DÃrr <timo latecrew de>
Date:   Fri Aug 17 10:31:39 2012 +0200

    OSX: Fix volume reset between playback (bgo#681639)
    
    With the Gstreamer osxaudio sink, there is no hardware-backed mixer
    implementation, so the pipeline uses a soft volume mixer which resets to
    1.0 every time an uri is changed in the playbin2 object.
    
    The fix updates the volume from the volume button widget back to
    the gstreamer backend pipeline upon each stream start, to keep a
    consistent volume level between track changes.
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../Banshee.Gui.Widgets/ConnectedVolumeButton.cs   |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
index c68edb5..bd51764 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/ConnectedVolumeButton.cs
@@ -56,6 +56,15 @@ namespace Banshee.Gui.Widgets
 
             player.ConnectEvent (OnPlayerEvent, PlayerEvent.Volume);
 
+            // On OS X we have no hardware mixer but use a software volume mixer in
+            // the gstreamer pipeline which resets the volume to 1.0 (max) upon each
+            // uri/track change, so we have to set the volume from the widget
+            if (Hyena.PlatformDetection.IsMac) {
+                player.ConnectEvent ((args) => {
+                    ServiceManager.PlayerEngine.Volume = (ushort)Value;
+                }, PlayerEvent.StartOfStream);
+            }
+
             this.ValueChanged += (o, args) => {
                 ServiceManager.PlayerEngine.Volume = (ushort)Value;
             };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]