MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
effect.h
1 // © Copyright 2010 - 2014 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 // Copyright (c) 2008-2010 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones
41 // This file is part of the "cAudio Engine"
42 // For conditions of distribution and use, see copyright notice in cAudio-ZLIBLicense.txt
43 #ifndef _audioeffect_h
44 #define _audioeffect_h
45 
46 #include "datatypes.h"
47 #include "Audio/effectparameters.h"
48 #include "Audio/filter.h"
49 
50 namespace Mezzanine
51 {
52  namespace Audio
53  {
54  ///////////////////////////////////////////////////////////////////////////////
55  /// @brief This is an interface class for an effect that can be applied to a sound.
56  /// @details
57  ///////////////////////////////////////
58  class iEffect
59  {
60  public:
61  /// @brief Class constructor.
62  iEffect() { }
63  /// @brief Class destructor.
64  virtual ~iEffect() { }
65 
66  ///////////////////////////////////////////////////////////////////////////////
67  // Utility
68 
69  /// @brief Gets whether or not this effect is ready for use.
70  /// @return Returns if this effect is ready to be used or if it has encountered a fatal error.
71  virtual bool IsValid() const = 0;
72 
73  /// @brief Sets the type of this effect.
74  /// @param EffType Type of effect to switch to.
75  virtual void SetType(const EffectType& EffType) = 0;
76  /// @brief Gets the type of effect this is.
77  /// @return Returns the current type this effect object is set to.
78  virtual EffectType GetType() const = 0;
79  /// @brief Attaches a filter to this effect.
80  /// @param Fil A Pointer to the filter to attach.
81  virtual void AttachFilter(iFilter* Fil) = 0;
82  /// @brief Gets the filter being used by this effect.
83  /// @return Returns the filter attached to this effect.
84  virtual iFilter* GetFilter() const = 0;
85  /// @brief Removes the currently attached filter.
86  virtual void RemoveFilter() = 0;
87 
88  /// @brief Sets the master volume for this effect.
89  /// @remarks This volume scales the amount of effect audible from all attached sources. @n @n 1.0f equal no volume change. Range: 0.0f to 1.0
90  /// @param Vol The volume to be set.
91  virtual void SetVolume(const Real Vol) = 0;
92  /// @brief Gets the volume for this effect.
93  /// @remarks This volume scales the amount of effect audible from all attached sources.
94  /// @return Returns a Real representing the currently set volume.
95  virtual Real GetVolume() const = 0;
96  /// @brief Sets whether the effect for each attached source is attenuated by distance.
97  /// @remarks If set to true, can cause some interesting and non-realistic effects, so be careful with it.
98  /// @param Ignore Whether or not to ignore attenuation.
99  virtual void IgnoreAttenuation(bool Ignore) = 0;
100  /// @brief Gets whether or not attached sources are attenuated by distance.
101  /// @return Returns true if the effect for each attached source is attenuated by distance.
102  virtual bool IsIgnoringAttenuation() const = 0;
103 
104  ///////////////////////////////////////////////////////////////////////////////
105  // Parameter Configuration
106 
107  /// @brief Sets the parameters for the EAX Reverb Effect.
108  /// @param Param Parameter struct populated with the settings for this effect.
109  virtual void SetEAXReverbParameters(const EAXReverbParameters& Param) = 0;
110  /// @brief Gets the current parameters for the EAX Reverb Effect.
111  /// @return Returns an EAXReverbParameters struct containing the currently set parameters.
112  virtual EAXReverbParameters GetEAXReverbParameters() const = 0;
113  /// @brief Sets the parameters for the Reverb Effect.
114  /// @param Param Parameter struct populated with the settings for this effect.
115  virtual void SetReverbParameters(const ReverbParameters& Param) = 0;
116  /// @brief Gets the current parameters for the Reverb Effect.
117  /// @return Returns an ReverbParameters struct containing the currently set parameters.
118  virtual ReverbParameters GetReverbParameters() const = 0;
119  /// @brief Sets the parameters for the Chorus Effect.
120  /// @param Param Parameter struct populated with the settings for this effect.
121  virtual void SetChorusParameters(const ChorusParameters& Param) = 0;
122  /// @brief Gets the current parameters for the Chorus Effect.
123  /// @return Returns an ChorusParameters struct containing the currently set parameters.
124  virtual ChorusParameters GetChorusParameters() const = 0;
125  /// @brief Sets the parameters for the Distortion Effect.
126  /// @param Param Parameter struct populated with the settings for this effect.
127  virtual void SetDistortionParameters(const DistortionParameters& Param) = 0;
128  /// @brief Gets the current parameters for the Distortion Effect.
129  /// @return Returns an DistortionParameters struct containing the currently set parameters.
130  virtual DistortionParameters GetDistortionParameters() const = 0;
131  /// @brief Sets the parameters for the Echo Effect.
132  /// @param Param Parameter struct populated with the settings for this effect.
133  virtual void SetEchoParameters(const EchoParameters& Param) = 0;
134  /// @brief Gets the current parameters for the Echo Effect.
135  /// @return Returns an EchoParameters struct containing the currently set parameters.
136  virtual EchoParameters GetEchoParameters() const = 0;
137  /// @brief Sets the parameters for the Flanger Effect.
138  /// @param Param Parameter struct populated with the settings for this effect.
139  virtual void SetFlangerParameters(const FlangerParameters& Param) = 0;
140  /// @brief Gets the current parameters for the Flanger Effect.
141  /// @return Returns an FlangerParameters struct containing the currently set parameters.
142  virtual FlangerParameters GetFlangerParameters() const = 0;
143  /// @brief Sets the parameters for the Frequency Shift Effect.
144  /// @param Param Parameter struct populated with the settings for this effect.
145  virtual void SetFrequencyShiftParameters(const FrequencyShiftParameters& Param) = 0;
146  /// @brief Gets the current parameters for the Frequency Shift Effect.
147  /// @return Returns an FrequencyShiftParameters struct containing the currently set parameters.
149  /// @brief Sets the parameters for the Vocal Morpher Effect.
150  /// @param Param Parameter struct populated with the settings for this effect.
151  virtual void SetVocalMorpherParameters(const VocalMorpherParameters& Param) = 0;
152  /// @brief Gets the current parameters for the Vocal Morpher Effect.
153  /// @return Returns an VocalMorpherParameters struct containing the currently set parameters.
155  /// @brief Sets the parameters for the Pitch Shifter Effect.
156  /// @param Param Parameter struct populated with the settings for this effect.
157  virtual void SetPitchShifterParameters(const PitchShifterParameters& Param) = 0;
158  /// @brief Gets the current parameters for the PitchShifter Effect.
159  /// @return Returns an PitchShifterParameters struct containing the currently set parameters.
161  /// @brief Sets the parameters for the Ring Modulator Effect.
162  /// @param Param Parameter struct populated with the settings for this effect.
163  virtual void SetRingModulatorParameters(const RingModulatorParameters& Param) = 0;
164  /// @brief Gets the current parameters for the Ring Modulator Effect.
165  /// @return Returns an RingModulatorParameters struct containing the currently set parameters.
167  /// @brief Sets the parameters for the Autowah Effect.
168  /// @param Param Parameter struct populated with the settings for this effect.
169  virtual void SetAutowahParameters(const AutowahParameters& Param) = 0;
170  /// @brief Gets the current parameters for the Autowah Effect.
171  /// @return Returns an AutowahParameters struct containing the currently set parameters.
172  virtual AutowahParameters GetAutowahParameters() const = 0;
173  /// @brief Sets the parameters for the Compressor Effect.
174  /// @param Param Parameter struct populated with the settings for this effect.
175  virtual void SetCompressorParameters(const CompressorParameters& Param) = 0;
176  /// @brief Gets the current parameters for the Compressor Effect.
177  /// @return Returns an CompressorParameters struct containing the currently set parameters.
178  virtual CompressorParameters GetCompressorParameters() const = 0;
179  /// @brief Sets the parameters for the Equalizer Effect.
180  /// @param Param Parameter struct populated with the settings for this effect.
181  virtual void SetEqualizerParameters(const EqualizerParameters& Param) = 0;
182  /// @brief Gets the current parameters for the Equalizer Effect.
183  /// @return Returns an EqualizerParameters struct containing the currently set parameters.
184  virtual EqualizerParameters GetEqualizerParameters() const = 0;
185  };//iEffect
186  }//Audio
187 }//Mezzanine
188 
189 #endif