AnimAudioComponentBus.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 <AzCore/EBus/EBus.h>
  10. #include <AzCore/Component/ComponentBus.h>
  11. #include <IAudioSystem.h>
  12. namespace EMotionFX
  13. {
  14. namespace Integration
  15. {
  16. /**
  17. * EMotionFX Anim Audio Component Request Bus
  18. * Used for making requests to the EMotionFX Anim Audio Components.
  19. */
  20. class AnimAudioComponentRequests
  21. : public AZ::ComponentBus
  22. {
  23. public:
  24. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
  25. /// Adds audio support to when an anim event is fired
  26. virtual void AddTriggerEvent(const AZStd::string& eventName, const AZStd::string& triggerName, const AZStd::string& jointName) = 0;
  27. /// Clears all audio support for anim events
  28. virtual void ClearTriggerEvents() = 0;
  29. /// Removes audio support from an anim event
  30. virtual void RemoveTriggerEvent(const AZStd::string& eventName) = 0;
  31. /// Execute a single ATL source trigger on a joint proxy.
  32. virtual bool ExecuteSourceTrigger(
  33. const Audio::TAudioControlID triggerID,
  34. const Audio::TAudioControlID& sourceId,
  35. const AZStd::string& jointName) = 0;
  36. /// Execute a single ATL trigger on a joint proxy.
  37. virtual bool ExecuteTrigger(
  38. const Audio::TAudioControlID triggerID,
  39. const AZStd::string& jointName) = 0;
  40. /// Kill a single or all ATL triggers on a joint proxy. If a joint name is provided, only kill on provided joint. Otherwise, kill all joints' audio triggers.
  41. virtual void KillTrigger(const Audio::TAudioControlID triggerID, const AZStd::string* jointName = nullptr) = 0;
  42. virtual void KillAllTriggers(const AZStd::string* jointName = nullptr) = 0;
  43. /// Set an Rtpc on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
  44. virtual void SetRtpcValue(const Audio::TAudioControlID rtpcID, float value, const AZStd::string* jointName = nullptr) = 0;
  45. /// Set a Switch State on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
  46. virtual void SetSwitchState(const Audio::TAudioControlID switchID, const Audio::TAudioSwitchStateID stateID, const AZStd::string* jointName = nullptr) = 0;
  47. /// Set an Environment amount on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
  48. virtual void SetEnvironmentAmount(const Audio::TAudioEnvironmentID environmentID, float amount, const AZStd::string* jointName = nullptr) = 0;
  49. };
  50. using AnimAudioComponentRequestBus = AZ::EBus<AnimAudioComponentRequests>;
  51. } // namespace Integration
  52. } // namespace EMotionFX