/* * 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. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. #ifndef CRYINCLUDE_CRYSCRIPTSYSTEM_SCRIPTBINDINGS_SCRIPTBIND_SOUND_H #define CRYINCLUDE_CRYSCRIPTSYSTEM_SCRIPTBINDINGS_SCRIPTBIND_SOUND_H #pragma once #include #include /*! These function will never be called from C-Code. They're script-exclusive.*/ class CScriptBind_Sound : public CScriptableBase { public: CScriptBind_Sound(IScriptSystem* pScriptSystem, ISystem* pSystem); virtual ~CScriptBind_Sound(); virtual void GetMemoryUsage(ICrySizer* pSizer) const { pSizer->AddObject(this, sizeof(*this)); } //! Sound.GetAudioTriggerID(char const* const sTriggerName) //! Get the trigger TAudioControlID (wrapped into a ScriptHandle). //! unique name of an audio trigger //! ScriptHandle with the TAudioControlID value, or nil if the sTriggerName is not found. int GetAudioTriggerID(IFunctionHandler* pH, const char* const sTriggerName); //! Sound.GetAudioSwitchID(char const* const sSwitchName) //! Get the switch TAudioControlID (wrapped into a ScriptHandle). //! unique name of an audio switch //! ScriptHandle with the TAudioControlID value, or nil if the sSwitchName is not found. int GetAudioSwitchID(IFunctionHandler* pH, const char* const sSwitchName); //! Sound.GetAudioSwitchStateID(ScriptHandle const hSwitchID, char const* const sSwitchStateName) //! Get the SwitchState TAudioSwitchStatelID (wrapped into a ScriptHandle). //! unique name of an audio switch state //! ScriptHandle with the TAudioSwitchStateID value, or nil if the sSwitchStateName is not found. int GetAudioSwitchStateID(IFunctionHandler* pH, const ScriptHandle hSwitchID, const char* const sSwitchStateName); //! Sound.GetAudioRtpcID(char const* const sRtpcName) //! Get the RTPC TAudioControlID (wrapped into a ScriptHandle). //! unique name of an audio RTPC //! ScriptHandle with the TAudioControlID value, or nil if the sRtpcName is not found. int GetAudioRtpcID(IFunctionHandler* pH, const char* const sRtpcName); //! Sound.GetAudioEnvironmentID(char const* const sEnvironmentName) //! Get the Audio Environment TAudioEnvironmentID (wrapped into a ScriptHandle). //! unique name of an Audio Environment //! ScriptHandle with the TAudioEnvironmentID value, or nil if the sEnvironmentName is not found. int GetAudioEnvironmentID(IFunctionHandler* pH, const char* const sEnvironmentName); // ly-todo: update these docs to match others in this file // // Syntax: Sound.ExecuteGlobalAudioTrigger(AudioUtils.LookupTriggerID("Play_sound"), false) // Description: // Executes a global audio trigger without needing an entity // Arguments: // hTriggerID - unique name of an Audio Trigger // bStop - stop the audio trigger or don't stop audio trigger // Return: // nothing int ExecuteGlobalAudioTrigger(IFunctionHandler* pH, const ScriptHandle hTriggerID, bool bStop); private: Audio::SAudioRequest m_oRequest; Audio::SAudioObjectRequestData<Audio::eAORT_EXECUTE_TRIGGER> m_oExecuteRequestData; Audio::SAudioObjectRequestData<Audio::eAORT_STOP_TRIGGER> m_oStopRequestData; }; #endif // CRYINCLUDE_CRYSCRIPTSYSTEM_SCRIPTBINDINGS_SCRIPTBIND_SOUND_H