VISR  0.11.1
Versatile Interactive Scene Renderer
gain_fader.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_LIBRBBL_GAIN_FADER_HPP_INCLUDED
4 #define VISR_LIBRBBL_GAIN_FADER_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
7 
10 
11 namespace visr
12 {
13 namespace rbbl
14 {
15 
22 template< typename ElementType >
23 class VISR_RBBL_LIBRARY_SYMBOL GainFader
24 {
25 public:
33  explicit GainFader( std::size_t blockSize,
34  std::size_t interpolationSteps,
35  std::size_t alignment = 0 );
36 
40  ~GainFader();
41 
45  std::size_t interpolationSamples() const;
46 
51  std::size_t interpolationPeriods() const;
52 
65  void scale( ElementType const * input, ElementType * output,
66  ElementType startGain,
67  ElementType endGain,
68  std::size_t blockIndex ) const;
69 
82  void scaleAndAccumulate( ElementType const * input, ElementType * outputAcc,
83  ElementType startGain,
84  ElementType endGain,
85  std::size_t blockIndex ) const;
86 
87 
88 private:
89 
99  void setupRamp( std::size_t blockSize,
100  std::size_t interpolationSteps );
101 
105  std::size_t const mBlockSize;
106 
111  std::size_t const mInterpolationSamples;
112 
117  std::size_t const mInterpolationPeriods;
118 
125  efl::AlignedArray< ElementType > mInterpolationRamp;
126 
131  mutable efl::AlignedArray< ElementType > mTempBuffer;
132 
133 };
134 
135 } // namespace rbbl
136 } // namespace visr
137 
138 #endif // #ifndef VISR_LIBRBBL_GAIN_FADER_HPP_INCLUDED
Definition: options.cpp:10
Definition: gain_fader.hpp:23
Definition: aligned_array.hpp:33