SoundTrack.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include "AnimTrack.h"
  10. struct SSoundInfo
  11. {
  12. void Reset()
  13. {
  14. nSoundKeyStart = -1;
  15. nSoundKeyStop = -1;
  16. }
  17. int nSoundKeyStart = -1;
  18. int nSoundKeyStop = -1;
  19. };
  20. class CSoundTrack
  21. : public TAnimTrack<ISoundKey>
  22. {
  23. public:
  24. AZ_CLASS_ALLOCATOR(CSoundTrack, AZ::SystemAllocator);
  25. AZ_RTTI(CSoundTrack, "{B87D8805-F583-4154-B554-45518BC487F4}", IAnimTrack);
  26. void GetKeyInfo(int key, const char*& description, float& duration) override;
  27. void SerializeKey(ISoundKey& key, XmlNodeRef& keyNode, bool bLoading) override;
  28. //! Check if track is masked
  29. bool IsMasked(const uint32 mask) const override { return (mask & eTrackMask_MaskSound) != 0; }
  30. bool UsesMute() const override { return true; }
  31. static void Reflect(AZ::ReflectContext* context);
  32. };