Oh right, this complained...
This commit is contained in:
@@ -26,33 +26,35 @@
|
|||||||
* @endcond
|
* @endcond
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "linden_common.h"
|
||||||
|
|
||||||
#include "volume_catcher.h"
|
#include "volume_catcher.h"
|
||||||
#include <windows.h>
|
|
||||||
#include "llsingleton.h"
|
#include "llsingleton.h"
|
||||||
|
|
||||||
|
#include "llwin32headers.h"
|
||||||
|
#include <mmsystem.h>
|
||||||
|
|
||||||
class VolumeCatcherImpl : public LLSingleton<VolumeCatcherImpl>
|
class VolumeCatcherImpl : public LLSingleton<VolumeCatcherImpl>
|
||||||
{
|
{
|
||||||
friend LLSingleton<VolumeCatcherImpl>;
|
friend LLSingleton<VolumeCatcherImpl>;
|
||||||
|
VolumeCatcherImpl();
|
||||||
|
// This is a singleton class -- both callers and the component implementation should use getInstance() to find the instance.
|
||||||
|
~VolumeCatcherImpl();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void setVolume(F32 volume);
|
void setVolume(F32 volume);
|
||||||
void setPan(F32 pan);
|
void setPan(F32 pan);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This is a singleton class -- both callers and the component implementation should use getInstance() to find the instance.
|
|
||||||
VolumeCatcherImpl();
|
|
||||||
~VolumeCatcherImpl();
|
|
||||||
|
|
||||||
F32 mVolume;
|
F32 mVolume;
|
||||||
F32 mPan;
|
F32 mPan;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VolumeCatcherImpl::VolumeCatcherImpl()
|
VolumeCatcherImpl::VolumeCatcherImpl()
|
||||||
: mVolume(1.0f), // default volume is max
|
: mVolume(1.0f), // default volume is max
|
||||||
mPan(0.f) // default pan is centered
|
mPan(0.f) // default pan is centered
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VolumeCatcherImpl::~VolumeCatcherImpl()
|
VolumeCatcherImpl::~VolumeCatcherImpl()
|
||||||
@@ -68,7 +70,7 @@ void VolumeCatcherImpl::setVolume(F32 volume)
|
|||||||
DWORD left_channel = (DWORD)(mVolume * 65535.0f);
|
DWORD left_channel = (DWORD)(mVolume * 65535.0f);
|
||||||
DWORD right_channel = (DWORD)(mVolume * 65535.0f);
|
DWORD right_channel = (DWORD)(mVolume * 65535.0f);
|
||||||
DWORD hw_volume = left_channel << 16 | right_channel;
|
DWORD hw_volume = left_channel << 16 | right_channel;
|
||||||
::waveOutSetVolume(NULL, hw_volume);
|
waveOutSetVolume(NULL, hw_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VolumeCatcherImpl::setPan(F32 pan)
|
void VolumeCatcherImpl::setPan(F32 pan)
|
||||||
|
|||||||
Reference in New Issue
Block a user