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/XAudio2Stream.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/XAudio2Stream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/XAudio2Stream.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/AudioCommon/XAudio2Stream.cpp b/Source/Core/AudioCommon/XAudio2Stream.cpp index b87a0e0a06..339bb96f94 100644 --- a/Source/Core/AudioCommon/XAudio2Stream.cpp +++ b/Source/Core/AudioCommon/XAudio2Stream.cpp @@ -169,7 +169,7 @@ XAudio2::~XAudio2() CoUninitialize(); } -bool XAudio2::Start() +bool XAudio2::Init() { HRESULT hr; @@ -210,15 +210,17 @@ void XAudio2::SetVolume(int volume) m_mastering_voice->SetVolume(m_volume); } -void XAudio2::SetRunning(bool running) +bool XAudio2::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::Stop() |
