Spinning Topp Logo BlackTopp Studios
inc
effectshandler.h
1 // © Copyright 2010 - 2016 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 _audioeffectshandler_h
44 #define _audioeffectshandler_h
45 
46 #include "Audio/effect.h"
47 #include "Audio/filter.h"
48 #include "Audio/effectparameters.h"
49 
50 namespace Mezzanine
51 {
52  namespace Audio
53  {
54  ///////////////////////////////////////////////////////////////////////////////
55  /// @brief This is an interface class for the creation, destruction, and overall management of audio effects.
56  /// @details
57  ///////////////////////////////////////
59  {
60  public:
61  /// @brief Class constructor.
63  /// @brief Class destructor.
64  virtual ~iEffectsHandler() { }
65 
66  ///////////////////////////////////////////////////////////////////////////////
67  // Utility
68 
69  ///////////////////////////////////////////////////////////////////////////////
70  // Effect Handling
71 
72  /// @brief Checks to see if the given effect type is supported.
73  /// @param Type The effect type to be checked.
74  /// @return Returns true if the effect is supported, false if the effect isn't supported.
75  virtual Boole IsEffectSupported(const EffectType Type) const = 0;
76  /// @brief Creates an Audio Effect for use with Audio::Sound instances.
77  /// @return Returns a pointer to the created Effect, or NULL if there was an error.
78  virtual iEffect* CreateEffect() = 0;
79  /// @brief Gets an Audio::iEffect instance by index.
80  /// @param Index The index of the Audio::iEffect instance to retrieve.
81  /// @return Returns a pointer to the Audio::iEffect at the specified index.
82  virtual iEffect* GetEffect(const UInt32 Index) const = 0;
83  /// @brief Gets the number of Audio::iEffect instances being stored by this handler.
84  /// @return Returns a UInt32 representing the number of Audio::iEffect instances contained in this handler.
85  virtual UInt32 GetNumEffects() const = 0;
86  /// @brief Destroys a single Audio::iEffect instance.
87  /// @param ToBeDestroyed A pointer to the Audio::iEffect to be destroyed.
88  virtual void DestroyEffect(iEffect* ToBeDestroyed) = 0;
89  /// @brief Destroys all Audio::iEffect instances being stored by this handler.
90  virtual void DestroyAllEffects() = 0;
91 
92  ///////////////////////////////////////////////////////////////////////////////
93  // Filter Handling
94 
95  /// @brief Checks to see if the given filter type is supported.
96  /// @param Type The filter type to be checked.
97  /// @return Returns true if the filter is supported, false if the filter isn't supported.
98  virtual Boole IsFilterSupported(const FilterType Type) const = 0;
99  /// @brief Creates an Audio Filter for use with @ref iSound instances.
100  /// @return Returns a pointer to the created Filter, or NULL if there was an error.
101  virtual iFilter* CreateFilter() = 0;
102  /// @brief Gets an @ref Audio::iFilter instance by index.
103  /// @param Index The index of the Audio::iFilter instance to retrieve.
104  /// @return Returns a pointer to the @ref Audio::iFilter at the specified index.
105  virtual iFilter* GetFilter(const UInt32 Index) const = 0;
106  /// @brief Gets the number of @ref iFilter instances being stored by this handler.
107  /// @return Returns a UInt32 representing the number of @ref iFilter instances contained in this handler.
108  virtual UInt32 GetNumFilters() const = 0;
109  /// @brief Destroys a single @ref iFilter instance.
110  /// @param ToBeDestroyed A pointer to the @ref iFilter to be destroyed.
111  virtual void DestroyFilter(iFilter* ToBeDestroyed) = 0;
112  /// @brief Destroys all @ref iFilter instances being stored by this handler.
113  virtual void DestroyAllFilters() = 0;
114 
115  ///////////////////////////////////////////////////////////////////////////////
116  // Preset Handling
117 
118  /// @brief Gets whether or not an effect preset exists within this handler.
119  /// @param Type The effect type to be checked.
120  /// @param Name The name of the preset to check for.
121  /// @return True if it exists, false if not.
122  virtual Boole EffectPresetExists(const EffectType Type, const String& Name) = 0;
123  /// @brief Removes a previously registered effect preset.
124  /// @param Type The type of effect to remove.
125  /// @param Name The name of the preset to remove.
126  virtual void RemoveEffectPreset(const EffectType Type, const String& Name) = 0;
127  /// @brief Removes all effect presets for a specific effect type.
128  /// @param Type The type of effect to remove presets for, or ET_Null to remove all of them.
129  virtual void RemoveAllEffectPresets(const EffectType Type) = 0;
130 
131  ///////////////////////////////////////////////////////////////////////////////
132  // Individual effect type settings
133 
134  /// @brief Adds a preset for the EAX Reverb Audio Effect type.
135  /// @param Name The name to be given to the preset.
136  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
137  virtual void AddEAXReverbEffectPreset(const String& Name, const EAXReverbParameters& Setting) = 0;
138  /// @brief Returns a previously registered preset for the EAX Reverb Effect.
139  /// @param Name The name of the preset to retrieve.
140  /// @return Returns the specified preset or the default parameters if the preset could not be found.
141  virtual EAXReverbParameters GetEAXReverbEffectPreset(const String& Name) const = 0;
142 
143  /// @brief Adds a preset for the Reverb Audio Effect type.
144  /// @param Name The name to be given to the preset.
145  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
146  virtual void AddReverbEffectPreset(const String& Name, const ReverbParameters& Setting) = 0;
147  /// @brief Returns a previously registered preset for the Reverb Effect.
148  /// @param Name The name of the preset to retrieve.
149  /// @return Returns the specified preset or the default parameters if the preset could not be found.
150  virtual ReverbParameters GetReverbEffectPreset(const String& Name) const = 0;
151 
152  /// @brief Adds a preset for the Chorus Audio Effect type.
153  /// @param Name The name to be given to the preset.
154  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
155  virtual void AddChorusEffectPreset(const String& Name, const ChorusParameters& Setting) = 0;
156  /// @brief Returns a previously registered preset for the Chorus Effect.
157  /// @param Name The name of the preset to retrieve.
158  /// @return Returns the specified preset or the default parameters if the preset could not be found.
159  virtual ChorusParameters GetChorusEffectPreset(const String& Name) const = 0;
160 
161  /// @brief Adds a preset for the Distortion Audio Effect type.
162  /// @param Name The name to be given to the preset.
163  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
164  virtual void AddDistortionEffectPreset(const String& Name, const DistortionParameters& Setting) = 0;
165  /// @brief Returns a previously registered preset for the Distortion Effect.
166  /// @param Name The name of the preset to retrieve.
167  /// @return Returns the specified preset or the default parameters if the preset could not be found.
168  virtual DistortionParameters GetDistortionEffectPreset(const String& Name) const = 0;
169 
170  /// @brief Adds a preset for the Echo Audio Effect type.
171  /// @param Name The name to be given to the preset.
172  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
173  virtual void AddEchoEffectPreset(const String& Name, const EchoParameters& Setting) = 0;
174  /// @brief Returns a previously registered preset for the Echo Effect.
175  /// @param Name The name of the preset to retrieve.
176  /// @return Returns the specified preset or the default parameters if the preset could not be found.
177  virtual EchoParameters GetEchoEffectPreset(const String& Name) const = 0;
178 
179  /// @brief Adds a preset for the Flanger Audio Effect type.
180  /// @param Name The name to be given to the preset.
181  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
182  virtual void AddFlangerEffectPreset(const String& Name, const FlangerParameters& Setting) = 0;
183  /// @brief Returns a previously registered preset for the Flanger Effect.
184  /// @param Name The name of the preset to retrieve.
185  /// @return Returns the specified preset or the default parameters if the preset could not be found.
186  virtual FlangerParameters GetFlangerEffectPreset(const String& Name) const = 0;
187 
188  /// @brief Adds a preset for the Frequency Shift Audio Effect type.
189  /// @param Name The name to be given to the preset.
190  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
191  virtual void AddFrequencyShiftEffectPreset(const String& Name, const FrequencyShiftParameters& Setting) = 0;
192  /// @brief Returns a previously registered preset for the Frequency Shift Effect.
193  /// @param Name The name of the preset to retrieve.
194  /// @return Returns the specified preset or the default parameters if the preset could not be found.
195  virtual FrequencyShiftParameters GetFrequencyShiftEffectPreset(const String& Name) const = 0;
196 
197  /// @brief Adds a preset for the Vocal Morpher Audio Effect type.
198  /// @param Name The name to be given to the preset.
199  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
200  virtual void AddVocalMorpherEffectPreset(const String& Name, const VocalMorpherParameters& Setting) = 0;
201  /// @brief Returns a previously registered preset for the Vocal Morpher Effect.
202  /// @param Name The name of the preset to retrieve.
203  /// @return Returns the specified preset or the default parameters if the preset could not be found.
204  virtual VocalMorpherParameters GetVocalMorpherEffectPreset(const String& Name) const = 0;
205 
206  /// @brief Adds a preset for the Pitch Shifter Audio Effect type.
207  /// @param Name The name to be given to the preset.
208  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
209  virtual void AddPitchShifterEffectPreset(const String& Name, const PitchShifterParameters& Setting) = 0;
210  /// @brief Returns a previously registered preset for the Pitch Shifter Effect.
211  /// @param Name The name of the preset to retrieve.
212  /// @return Returns the specified preset or the default parameters if the preset could not be found.
213  virtual PitchShifterParameters GetPitchShifterEffectPreset(const String& Name) const = 0;
214 
215  /// @brief Adds a preset for the Ring Modulator Audio Effect type.
216  /// @param Name The name to be given to the preset.
217  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
218  virtual void AddRingModulatorEffectPreset(const String& Name, const RingModulatorParameters& Setting) = 0;
219  /// @brief Returns a previously registered preset for the Ring Modulator Effect.
220  /// @param Name The name of the preset to retrieve.
221  /// @return Returns the specified preset or the default parameters if the preset could not be found.
222  virtual RingModulatorParameters GetRingModulatorEffectPreset(const String& Name) const = 0;
223 
224  /// @brief Adds a preset for the Autowah Audio Effect type.
225  /// @param Name The name to be given to the preset.
226  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
227  virtual void AddAutowahEffectPreset(const String& Name, const AutowahParameters& Setting) = 0;
228  /// @brief Returns a previously registered preset for the Autowah Effect.
229  /// @param Name The name of the preset to retrieve.
230  /// @return Returns the specified preset or the default parameters if the preset could not be found.
231  virtual AutowahParameters GetAutowahEffectPreset(const String& Name) const = 0;
232 
233  /// @brief Adds a preset for the Compressor Audio Effect type.
234  /// @param Name The name to be given to the preset.
235  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
236  virtual void AddCompressorEffectPreset(const String& Name, const CompressorParameters& Setting) = 0;
237  /// @brief Returns a previously registered preset for the Compressor Effect.
238  /// @param Name The name of the preset to retrieve.
239  /// @return Returns the specified preset or the default parameters if the preset could not be found.
240  virtual CompressorParameters GetCompressorEffectPreset(const String& Name) const = 0;
241 
242  /// @brief Adds a preset for the Equalizer Audio Effect type.
243  /// @param Name The name to be given to the preset.
244  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
245  virtual void AddEqualizerEffectPreset(const String& Name, const EqualizerParameters& Setting) = 0;
246  /// @brief Returns a previously registered preset for the Equalizer Effect.
247  /// @param Name The name of the preset to retrieve.
248  /// @return Returns the specified preset or the default parameters if the preset could not be found.
249  virtual EqualizerParameters GetEqualizerEffectPreset(const String& Name) const = 0;
250  };//iEffectsHandler
251  }//Audio
252 }//Mezzanine
253 
254 #endif
virtual ReverbParameters GetReverbEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Reverb Effect.
This is a struct containing all the parameters needed to describe a Reverb effect.
This is a struct containing all the parameters needed to describe an echo effect. ...
virtual void AddCompressorEffectPreset(const String &Name, const CompressorParameters &Setting)=0
Adds a preset for the Compressor Audio Effect type.
This is an interface class for the creation, destruction, and overall management of audio effects...
virtual iFilter * GetFilter(const UInt32 Index) const =0
Gets an Audio::iFilter instance by index.
This is a struct containing all the parameters needed to describe a vocal morpher effect...
virtual iFilter * CreateFilter()=0
Creates an Audio Filter for use with iSound instances.
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
virtual DistortionParameters GetDistortionEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Distortion Effect.
virtual void DestroyAllEffects()=0
Destroys all Audio::iEffect instances being stored by this handler.
FilterType
Used by the iFilter class to describe what type of filter it is.
This is a struct containing all the parameters needed to describe a pitch shift effect.
virtual EqualizerParameters GetEqualizerEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Equalizer Effect.
virtual void AddRingModulatorEffectPreset(const String &Name, const RingModulatorParameters &Setting)=0
Adds a preset for the Ring Modulator Audio Effect type.
EffectType
Used by the iEffect class to describe what type of effect it is.
This is a struct containing all the parameters needed to describe an flanger effect.
virtual ChorusParameters GetChorusEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Chorus Effect.
This is a struct containing all the parameters needed to describe a Distortion effect.
virtual void AddEAXReverbEffectPreset(const String &Name, const EAXReverbParameters &Setting)=0
Adds a preset for the EAX Reverb Audio Effect type.
virtual void DestroyAllFilters()=0
Destroys all iFilter instances being stored by this handler.
virtual UInt32 GetNumEffects() const =0
Gets the number of Audio::iEffect instances being stored by this handler.
This is an interface class for an effect that can be applied to a sound.
Definition: effect.h:58
This is a struct containing all the parameters needed to describe a frequency shift effect...
virtual EAXReverbParameters GetEAXReverbEffectPreset(const String &Name) const =0
Returns a previously registered preset for the EAX Reverb Effect.
virtual void RemoveAllEffectPresets(const EffectType Type)=0
Removes all effect presets for a specific effect type.
virtual FlangerParameters GetFlangerEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Flanger Effect.
virtual void AddChorusEffectPreset(const String &Name, const ChorusParameters &Setting)=0
Adds a preset for the Chorus Audio Effect type.
virtual UInt32 GetNumFilters() const =0
Gets the number of iFilter instances being stored by this handler.
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
virtual ~iEffectsHandler()
Class destructor.
virtual void DestroyFilter(iFilter *ToBeDestroyed)=0
Destroys a single iFilter instance.
virtual void AddPitchShifterEffectPreset(const String &Name, const PitchShifterParameters &Setting)=0
Adds a preset for the Pitch Shifter Audio Effect type.
virtual void AddReverbEffectPreset(const String &Name, const ReverbParameters &Setting)=0
Adds a preset for the Reverb Audio Effect type.
iEffectsHandler()
Class constructor.
This is a struct containing all the parameters needed to describe a compressor effect.
virtual Boole IsEffectSupported(const EffectType Type) const =0
Checks to see if the given effect type is supported.
virtual void AddEqualizerEffectPreset(const String &Name, const EqualizerParameters &Setting)=0
Adds a preset for the Equalizer Audio Effect type.
virtual void AddAutowahEffectPreset(const String &Name, const AutowahParameters &Setting)=0
Adds a preset for the Autowah Audio Effect type.
virtual VocalMorpherParameters GetVocalMorpherEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Vocal Morpher Effect.
This is a struct containing all the parameters needed to describe an EAX Reverb effect.
virtual Boole EffectPresetExists(const EffectType Type, const String &Name)=0
Gets whether or not an effect preset exists within this handler.
This is a struct containing all the parameters needed to describe an equalizer effect.
virtual AutowahParameters GetAutowahEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Autowah Effect.
virtual void DestroyEffect(iEffect *ToBeDestroyed)=0
Destroys a single Audio::iEffect instance.
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
virtual void AddDistortionEffectPreset(const String &Name, const DistortionParameters &Setting)=0
Adds a preset for the Distortion Audio Effect type.
virtual void AddVocalMorpherEffectPreset(const String &Name, const VocalMorpherParameters &Setting)=0
Adds a preset for the Vocal Morpher Audio Effect type.
This is a struct containing all the parameters needed to describe a Chorus effect.
virtual CompressorParameters GetCompressorEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Compressor Effect.
virtual iEffect * GetEffect(const UInt32 Index) const =0
Gets an Audio::iEffect instance by index.
This is an interface class for the application of filters to audio playback.
Definition: filter.h:57
virtual Boole IsFilterSupported(const FilterType Type) const =0
Checks to see if the given filter type is supported.
virtual PitchShifterParameters GetPitchShifterEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Pitch Shifter Effect.
virtual void RemoveEffectPreset(const EffectType Type, const String &Name)=0
Removes a previously registered effect preset.
virtual void AddFlangerEffectPreset(const String &Name, const FlangerParameters &Setting)=0
Adds a preset for the Flanger Audio Effect type.
virtual EchoParameters GetEchoEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Echo Effect.
This is a struct containing all the parameters needed to describe a ring modulation effect...
This is a struct containing all the parameters needed to describe an Auto-Wah effect.
virtual FrequencyShiftParameters GetFrequencyShiftEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Frequency Shift Effect.
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
virtual RingModulatorParameters GetRingModulatorEffectPreset(const String &Name) const =0
Returns a previously registered preset for the Ring Modulator Effect.
virtual void AddFrequencyShiftEffectPreset(const String &Name, const FrequencyShiftParameters &Setting)=0
Adds a preset for the Frequency Shift Audio Effect type.
virtual iEffect * CreateEffect()=0
Creates an Audio Effect for use with Audio::Sound instances.
virtual void AddEchoEffectPreset(const String &Name, const EchoParameters &Setting)=0
Adds a preset for the Echo Audio Effect type.