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

@ -143,9 +143,8 @@ bool XAudio2_7::InitLibrary()
return m_xaudio2_dll != nullptr;
}
XAudio2_7::XAudio2_7(CMixer *mixer)
: SoundStream(mixer)
, m_mastering_voice(nullptr)
XAudio2_7::XAudio2_7()
: m_mastering_voice(nullptr)
, m_volume(1.0f)
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
{
@ -185,7 +184,7 @@ bool XAudio2_7::Start()
m_mastering_voice->SetVolume(m_volume);
m_voice_context = std::unique_ptr<StreamingVoiceContext2_7>
(new StreamingVoiceContext2_7(m_xaudio2.get(), m_mixer, m_sound_sync_event));
(new StreamingVoiceContext2_7(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
return true;
}