diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2018-01-02 09:58:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-02 09:58:36 +0100 |
| commit | cb168b184386f169aeb828f660ac63c5bc3e540c (patch) | |
| tree | a7e89360ae75653e46536bd77d9fd27bd44774c1 /Source/Core/AudioCommon/XAudio2_7Stream.cpp | |
| parent | 26a9957285aac023ee7d35cf506b82381575df9a (diff) | |
| parent | a988a8a4587bf18d8ad8dba36653b803e3a583b4 (diff) | |
Merge pull request #6134 from ligfx/soundstreamlifecycle
SoundStream: change Start/Stop lifecycle to Init/SetRunning/destruct
Diffstat (limited to 'Source/Core/AudioCommon/XAudio2_7Stream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/XAudio2_7Stream.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/AudioCommon/XAudio2_7Stream.cpp b/Source/Core/AudioCommon/XAudio2_7Stream.cpp index bff7c7dfa1..0e596e3255 100644 --- a/Source/Core/AudioCommon/XAudio2_7Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2_7Stream.cpp @@ -157,7 +157,7 @@ XAudio2_7::~XAudio2_7() CoUninitialize(); } -bool XAudio2_7::Start() +bool XAudio2_7::Init() { HRESULT hr; @@ -198,15 +198,17 @@ void XAudio2_7::SetVolume(int volume) m_mastering_voice->SetVolume(m_volume); } -void XAudio2_7::SetRunning(bool running) +bool XAudio2_7::SetRunning(bool running) { - if (m_voice_context) - { - if (running) - m_voice_context->Play(); - else - m_voice_context->Stop(); - } + if (!m_voice_context) + return false; + + if (running) + m_voice_context->Play(); + else + m_voice_context->Stop(); + + return true; } void XAudio2_7::Stop() |
