Mesen/Windows/SoundManager.h

32 lines
627 B
C
Raw Normal View History

#pragma once
#include "stdafx.h"
#include "../Core/APU.h"
class SoundManager : public IAudioDevice
{
public:
2014-06-23 23:02:09 +00:00
SoundManager(HWND hWnd);
~SoundManager();
void Release();
void PlayBuffer(int16_t *soundBuffer, uint32_t bufferSize);
void Play();
void Pause();
void Reset();
private:
bool InitializeDirectSound(HWND);
void ShutdownDirectSound();
void ClearSecondaryBuffer();
void CopyToSecondaryBuffer(uint8_t *data, uint32_t size);
private:
uint16_t _lastWriteOffset = 0;
2015-07-18 00:58:57 +00:00
uint16_t _previousLatency = 0;
IDirectSound8* _directSound;
IDirectSoundBuffer* _primaryBuffer;
IDirectSoundBuffer8* _secondaryBuffer;
};