mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlaying.dll: Fixed minor SetVolume inaccuracy with Winamp
This commit is contained in:
parent
c5fcaf193a
commit
0d9cfdcadb
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "StdAfx.h"
|
#include "StdAfx.h"
|
||||||
|
#include <cmath>
|
||||||
#include "PlayerWinamp.h"
|
#include "PlayerWinamp.h"
|
||||||
#include "Winamp/wa_ipc.h"
|
#include "Winamp/wa_ipc.h"
|
||||||
#include "Winamp/wa_cmd.h"
|
#include "Winamp/wa_cmd.h"
|
||||||
@ -413,12 +414,9 @@ void CPlayerWinamp::SetRating(int rating)
|
|||||||
*/
|
*/
|
||||||
void CPlayerWinamp::SetVolume(int volume)
|
void CPlayerWinamp::SetVolume(int volume)
|
||||||
{
|
{
|
||||||
if (volume > 0 && volume < 100) ++volume; // For proper scaling
|
|
||||||
|
|
||||||
// Winamp accepts volume in 0 - 255 range
|
// Winamp accepts volume in 0 - 255 range
|
||||||
volume *= 255;
|
float fVolume = volume * 2.55f;
|
||||||
volume /= 100;
|
SendMessage(m_Window, WM_WA_IPC, (WPARAM)ceil(fVolume), IPC_SETVOLUME);
|
||||||
SendMessage(m_Window, WM_WA_IPC, volume, IPC_SETVOLUME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user