BsAudioClipImportOptions.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 "Importer/BsImportOptions.h"
  6. #include "Audio/BsAudioClip.h"
  7. namespace bs
  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. /** Creates a new import options object that allows you to customize how are audio clips imported. */
  38. static SPtr<AudioClipImportOptions> create();
  39. private:
  40. AudioFormat mFormat;
  41. AudioReadMode mReadMode;
  42. bool mIs3D;
  43. UINT32 mBitDepth;
  44. /************************************************************************/
  45. /* SERIALIZATION */
  46. /************************************************************************/
  47. public:
  48. friend class AudioClipImportOptionsRTTI;
  49. static RTTITypeBase* getRTTIStatic();
  50. RTTITypeBase* getRTTI() const override;
  51. };
  52. /** @} */
  53. }