1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00
Beef/BeefySysLib/platform/win/DSoundManager.h
Brian Fiete b63a243fd7 Working on installer, fixing more Win32 issues
Throwing error on member references with ".." cascade token outside invocations (ie: "ts..mA = 123")
Fixed 'Thread.ModuleTLSIndex' error - which caused us TLS lookup failures in Beef DLLs
Fixed some hotswap errors
Made BeefPerf shut down properly
Fixed an 'int literal' FixIntUnknown issue where rhs was System.Object which caused an illegal boxing
Fixed COFF::LocateSymbol issues with Win32 and also with linking to static libraries - showed up with hot-linking in fmod when hot-adding a floating point mod
Fixed a couple memory leaks
Fixed alignment issue in COFF::ParseCompileUnit
2019-09-02 17:39:47 -07:00

68 lines
No EOL
1.9 KiB
C++

#ifndef __DSOUNDMANAGER_H__
#define __DSOUNDMANAGER_H__
#include <dsound.h>
#include "BFSound.h"
namespace Beefy
{
class DSoundInstance;
class DSoundManager : public BFSoundManager
{
friend class DSoundInstance;
friend class DSoundMusicInterface;
protected:
LPDIRECTSOUNDBUFFER mSourceSounds[MAX_SOURCE_SOUNDS];
String mSourceFileNames[MAX_SOURCE_SOUNDS];
LPDIRECTSOUNDBUFFER mPrimaryBuffer;
int32 mSourceDataSizes[MAX_SOURCE_SOUNDS];
float mBaseVolumes[MAX_SOURCE_SOUNDS];
int mBasePans[MAX_SOURCE_SOUNDS];
DSoundInstance* mPlayingSounds[MAX_CHANNELS];
float mMasterVolume;
DWORD mLastReleaseTick;
protected:
int FindFreeChannel();
int VolumeToDB(float theVolume);
bool LoadWAVSound(unsigned int theSfxID, const StringImpl& theFilename);
void ReleaseFreeChannels();
public:
LPDIRECTSOUND mDirectSound;
DSoundManager(HWND theHWnd);
virtual ~DSoundManager();
virtual bool Initialized() override;
virtual bool LoadSound(unsigned int theSfxID, const StringImpl& theFilename) override;
virtual int LoadSound(const StringImpl& theFilename) override;
virtual void ReleaseSound(unsigned int theSfxID) override;
virtual void SetVolume(float theVolume) override;
virtual bool SetBaseVolume(unsigned int theSfxID, float theBaseVolume) override;
virtual bool SetBasePan(unsigned int theSfxID, int theBasePan) override;
virtual BFSoundInstance* GetSoundInstance(unsigned int theSfxID);
virtual void ReleaseSounds() override;
virtual void ReleaseChannels() override;
virtual float GetMasterVolume() override;
virtual void SetMasterVolume(float theVolume) override;
virtual void Flush() override;
virtual void SetCooperativeWindow(HWND theHWnd, bool isWindowed);
virtual void StopAllSounds() override;
virtual int GetFreeSoundId() override;
virtual int GetNumSounds() override;
};
}
#endif //__DSOUNDMANAGER_H__