SuperpoweredFX.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef Header_SuperpoweredFX
  2. #define Header_SuperpoweredFX
  3. /**
  4. @brief This is the base class for Superpowered effects.
  5. @param enabled Indicates if the effect is enabled (processing audio).
  6. */
  7. class SuperpoweredFX {
  8. public:
  9. bool enabled;
  10. /**
  11. @brief Turns the effect on/off.
  12. */
  13. virtual void enable(bool flag) = 0; // Use this to turn it on/off.
  14. /**
  15. @brief Sets the sample rate.
  16. @param samplerate 44100, 48000, etc.
  17. */
  18. virtual void setSamplerate(unsigned int samplerate) = 0;
  19. /**
  20. @brief Reset all internals, sets the instance as good as new and turns it off.
  21. */
  22. virtual void reset() = 0;
  23. /**
  24. @brief Processes the audio.
  25. It's not locked when you call other methods from other threads, and they not interfere with process() at all.
  26. Check the process() documentation of each fx for the minimum number of samples and an optional vector size limitation. For maximum compatibility with all Superpowered effects, numberOfSamples should be minimum 32 and a multiply of 8.
  27. @return Put something into output or not.
  28. @param input 32-bit interleaved stereo input buffer.
  29. @param output 32-bit interleaved stereo output buffer.
  30. @param numberOfSamples Number of samples to process.
  31. */
  32. virtual bool process(float *input, float *output, unsigned int numberOfSamples) = 0;
  33. virtual ~SuperpoweredFX() {};
  34. };
  35. /**
  36. \mainpage Superpowered Audio SDK
  37. The Superpowered Audio SDK is a software development kit based on Superpowered Inc’s digital signal processing (DSP) technology.
  38. Superpowered technology allows developers to build computationally intensive audio apps and embedded applications that process more quickly and use less power than other comparable solutions.
  39. Superpowered DSP is designed and optimized, from scratch, to run on low-power mobile processors. Specifically, any device running ARM with the NEON extension or 64-bit ARM (which covers 99% of all mobile devices manufactured). Intel CPU is supported too.
  40. Details of the latest version can be found at http://superpowered.com/superpowered-audio-sdk/
  41. */
  42. #endif