Move mixer construction to AudioCommon.cpp.

This commit is contained in:
magumagu 2014-03-27 16:00:14 -07:00
parent aac4206664
commit 102ea55f20
4 changed files with 9 additions and 10 deletions

View File

@ -26,8 +26,13 @@ SoundStream *soundStream = nullptr;
namespace AudioCommon
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd)
SoundStream *InitSoundStream(void *hWnd)
{
unsigned int AISampleRate, DACSampleRate;
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
delete soundStream;
CMixer *mixer = new CMixer(AISampleRate, DACSampleRate, 48000);
// TODO: possible memleak with mixer
std::string backend = SConfig::GetInstance().sBackend;

View File

@ -14,7 +14,7 @@ extern SoundStream *soundStream;
namespace AudioCommon
{
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);
SoundStream *InitSoundStream(void *hWnd);
void ShutdownSoundStream();
std::vector<std::string> GetSoundBackends();
bool UseJIT();

View File

@ -262,10 +262,7 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value)
void DSPHLE::InitMixer()
{
unsigned int AISampleRate, DACSampleRate;
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
delete soundStream;
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
soundStream = AudioCommon::InitSoundStream(m_hWnd);
if (!soundStream) PanicAlert("Error starting up sound stream");
// Mixer is initialized
m_InitMixer = true;

View File

@ -181,10 +181,7 @@ void DSPLLE::Shutdown()
void DSPLLE::InitMixer()
{
unsigned int AISampleRate, DACSampleRate;
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
delete soundStream;
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
soundStream = AudioCommon::InitSoundStream(m_hWnd);
if (!soundStream) PanicAlert("Error starting up sound stream");
// Mixer is initialized
m_InitMixer = true;