BVB Source Codes

CRYENGINE Show MFXAudioEffect.h Source code

Return Download CRYENGINE: download MFXAudioEffect.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // ----------------------------------------------------------------------------------------
  4. //  File name:   MFXAudioEffect.h
  5. //  Description: MFX system subclass which takes care of interfacing with audio system
  6. //
  7. ////////////////////////////////////////////////////////////////////////////////////////////
  8.  
  9. #ifndef _MFX_AUDIO_H_
  10. #define _MFX_AUDIO_H_
  11.  
  12. #pragma once
  13.  
  14. #include "MFXEffectBase.h"
  15. #include <CryAudio/IAudioInterfacesCommonData.h>
  16.  
  17. struct SAudioTriggerWrapper
  18. {
  19.         SAudioTriggerWrapper()
  20.                 : m_triggerID(INVALID_AUDIO_CONTROL_ID)
  21.         {
  22.         }
  23.  
  24.         void           Init(const char* triggerName);
  25.  
  26.         AudioControlId GetTriggerId() const
  27.         {
  28.                 return m_triggerID;
  29.         }
  30.  
  31.         bool IsValid() const
  32.         {
  33.                 return (m_triggerID != INVALID_AUDIO_CONTROL_ID);
  34.         }
  35.  
  36.         const char* GetTriggerName() const
  37.         {
  38. #if defined(MATERIAL_EFFECTS_DEBUG)
  39.                 return m_triggerName.c_str();
  40. #else
  41.                 return "Trigger Unknown";
  42. #endif
  43.         }
  44.  
  45.         void GetMemoryUsage(ICrySizer* pSizer) const
  46.         {
  47. #if defined(MATERIAL_EFFECTS_DEBUG)
  48.                 pSizer->Add(m_triggerName);
  49. #endif
  50.         }
  51.  
  52. private:
  53.  
  54. #if defined(MATERIAL_EFFECTS_DEBUG)
  55.         string m_triggerName;
  56. #endif
  57.         AudioControlId m_triggerID;
  58. };
  59.  
  60. struct SAudioSwitchWrapper
  61. {
  62.         SAudioSwitchWrapper()
  63.                 : m_switchID(INVALID_AUDIO_CONTROL_ID)
  64.                 , m_switchStateID(INVALID_AUDIO_SWITCH_STATE_ID)
  65.         {
  66.         }
  67.  
  68.         void           Init(const char* switchName, const char* switchStateName);
  69.  
  70.         AudioControlId GetSwitchId() const
  71.         {
  72.                 return m_switchID;
  73.         }
  74.  
  75.         AudioSwitchStateId GetSwitchStateId() const
  76.         {
  77.                 return m_switchStateID;
  78.         }
  79.  
  80.         bool IsValid() const
  81.         {
  82.                 return (m_switchID != INVALID_AUDIO_CONTROL_ID) && (m_switchStateID != INVALID_AUDIO_SWITCH_STATE_ID);
  83.         }
  84.  
  85.         const char* GetSwitchName() const
  86.         {
  87. #if defined(MATERIAL_EFFECTS_DEBUG)
  88.                 return m_switchName.c_str();
  89. #else
  90.                 return "Switch Unknown";
  91. #endif
  92.         }
  93.  
  94.         const char* GetSwitchStateName() const
  95.         {
  96. #if defined(MATERIAL_EFFECTS_DEBUG)
  97.                 return m_switchStateName.c_str();
  98. #else
  99.                 return "Switch State Unknown";
  100. #endif
  101.         }
  102.  
  103.         void GetMemoryUsage(ICrySizer* pSizer) const
  104.         {
  105. #if defined(MATERIAL_EFFECTS_DEBUG)
  106.                 pSizer->Add(m_switchName);
  107.                 pSizer->Add(m_switchStateName);
  108. #endif
  109.         }
  110.  
  111. private:
  112. #if defined(MATERIAL_EFFECTS_DEBUG)
  113.         string m_switchName;
  114.         string m_switchStateName;
  115. #endif
  116.         AudioControlId m_switchID;
  117.         AudioSwitchStateId m_switchStateID;
  118. };
  119.  
  120. //////////////////////////////////////////////////////////////////////////
  121.  
  122. struct SMFXAudioEffectParams
  123. {
  124.         typedef std::vector<SAudioSwitchWrapper> TSwitches;
  125.  
  126.         void GetMemoryUsage(ICrySizer* pSizer) const
  127.         {
  128.                 pSizer->AddObject(&trigger);
  129.                 pSizer->Add(triggerSwitches);
  130.         }
  131.  
  132.         SAudioTriggerWrapper trigger;
  133.         TSwitches            triggerSwitches;
  134. };
  135.  
  136. class CMFXAudioEffect :
  137.         public CMFXEffectBase
  138. {
  139. public:
  140.         CMFXAudioEffect();
  141.  
  142.         // IMFXEffect
  143.         virtual void Execute(const SMFXRunTimeEffectParams& params) override;
  144.         virtual void LoadParamsFromXml(const XmlNodeRef& paramsNode) override;
  145.         virtual void GetResources(SMFXResourceList& resourceList) const override;
  146.         virtual void GetMemoryUsage(ICrySizer* pSizer) const override;
  147.         //~IMFXEffect
  148.  
  149. protected:
  150.  
  151.         SMFXAudioEffectParams m_audioParams;
  152. };
  153.  
  154. #endif // _MFX_AUDIO_H_
  155.  
downloadMFXAudioEffect.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top