Loading Kits/DirectXTK/Audio/AudioEngine.cpp +541 −544 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: AudioEngine.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -247,7 +244,7 @@ static_assert( _countof(gReverbPresets) == Reverb_MAX, "AUDIO_ENGINE_REVERB enum class AudioEngine::Impl { public: Impl() : Impl() throw() : mMasterVoice(nullptr), mReverbVoice(nullptr), masterChannelMask(0), Loading Loading @@ -1243,7 +1240,7 @@ void AudioEngine::Impl::UnregisterNotify( _In_ IVoiceNotify* notify, bool usesOn // Public constructor. _Use_decl_annotations_ AudioEngine::AudioEngine(AUDIO_ENGINE_FLAGS flags, const WAVEFORMATEX* wfx, const wchar_t* deviceId, AUDIO_STREAM_CATEGORY category) : pImpl(new Impl() ) : pImpl(std::make_unique<Impl>()) { HRESULT hr = pImpl->Initialize(flags, wfx, deviceId, category); if (FAILED(hr)) Loading @@ -1270,14 +1267,14 @@ AudioEngine::AudioEngine( AUDIO_ENGINE_FLAGS flags, const WAVEFORMATEX* wfx, con // Move constructor. AudioEngine::AudioEngine(AudioEngine&& moveFrom) AudioEngine::AudioEngine(AudioEngine&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. AudioEngine& AudioEngine::operator= (AudioEngine&& moveFrom) AudioEngine& AudioEngine::operator= (AudioEngine&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading Kits/DirectXTK/Audio/DynamicSoundEffectInstance.cpp +104 −107 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: DynamicSoundEffectInstance.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -234,20 +231,20 @@ _Use_decl_annotations_ DynamicSoundEffectInstance::DynamicSoundEffectInstance(AudioEngine* engine, std::function<void(DynamicSoundEffectInstance*)> bufferNeeded, int sampleRate, int channels, int sampleBits, SOUND_EFFECT_INSTANCE_FLAGS flags) : pImpl( new Impl( engine, this, bufferNeeded, sampleRate, channels, sampleBits, flags ) ) pImpl(std::make_unique<Impl>(engine, this, bufferNeeded, sampleRate, channels, sampleBits, flags)) { } // Move constructor. DynamicSoundEffectInstance::DynamicSoundEffectInstance(DynamicSoundEffectInstance&& moveFrom) DynamicSoundEffectInstance::DynamicSoundEffectInstance(DynamicSoundEffectInstance&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. DynamicSoundEffectInstance& DynamicSoundEffectInstance::operator= (DynamicSoundEffectInstance&& moveFrom) DynamicSoundEffectInstance& DynamicSoundEffectInstance::operator= (DynamicSoundEffectInstance&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading Loading @@ -338,7 +335,7 @@ size_t DynamicSoundEffectInstance::GetSampleDuration( size_t bytes ) const return 0; return static_cast<size_t>((uint64_t(bytes) * 8) / uint64_t( wfx->wBitsPerSample * wfx->nChannels ) ); / (uint64_t(wfx->wBitsPerSample) * uint64_t(wfx->nChannels))); } Loading Kits/DirectXTK/Audio/SoundCommon.cpp +414 −417 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundCommon.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Kits/DirectXTK/Audio/SoundCommon.h +113 −116 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundCommon.h // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #pragma once Loading Loading @@ -72,7 +69,7 @@ namespace DirectX class SoundEffectInstanceBase { public: SoundEffectInstanceBase() : SoundEffectInstanceBase() throw() : voice(nullptr), state(STOPPED), engine(nullptr), Loading Kits/DirectXTK/Audio/SoundEffect.cpp +239 −242 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundEffect.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -357,7 +354,7 @@ void SoundEffect::Impl::Play( float volume, float pitch, float pan ) // Public constructors. _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, const wchar_t* waveFileName) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { WAVData wavInfo; std::unique_ptr<uint8_t[]> wavData; Loading Loading @@ -388,7 +385,7 @@ SoundEffect::SoundEffect( AudioEngine* engine, const wchar_t* waveFileName ) _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavData, const WAVEFORMATEX* wfx, const uint8_t* startAudio, size_t audioBytes) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { #if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10) HRESULT hr = pImpl->Initialize(engine, wavData, wfx, startAudio, audioBytes, nullptr, 0, 0, 0); Loading @@ -407,7 +404,7 @@ _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavData, const WAVEFORMATEX* wfx, const uint8_t* startAudio, size_t audioBytes, uint32_t loopStart, uint32_t loopLength) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { #if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10) HRESULT hr = pImpl->Initialize(engine, wavData, wfx, startAudio, audioBytes, nullptr, 0, loopStart, loopLength); Loading Loading @@ -441,14 +438,14 @@ SoundEffect::SoundEffect( AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavDa // Move constructor. SoundEffect::SoundEffect(SoundEffect&& moveFrom) SoundEffect::SoundEffect(SoundEffect&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. SoundEffect& SoundEffect::operator= (SoundEffect&& moveFrom) SoundEffect& SoundEffect::operator= (SoundEffect&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading Loading @@ -522,7 +519,7 @@ size_t SoundEffect::GetSampleDuration() const if (partial) { if (partial >= (7 * adpcmFmt->wfx.nChannels)) duration += ( partial * 2 / adpcmFmt->wfx.nChannels - 12 ); duration += (uint64_t(partial) * 2 / uint64_t(adpcmFmt->wfx.nChannels - 12)); } return static_cast<size_t>(duration); } Loading Loading @@ -550,7 +547,7 @@ size_t SoundEffect::GetSampleDuration() const if (pImpl->mWaveFormat->wBitsPerSample > 0) { return static_cast<size_t>((uint64_t(pImpl->mAudioBytes) * 8) / uint64_t( pImpl->mWaveFormat->wBitsPerSample * pImpl->mWaveFormat->nChannels ) ); / (uint64_t(pImpl->mWaveFormat->wBitsPerSample) * uint64_t(pImpl->mWaveFormat->nChannels))); } } Loading Loading
Kits/DirectXTK/Audio/AudioEngine.cpp +541 −544 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: AudioEngine.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -247,7 +244,7 @@ static_assert( _countof(gReverbPresets) == Reverb_MAX, "AUDIO_ENGINE_REVERB enum class AudioEngine::Impl { public: Impl() : Impl() throw() : mMasterVoice(nullptr), mReverbVoice(nullptr), masterChannelMask(0), Loading Loading @@ -1243,7 +1240,7 @@ void AudioEngine::Impl::UnregisterNotify( _In_ IVoiceNotify* notify, bool usesOn // Public constructor. _Use_decl_annotations_ AudioEngine::AudioEngine(AUDIO_ENGINE_FLAGS flags, const WAVEFORMATEX* wfx, const wchar_t* deviceId, AUDIO_STREAM_CATEGORY category) : pImpl(new Impl() ) : pImpl(std::make_unique<Impl>()) { HRESULT hr = pImpl->Initialize(flags, wfx, deviceId, category); if (FAILED(hr)) Loading @@ -1270,14 +1267,14 @@ AudioEngine::AudioEngine( AUDIO_ENGINE_FLAGS flags, const WAVEFORMATEX* wfx, con // Move constructor. AudioEngine::AudioEngine(AudioEngine&& moveFrom) AudioEngine::AudioEngine(AudioEngine&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. AudioEngine& AudioEngine::operator= (AudioEngine&& moveFrom) AudioEngine& AudioEngine::operator= (AudioEngine&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading
Kits/DirectXTK/Audio/DynamicSoundEffectInstance.cpp +104 −107 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: DynamicSoundEffectInstance.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -234,20 +231,20 @@ _Use_decl_annotations_ DynamicSoundEffectInstance::DynamicSoundEffectInstance(AudioEngine* engine, std::function<void(DynamicSoundEffectInstance*)> bufferNeeded, int sampleRate, int channels, int sampleBits, SOUND_EFFECT_INSTANCE_FLAGS flags) : pImpl( new Impl( engine, this, bufferNeeded, sampleRate, channels, sampleBits, flags ) ) pImpl(std::make_unique<Impl>(engine, this, bufferNeeded, sampleRate, channels, sampleBits, flags)) { } // Move constructor. DynamicSoundEffectInstance::DynamicSoundEffectInstance(DynamicSoundEffectInstance&& moveFrom) DynamicSoundEffectInstance::DynamicSoundEffectInstance(DynamicSoundEffectInstance&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. DynamicSoundEffectInstance& DynamicSoundEffectInstance::operator= (DynamicSoundEffectInstance&& moveFrom) DynamicSoundEffectInstance& DynamicSoundEffectInstance::operator= (DynamicSoundEffectInstance&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading Loading @@ -338,7 +335,7 @@ size_t DynamicSoundEffectInstance::GetSampleDuration( size_t bytes ) const return 0; return static_cast<size_t>((uint64_t(bytes) * 8) / uint64_t( wfx->wBitsPerSample * wfx->nChannels ) ); / (uint64_t(wfx->wBitsPerSample) * uint64_t(wfx->nChannels))); } Loading
Kits/DirectXTK/Audio/SoundCommon.cpp +414 −417 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundCommon.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading
Kits/DirectXTK/Audio/SoundCommon.h +113 −116 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundCommon.h // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #pragma once Loading Loading @@ -72,7 +69,7 @@ namespace DirectX class SoundEffectInstanceBase { public: SoundEffectInstanceBase() : SoundEffectInstanceBase() throw() : voice(nullptr), state(STOPPED), engine(nullptr), Loading
Kits/DirectXTK/Audio/SoundEffect.cpp +239 −242 Original line number Diff line number Diff line //-------------------------------------------------------------------------------------- // File: SoundEffect.cpp // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkId=248929 // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "pch.h" Loading Loading @@ -357,7 +354,7 @@ void SoundEffect::Impl::Play( float volume, float pitch, float pan ) // Public constructors. _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, const wchar_t* waveFileName) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { WAVData wavInfo; std::unique_ptr<uint8_t[]> wavData; Loading Loading @@ -388,7 +385,7 @@ SoundEffect::SoundEffect( AudioEngine* engine, const wchar_t* waveFileName ) _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavData, const WAVEFORMATEX* wfx, const uint8_t* startAudio, size_t audioBytes) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { #if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10) HRESULT hr = pImpl->Initialize(engine, wavData, wfx, startAudio, audioBytes, nullptr, 0, 0, 0); Loading @@ -407,7 +404,7 @@ _Use_decl_annotations_ SoundEffect::SoundEffect(AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavData, const WAVEFORMATEX* wfx, const uint8_t* startAudio, size_t audioBytes, uint32_t loopStart, uint32_t loopLength) : pImpl(new Impl(engine) ) : pImpl(std::make_unique<Impl>(engine)) { #if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10) HRESULT hr = pImpl->Initialize(engine, wavData, wfx, startAudio, audioBytes, nullptr, 0, loopStart, loopLength); Loading Loading @@ -441,14 +438,14 @@ SoundEffect::SoundEffect( AudioEngine* engine, std::unique_ptr<uint8_t[]>& wavDa // Move constructor. SoundEffect::SoundEffect(SoundEffect&& moveFrom) SoundEffect::SoundEffect(SoundEffect&& moveFrom) throw() : pImpl(std::move(moveFrom.pImpl)) { } // Move assignment. SoundEffect& SoundEffect::operator= (SoundEffect&& moveFrom) SoundEffect& SoundEffect::operator= (SoundEffect&& moveFrom) throw() { pImpl = std::move(moveFrom.pImpl); return *this; Loading Loading @@ -522,7 +519,7 @@ size_t SoundEffect::GetSampleDuration() const if (partial) { if (partial >= (7 * adpcmFmt->wfx.nChannels)) duration += ( partial * 2 / adpcmFmt->wfx.nChannels - 12 ); duration += (uint64_t(partial) * 2 / uint64_t(adpcmFmt->wfx.nChannels - 12)); } return static_cast<size_t>(duration); } Loading Loading @@ -550,7 +547,7 @@ size_t SoundEffect::GetSampleDuration() const if (pImpl->mWaveFormat->wBitsPerSample > 0) { return static_cast<size_t>((uint64_t(pImpl->mAudioBytes) * 8) / uint64_t( pImpl->mWaveFormat->wBitsPerSample * pImpl->mWaveFormat->nChannels ) ); / (uint64_t(pImpl->mWaveFormat->wBitsPerSample) * uint64_t(pImpl->mWaveFormat->nChannels))); } } Loading