BsAudioClipImportOptions.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsImportOptions.h"
  6. #include "BsAudioClip.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Importer
  10. * @{
  11. */
  12. /** Contains import options you may use to control how an audio clip is imported. */
  13. class BS_CORE_EXPORT AudioClipImportOptions : public ImportOptions
  14. {
  15. public:
  16. AudioClipImportOptions();
  17. /** Returns the audio format to import the audio clip as. */
  18. AudioFormat getFormat() const { return mFormat; }
  19. /** Sets the audio format to import the audio clip as. */
  20. void setFormat(AudioFormat format) { mFormat = format; }
  21. /** Returns read mode that determines how is audio data loaded into memory. */
  22. AudioReadMode getReadMode() const { return mReadMode; }
  23. /** Sets read mode that determines how is audio data loaded into memory. */
  24. void setReadMode(AudioReadMode readMode) { mReadMode = readMode; }
  25. /** Checks should the clip be played as spatial (3D) audio or as normal audio. */
  26. bool getIs3D() const { return mIs3D; }
  27. /**
  28. * Sets whether the clip should be played as spatial (3D) audio or as normal audio. 3D clips will be converted
  29. * to mono on import.
  30. */
  31. void setIs3D(bool is3d) { mIs3D = is3d; }
  32. /** Returns the size of a single sample in bits. */
  33. UINT32 getBitDepth() const { return mBitDepth; }
  34. /** Sets the size of a single sample in bits. The clip will be converted to this bit depth on import. */
  35. void setBitDepth(UINT32 bitDepth) { mBitDepth = bitDepth; }
  36. // Note: Add options to resample to a different frequency
  37. private:
  38. AudioFormat mFormat;
  39. AudioReadMode mReadMode;
  40. bool mIs3D;
  41. UINT32 mBitDepth;
  42. /************************************************************************/
  43. /* SERIALIZATION */
  44. /************************************************************************/
  45. public:
  46. friend class AudioClipImportOptionsRTTI;
  47. static RTTITypeBase* getRTTIStatic();
  48. RTTITypeBase* getRTTI() const override;
  49. };
  50. /** @} */
  51. }