BsAudioClipImportOptions.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. /** Returns the audio format to import the audio clip as. */
  17. AudioFormat getFormat() const { return mFormat; }
  18. /** Sets the audio format to import the audio clip as. */
  19. void setFormat(AudioFormat format) { mFormat = format; }
  20. /** Returns read mode that determines how is audio data loaded into memory. */
  21. AudioReadMode getReadMode() const { return mReadMode; }
  22. /** Sets read mode that determines how is audio data loaded into memory. */
  23. void setReadMode(AudioReadMode readMode) { mReadMode = readMode; }
  24. /** Checks should the clip be played as spatial (3D) audio or as normal audio. */
  25. bool getIs3D() const { return mIs3D; }
  26. /**
  27. * Sets whether the clip should be played as spatial (3D) audio or as normal audio. 3D clips will be converted
  28. * to mono on import.
  29. */
  30. void setIs3D(bool is3d) { mIs3D = is3d; }
  31. /** Returns the size of a single sample in bits. */
  32. UINT32 getBitDepth() const { return mBitDepth; }
  33. /** Sets the size of a single sample in bits. The clip will be converted to this bit depth on import. */
  34. void setBitDepth(UINT32 bitDepth) { mBitDepth = bitDepth; }
  35. // Note: Add options to resample to a different frequency
  36. private:
  37. AudioFormat mFormat = AudioFormat::PCM;
  38. AudioReadMode mReadMode = AudioReadMode::LoadDecompressed;
  39. bool mIs3D = true;
  40. UINT32 mBitDepth = 16;
  41. /************************************************************************/
  42. /* SERIALIZATION */
  43. /************************************************************************/
  44. public:
  45. friend class AudioClipImportOptionsRTTI;
  46. static RTTITypeBase* getRTTIStatic();
  47. RTTITypeBase* getRTTI() const override;
  48. };
  49. /** @} */
  50. }