Files
o3de/Gems/EMotionFX/Code/Include/Integration/AnimAudioComponentBus.h
T
2021-03-08 14:30:57 -08:00

84 lines
3.9 KiB
C++

/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#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