From 0d9cfdcadb792e4643bda11b32eb25962d36e8c8 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 1 Jan 2012 18:07:24 +0000 Subject: [PATCH] NowPlaying.dll: Fixed minor SetVolume inaccuracy with Winamp --- Plugins/PluginNowPlaying/PlayerWinamp.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Plugins/PluginNowPlaying/PlayerWinamp.cpp b/Plugins/PluginNowPlaying/PlayerWinamp.cpp index 1b6746eb..34200ab7 100644 --- a/Plugins/PluginNowPlaying/PlayerWinamp.cpp +++ b/Plugins/PluginNowPlaying/PlayerWinamp.cpp @@ -17,6 +17,7 @@ */ #include "StdAfx.h" +#include #include "PlayerWinamp.h" #include "Winamp/wa_ipc.h" #include "Winamp/wa_cmd.h" @@ -413,12 +414,9 @@ void CPlayerWinamp::SetRating(int rating) */ void CPlayerWinamp::SetVolume(int volume) { - if (volume > 0 && volume < 100) ++volume; // For proper scaling - // Winamp accepts volume in 0 - 255 range - volume *= 255; - volume /= 100; - SendMessage(m_Window, WM_WA_IPC, volume, IPC_SETVOLUME); + float fVolume = volume * 2.55f; + SendMessage(m_Window, WM_WA_IPC, (WPARAM)ceil(fVolume), IPC_SETVOLUME); } /*