SoundStream: Internally construct the mixer

Instead of creating the mixer externally and then passing it in, it can just be made within the class.
This commit is contained in:
Lioncash
2015-05-24 04:13:02 -04:00
parent a6e5fd1e27
commit 35ee8a1362
18 changed files with 40 additions and 123 deletions

View File

@ -155,9 +155,8 @@ bool XAudio2::InitLibrary()
return true;
}
XAudio2::XAudio2(CMixer *mixer)
: SoundStream(mixer)
, m_mastering_voice(nullptr)
XAudio2::XAudio2()
: m_mastering_voice(nullptr)
, m_volume(1.0f)
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
{
@ -197,7 +196,7 @@ bool XAudio2::Start()
m_mastering_voice->SetVolume(m_volume);
m_voice_context = std::unique_ptr<StreamingVoiceContext>
(new StreamingVoiceContext(m_xaudio2.get(), m_mixer, m_sound_sync_event));
(new StreamingVoiceContext(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
return true;
}