From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Audio/AudioDistortionFilter.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Runtime/Audio/AudioDistortionFilter.h (limited to 'Runtime/Audio/AudioDistortionFilter.h') diff --git a/Runtime/Audio/AudioDistortionFilter.h b/Runtime/Audio/AudioDistortionFilter.h new file mode 100644 index 0000000..1bc86ce --- /dev/null +++ b/Runtime/Audio/AudioDistortionFilter.h @@ -0,0 +1,26 @@ +#ifndef __AUDIODISTORTION_FILTER_H__ +#define __AUDIODISTORTION_FILTER_H__ + +#if ENABLE_AUDIO_FMOD +#include "AudioSourceFilter.h" + +class AudioDistortionFilter : public AudioFilter { +public: + REGISTER_DERIVED_CLASS (AudioDistortionFilter, AudioFilter) + DECLARE_OBJECT_SERIALIZE (AudioDistortionFilter) + AudioDistortionFilter (MemLabelId label, ObjectCreationMode mode); + + virtual void CheckConsistency (); + virtual void Update(); + virtual void AddToManager(); + virtual void Reset(); + + float GetDistortionLevel() const { return m_DistortionLevel; } + void SetDistortionLevel(const float distortionLevel) { m_DistortionLevel = distortionLevel; Update(); SetDirty(); } + +private: + float m_DistortionLevel; // Distortion value. 0.0 to 1.0. Default = 0.5. +}; + +#endif // ENABLE_AUDIO +#endif // AUDIODISTORTION -- cgit v1.1-26-g67d0