AkDelayLineMemoryStream.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*******************************************************************************
  2. The content of this file includes portions of the AUDIOKINETIC Wwise Technology
  3. released in source code form as part of the SDK installer package.
  4. Commercial License Usage
  5. Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
  6. may use this file in accordance with the end user license agreement provided
  7. with the software or, alternatively, in accordance with the terms contained in a
  8. written agreement between you and Audiokinetic Inc.
  9. Apache License Usage
  10. Alternatively, this file may be used under the Apache License, Version 2.0 (the
  11. "Apache License"); you may not use this file except in compliance with the
  12. Apache License. You may obtain a copy of the Apache License at
  13. http://www.apache.org/licenses/LICENSE-2.0.
  14. Unless required by applicable law or agreed to in writing, software distributed
  15. under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
  16. OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
  17. the specific language governing permissions and limitations under the License.
  18. Copyright (c) 2023 Audiokinetic Inc.
  19. *******************************************************************************/
  20. // Length of delay line is mapped on 4 frames boundary (i.e. may not be suited for reverberation for example)
  21. // Handling code for triple buffering processing on position independent code platforms is provided
  22. // This is not a delay line implementation, but rather just some services for memory managment related
  23. // to specific delay line execution needs as detailed by clients
  24. #ifndef _AKDSP_DELAYLINEMEMORYSTREAM_
  25. #define _AKDSP_DELAYLINEMEMORYSTREAM_
  26. #include <AK/DSP/AkDelayLineMemory.h>
  27. namespace AK
  28. {
  29. namespace DSP
  30. {
  31. template < class T_SAMPLETYPE, AkUInt32 T_MAXNUMCHANNELS >
  32. class CAkDelayLineMemoryStream : public CAkDelayLineMemory< T_SAMPLETYPE, T_MAXNUMCHANNELS >
  33. {
  34. public:
  35. T_SAMPLETYPE * GetCurrentPointer( AkUInt32 in_uOffset, AkUInt32 in_uChannelIndex )
  36. {
  37. return this->m_pDelay[in_uChannelIndex] + in_uOffset;
  38. }
  39. protected:
  40. T_SAMPLETYPE * m_pfSreamedData[3];
  41. AkUInt32 m_uStreamIndex;
  42. AkUInt32 m_uMaxStreamBufferLength;
  43. };
  44. } // namespace DSP
  45. } // namespace AK
  46. #endif // _AKDSP_DELAYLINEMEMORYSTREAM_