mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-18 11:42:36 +00:00
Move mixer construction to AudioCommon.cpp.
This commit is contained in:
parent
aac4206664
commit
102ea55f20
@ -26,8 +26,13 @@ SoundStream *soundStream = nullptr;
|
|||||||
|
|
||||||
namespace AudioCommon
|
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
|
// TODO: possible memleak with mixer
|
||||||
|
|
||||||
std::string backend = SConfig::GetInstance().sBackend;
|
std::string backend = SConfig::GetInstance().sBackend;
|
||||||
|
@ -14,7 +14,7 @@ extern SoundStream *soundStream;
|
|||||||
|
|
||||||
namespace AudioCommon
|
namespace AudioCommon
|
||||||
{
|
{
|
||||||
SoundStream *InitSoundStream(CMixer *mixer, void *hWnd);
|
SoundStream *InitSoundStream(void *hWnd);
|
||||||
void ShutdownSoundStream();
|
void ShutdownSoundStream();
|
||||||
std::vector<std::string> GetSoundBackends();
|
std::vector<std::string> GetSoundBackends();
|
||||||
bool UseJIT();
|
bool UseJIT();
|
||||||
|
@ -262,10 +262,7 @@ void DSPHLE::DSP_WriteMailBoxLow(bool _CPUMailbox, unsigned short _Value)
|
|||||||
|
|
||||||
void DSPHLE::InitMixer()
|
void DSPHLE::InitMixer()
|
||||||
{
|
{
|
||||||
unsigned int AISampleRate, DACSampleRate;
|
soundStream = AudioCommon::InitSoundStream(m_hWnd);
|
||||||
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
|
|
||||||
delete soundStream;
|
|
||||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
|
|
||||||
if (!soundStream) PanicAlert("Error starting up sound stream");
|
if (!soundStream) PanicAlert("Error starting up sound stream");
|
||||||
// Mixer is initialized
|
// Mixer is initialized
|
||||||
m_InitMixer = true;
|
m_InitMixer = true;
|
||||||
|
@ -181,10 +181,7 @@ void DSPLLE::Shutdown()
|
|||||||
|
|
||||||
void DSPLLE::InitMixer()
|
void DSPLLE::InitMixer()
|
||||||
{
|
{
|
||||||
unsigned int AISampleRate, DACSampleRate;
|
soundStream = AudioCommon::InitSoundStream(m_hWnd);
|
||||||
AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate);
|
|
||||||
delete soundStream;
|
|
||||||
soundStream = AudioCommon::InitSoundStream(new CMixer(AISampleRate, DACSampleRate, 48000), m_hWnd);
|
|
||||||
if (!soundStream) PanicAlert("Error starting up sound stream");
|
if (!soundStream) PanicAlert("Error starting up sound stream");
|
||||||
// Mixer is initialized
|
// Mixer is initialized
|
||||||
m_InitMixer = true;
|
m_InitMixer = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user