ResampleReader.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*******************************************************************************
  2. * Copyright 2009-2016 Jörg Müller
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. ******************************************************************************/
  16. #pragma once
  17. /**
  18. * @file ResampleReader.h
  19. * @ingroup respec
  20. * The ResampleReader class.
  21. */
  22. #include "fx/EffectReader.h"
  23. AUD_NAMESPACE_BEGIN
  24. /**
  25. * This is the base class for all resampling readers.
  26. */
  27. class AUD_API ResampleReader : public EffectReader
  28. {
  29. protected:
  30. /**
  31. * The target sampling rate.
  32. */
  33. SampleRate m_rate;
  34. /**
  35. * Creates a resampling reader.
  36. * \param reader The reader to mix.
  37. * \param rate The target sampling rate.
  38. */
  39. ResampleReader(std::shared_ptr<IReader> reader, SampleRate rate);
  40. public:
  41. /**
  42. * Sets the sample rate.
  43. * \param rate The target sampling rate.
  44. */
  45. virtual void setRate(SampleRate rate);
  46. /**
  47. * Retrieves the sample rate.
  48. * \return The target sampling rate.
  49. */
  50. virtual SampleRate getRate();
  51. };
  52. AUD_NAMESPACE_END