Superpowered3BandEQ.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef Header_Superpowered3BandEQ
  2. #define Header_Superpowered3BandEQ
  3. #include "SuperpoweredFX.h"
  4. struct eqInternals;
  5. /**
  6. @brief Classic three-band equalizer with unique characteristics and total kills.
  7. It doesn't allocate any internal buffers and needs just a few bytes of memory.
  8. @param bands Low/mid/high gain. Read-write. 1.0f is "flat", 2.0f is +6db. Kill is enabled under -40 db (0.01f).
  9. @param enabled True if the effect is enabled (processing audio). Read only. Use the enable() method to set.
  10. */
  11. class Superpowered3BandEQ: public SuperpoweredFX {
  12. public:
  13. float bands[3]; // READ-WRITE parameter.
  14. /**
  15. @brief Turns the effect on/off.
  16. */
  17. void enable(bool flag);
  18. /**
  19. @brief Create an eq instance with the current sample rate value.
  20. Enabled is false by default, use enable(true) to enable. Example: Superpowered3BandEQ eq = new Superpowered3BandEQ(44100);
  21. */
  22. Superpowered3BandEQ(unsigned int samplerate);
  23. ~Superpowered3BandEQ();
  24. /**
  25. @brief Sets the sample rate.
  26. @param samplerate 44100, 48000, etc.
  27. */
  28. void setSamplerate(unsigned int samplerate);
  29. /**
  30. @brief Reset all internals, sets the instance as good as new and turns it off.
  31. */
  32. void reset();
  33. /**
  34. @brief Processes the audio.
  35. It's not locked when you call other methods from other threads, and they not interfere with process() at all.
  36. @return Put something into output or not.
  37. @param input 32-bit interleaved stereo input buffer. Can point to the same location with output (in-place processing).
  38. @param output 32-bit interleaved stereo output buffer. Can point to the same location with input (in-place processing).
  39. @param numberOfSamples Should be 32 minimum.
  40. */
  41. bool process(float *input, float *output, unsigned int numberOfSamples);
  42. private:
  43. eqInternals *internals;
  44. Superpowered3BandEQ(const Superpowered3BandEQ&);
  45. Superpowered3BandEQ& operator=(const Superpowered3BandEQ&);
  46. };
  47. #endif