SpecsChanger.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 SpecsChanger.h
  19. * @ingroup respec
  20. * The SpecsChanger class.
  21. */
  22. #include "ISound.h"
  23. #include "respec/Specification.h"
  24. AUD_NAMESPACE_BEGIN
  25. /**
  26. * This sound is a base class for all mixer factories.
  27. */
  28. class AUD_API SpecsChanger : public ISound
  29. {
  30. protected:
  31. /**
  32. * The target specification for resampling.
  33. */
  34. const DeviceSpecs m_specs;
  35. /**
  36. * If there is no reader it is created out of this sound.
  37. */
  38. std::shared_ptr<ISound> m_sound;
  39. /**
  40. * Returns the reader created out of the sound.
  41. * This method can be used for the createReader function of the implementing
  42. * classes.
  43. * \return The reader to mix.
  44. */
  45. std::shared_ptr<IReader> getReader() const;
  46. public:
  47. /**
  48. * Creates a new sound.
  49. * \param sound The sound to create the readers to mix out of.
  50. * \param specs The target specification.
  51. */
  52. SpecsChanger(std::shared_ptr<ISound> sound, DeviceSpecs specs);
  53. /**
  54. * Returns the target specification for resampling.
  55. */
  56. DeviceSpecs getSpecs() const;
  57. /**
  58. * Returns the saved sound.
  59. * \return The sound.
  60. */
  61. std::shared_ptr<ISound> getSound() const;
  62. };
  63. AUD_NAMESPACE_END