Files
o3de/Gems/EMotionFX/Code/Include/Integration/AnimAudioComponentBus.h
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

80 lines
3.6 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/Component/ComponentBus.h>
#include <IAudioSystem.h>
namespace EMotionFX
{
namespace Integration
{
/**
* EMotionFX Anim Audio Component Request Bus
* Used for making requests to the EMotionFX Anim Audio Components.
*/
class AnimAudioComponentRequests
: public AZ::ComponentBus
{
public:
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
/// Adds audio support to when an anim event is fired
virtual void AddTriggerEvent(const AZStd::string& eventName, const AZStd::string& triggerName, const AZStd::string& jointName) = 0;
/// Clears all audio support for anim events
virtual void ClearTriggerEvents() = 0;
/// Removes audio support from an anim event
virtual void RemoveTriggerEvent(const AZStd::string& eventName) = 0;
/// Execute a single ATL source trigger on a joint proxy.
virtual bool ExecuteSourceTrigger(
const Audio::TAudioControlID triggerID,
const Audio::SAudioCallBackInfos& callbackInfo,
const Audio::TAudioControlID& sourceId,
const AZStd::string& jointName) = 0;
/// Execute a single ATL trigger on a joint proxy.
virtual bool ExecuteTrigger(
const Audio::TAudioControlID triggerID,
const Audio::SAudioCallBackInfos& callbackInfo,
const AZStd::string& jointName) = 0;
/// 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.
virtual void KillTrigger(const Audio::TAudioControlID triggerID, const AZStd::string* jointName = nullptr) = 0;
virtual void KillAllTriggers(const AZStd::string* jointName = nullptr) = 0;
/// Set an Rtpc on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
virtual void SetRtpcValue(const Audio::TAudioControlID rtpcID, float value, const AZStd::string* jointName = nullptr) = 0;
/// Set a Switch State on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
virtual void SetSwitchState(const Audio::TAudioControlID switchID, const Audio::TAudioSwitchStateID stateID, const AZStd::string* jointName = nullptr) = 0;
/// Set an Environment amount on a joint proxy. If a joint name is provided, only set on provided joint. Otherwise, set on all joints.
virtual void SetEnvironmentAmount(const Audio::TAudioEnvironmentID environmentID, float amount, const AZStd::string* jointName = nullptr) = 0;
};
using AnimAudioComponentRequestBus = AZ::EBus<AnimAudioComponentRequests>;
class AnimAudioComponentNotifications
: public AZ::ComponentBus
{
public:
virtual void OnTriggerStarted(const Audio::TAudioControlID triggerID) = 0;
virtual void OnTriggerFinished(const Audio::TAudioControlID triggerID) = 0;
};
using AnimAudioComponentNotificationBus = AZ::EBus<AnimAudioComponentNotifications>;
} // namespace Integration
} // namespace EMotionFX