ISound.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 ISound.h
  19. * @ingroup general
  20. * The ISound interface.
  21. */
  22. #include "Audaspace.h"
  23. #include <memory>
  24. AUD_NAMESPACE_BEGIN
  25. class IReader;
  26. /**
  27. * @interface ISound
  28. * This class represents a type of sound source and saves the necessary values
  29. * for it. It is able to create a reader that is actually usable for playback
  30. * of the respective sound source through the factory method createReader.
  31. */
  32. class AUD_API ISound
  33. {
  34. public:
  35. /**
  36. * Destroys the sound.
  37. */
  38. virtual ~ISound() {}
  39. /**
  40. * Creates a reader for playback of the sound source.
  41. * \return A pointer to an IReader object or nullptr if there has been an
  42. * error.
  43. * \exception Exception An exception may be thrown if there has been
  44. * a more unexpected error during reader creation.
  45. */
  46. virtual std::shared_ptr<IReader> createReader()=0;
  47. };
  48. AUD_NAMESPACE_END