MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
effectshandler.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 _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 bool 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  /// @return Returns a pointer to the Audio::iEffect at the specified index.
81  virtual iEffect* GetEffect(const UInt32 Index) const = 0;
82  /// @brief Gets the number of Audio::iEffect instances being stored by this handler.
83  /// @return Returns a UInt32 representing the number of Audio::iEffect instances contained in this handler.
84  virtual UInt32 GetNumEffects() const = 0;
85  /// @brief Destroys a single Audio::iEffect instance.
86  /// @param ToBeDestroyed A pointer to the Audio::iEffect to be destroyed.
87  virtual void DestroyEffect(iEffect* ToBeDestroyed) = 0;
88  /// @brief Destroys all Audio::iEffect instances being stored by this handler.
89  virtual void DestroyAllEffects() = 0;
90 
91  ///////////////////////////////////////////////////////////////////////////////
92  // Filter Handling
93 
94  /// @brief Checks to see if the given filter type is supported.
95  /// @param Type The filter type to be checked.
96  /// @return Returns true if the filter is supported, false if the filter isn't supported.
97  virtual bool IsFilterSupported(const FilterType Type) const = 0;
98  /// @brief Creates an Audio Filter for use with @ref iSound instances.
99  /// @return Returns a pointer to the created Filter, or NULL if there was an error.
100  virtual iFilter* CreateFilter() = 0;
101  /// @brief Gets an @ref iFilter instance by index.
102  /// @return Returns a pointer to the @ref iFilter at the specified index.
103  virtual iFilter* GetFilter(const UInt32 Index) const = 0;
104  /// @brief Gets the number of @ref iFilter instances being stored by this handler.
105  /// @return Returns a UInt32 representing the number of @ref iFilter instances contained in this handler.
106  virtual UInt32 GetNumFilters() const = 0;
107  /// @brief Destroys a single @ref iFilter instance.
108  /// @param ToBeDestroyed A pointer to the @ref iFilter to be destroyed.
109  virtual void DestroyFilter(iFilter* ToBeDestroyed) = 0;
110  /// @brief Destroys all @ref iFilter instances being stored by this handler.
111  virtual void DestroyAllFilters() = 0;
112 
113  ///////////////////////////////////////////////////////////////////////////////
114  // Preset Handling
115 
116  /// @brief Gets whether or not an effect preset exists within this handler.
117  /// @param Type The effect type to be checked.
118  /// @param Name The name of the preset to check for.
119  /// @return True if it exists, false if not.
120  virtual bool EffectPresetExists(const EffectType Type, const String& Name) = 0;
121  /// @brief Removes a previously registered effect preset.
122  /// @param Type The type of effect to remove.
123  /// @param Name The name of the preset to remove.
124  virtual void RemoveEffectPreset(const EffectType Type, const String& Name) = 0;
125  /// @brief Removes all effect presets for a specific effect type.
126  /// @param Type The type of effect to remove presets for, or ET_Null to remove all of them.
127  virtual void RemoveAllEffectPresets(const EffectType Type) = 0;
128 
129  ///////////////////////////////////////////////////////////////////////////////
130  // Individual effect type settings
131 
132  /// @brief Adds a preset for the EAX Reverb Audio Effect type.
133  /// @param Name The name to be given to the preset.
134  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
135  virtual void AddEAXReverbEffectPreset(const String& Name, const EAXReverbParameters& Setting) = 0;
136  /// @brief Returns a previously registered preset for the EAX Reverb Effect.
137  /// @param Name The name of the preset to retrieve.
138  /// @return Returns the specified preset or the default parameters if the preset could not be found.
139  virtual EAXReverbParameters GetEAXReverbEffectPreset(const String& Name) const = 0;
140 
141  /// @brief Adds a preset for the Reverb Audio Effect type.
142  /// @param Name The name to be given to the preset.
143  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
144  virtual void AddReverbEffectPreset(const String& Name, const ReverbParameters& Setting) = 0;
145  /// @brief Returns a previously registered preset for the Reverb Effect.
146  /// @param Name The name of the preset to retrieve.
147  /// @return Returns the specified preset or the default parameters if the preset could not be found.
148  virtual ReverbParameters GetReverbEffectPreset(const String& Name) const = 0;
149 
150  /// @brief Adds a preset for the Chorus Audio Effect type.
151  /// @param Name The name to be given to the preset.
152  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
153  virtual void AddChorusEffectPreset(const String& Name, const ChorusParameters& Setting) = 0;
154  /// @brief Returns a previously registered preset for the Chorus Effect.
155  /// @param Name The name of the preset to retrieve.
156  /// @return Returns the specified preset or the default parameters if the preset could not be found.
157  virtual ChorusParameters GetChorusEffectPreset(const String& Name) const = 0;
158 
159  /// @brief Adds a preset for the Distortion Audio Effect type.
160  /// @param Name The name to be given to the preset.
161  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
162  virtual void AddDistortionEffectPreset(const String& Name, const DistortionParameters& Setting) = 0;
163  /// @brief Returns a previously registered preset for the Distortion Effect.
164  /// @param Name The name of the preset to retrieve.
165  /// @return Returns the specified preset or the default parameters if the preset could not be found.
166  virtual DistortionParameters GetDistortionEffectPreset(const String& Name) const = 0;
167 
168  /// @brief Adds a preset for the Echo Audio Effect type.
169  /// @param Name The name to be given to the preset.
170  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
171  virtual void AddEchoEffectPreset(const String& Name, const EchoParameters& Setting) = 0;
172  /// @brief Returns a previously registered preset for the Echo Effect.
173  /// @param Name The name of the preset to retrieve.
174  /// @return Returns the specified preset or the default parameters if the preset could not be found.
175  virtual EchoParameters GetEchoEffectPreset(const String& Name) const = 0;
176 
177  /// @brief Adds a preset for the Flanger Audio Effect type.
178  /// @param Name The name to be given to the preset.
179  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
180  virtual void AddFlangerEffectPreset(const String& Name, const FlangerParameters& Setting) = 0;
181  /// @brief Returns a previously registered preset for the Flanger Effect.
182  /// @param Name The name of the preset to retrieve.
183  /// @return Returns the specified preset or the default parameters if the preset could not be found.
184  virtual FlangerParameters GetFlangerEffectPreset(const String& Name) const = 0;
185 
186  /// @brief Adds a preset for the Frequency Shift Audio Effect type.
187  /// @param Name The name to be given to the preset.
188  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
189  virtual void AddFrequencyShiftEffectPreset(const String& Name, const FrequencyShiftParameters& Setting) = 0;
190  /// @brief Returns a previously registered preset for the Frequency Shift Effect.
191  /// @param Name The name of the preset to retrieve.
192  /// @return Returns the specified preset or the default parameters if the preset could not be found.
193  virtual FrequencyShiftParameters GetFrequencyShiftEffectPreset(const String& Name) const = 0;
194 
195  /// @brief Adds a preset for the Vocal Morpher Audio Effect type.
196  /// @param Name The name to be given to the preset.
197  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
198  virtual void AddVocalMorpherEffectPreset(const String& Name, const VocalMorpherParameters& Setting) = 0;
199  /// @brief Returns a previously registered preset for the Vocal Morpher Effect.
200  /// @param Name The name of the preset to retrieve.
201  /// @return Returns the specified preset or the default parameters if the preset could not be found.
202  virtual VocalMorpherParameters GetVocalMorpherEffectPreset(const String& Name) const = 0;
203 
204  /// @brief Adds a preset for the Pitch Shifter Audio Effect type.
205  /// @param Name The name to be given to the preset.
206  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
207  virtual void AddPitchShifterEffectPreset(const String& Name, const PitchShifterParameters& Setting) = 0;
208  /// @brief Returns a previously registered preset for the Pitch Shifter Effect.
209  /// @param Name The name of the preset to retrieve.
210  /// @return Returns the specified preset or the default parameters if the preset could not be found.
211  virtual PitchShifterParameters GetPitchShifterEffectPreset(const String& Name) const = 0;
212 
213  /// @brief Adds a preset for the Ring Modulator Audio Effect type.
214  /// @param Name The name to be given to the preset.
215  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
216  virtual void AddRingModulatorEffectPreset(const String& Name, const RingModulatorParameters& Setting) = 0;
217  /// @brief Returns a previously registered preset for the Ring Modulator Effect.
218  /// @param Name The name of the preset to retrieve.
219  /// @return Returns the specified preset or the default parameters if the preset could not be found.
220  virtual RingModulatorParameters GetRingModulatorEffectPreset(const String& Name) const = 0;
221 
222  /// @brief Adds a preset for the Autowah Audio Effect type.
223  /// @param Name The name to be given to the preset.
224  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
225  virtual void AddAutowahEffectPreset(const String& Name, const AutowahParameters& Setting) = 0;
226  /// @brief Returns a previously registered preset for the Autowah Effect.
227  /// @param Name The name of the preset to retrieve.
228  /// @return Returns the specified preset or the default parameters if the preset could not be found.
229  virtual AutowahParameters GetAutowahEffectPreset(const String& Name) const = 0;
230 
231  /// @brief Adds a preset for the Compressor Audio Effect type.
232  /// @param Name The name to be given to the preset.
233  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
234  virtual void AddCompressorEffectPreset(const String& Name, const CompressorParameters& Setting) = 0;
235  /// @brief Returns a previously registered preset for the Compressor Effect.
236  /// @param Name The name of the preset to retrieve.
237  /// @return Returns the specified preset or the default parameters if the preset could not be found.
238  virtual CompressorParameters GetCompressorEffectPreset(const String& Name) const = 0;
239 
240  /// @brief Adds a preset for the Equalizer Audio Effect type.
241  /// @param Name The name to be given to the preset.
242  /// @param Setting Parameter struct containing all the parameters to be given to this preset.
243  virtual void AddEqualizerEffectPreset(const String& Name, const EqualizerParameters& Setting) = 0;
244  /// @brief Returns a previously registered preset for the Equalizer Effect.
245  /// @param Name The name of the preset to retrieve.
246  /// @return Returns the specified preset or the default parameters if the preset could not be found.
247  virtual EqualizerParameters GetEqualizerEffectPreset(const String& Name) const = 0;
248  };//iEffectsHandler
249  }//Audio
250 }//Mezzanine
251 
252 #endif