Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

juce_ReverbAudioSource.h 2.8KB

9 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_REVERBAUDIOSOURCE_H_INCLUDED
  18. #define JUCE_REVERBAUDIOSOURCE_H_INCLUDED
  19. //==============================================================================
  20. /**
  21. An AudioSource that uses the Reverb class to apply a reverb to another AudioSource.
  22. @see Reverb
  23. */
  24. class JUCE_API ReverbAudioSource : public AudioSource
  25. {
  26. public:
  27. /** Creates a ReverbAudioSource to process a given input source.
  28. @param inputSource the input source to read from - this must not be null
  29. @param deleteInputWhenDeleted if true, the input source will be deleted when
  30. this object is deleted
  31. */
  32. ReverbAudioSource (AudioSource* inputSource,
  33. bool deleteInputWhenDeleted);
  34. /** Destructor. */
  35. ~ReverbAudioSource();
  36. //==============================================================================
  37. /** Returns the parameters from the reverb. */
  38. const Reverb::Parameters& getParameters() const noexcept { return reverb.getParameters(); }
  39. /** Changes the reverb's parameters. */
  40. void setParameters (const Reverb::Parameters& newParams);
  41. void setBypassed (bool isBypassed) noexcept;
  42. bool isBypassed() const noexcept { return bypass; }
  43. //==============================================================================
  44. void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
  45. void releaseResources() override;
  46. void getNextAudioBlock (const AudioSourceChannelInfo&) override;
  47. private:
  48. //==============================================================================
  49. CriticalSection lock;
  50. OptionalScopedPointer<AudioSource> input;
  51. Reverb reverb;
  52. volatile bool bypass;
  53. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ReverbAudioSource)
  54. };
  55. #endif // JUCE_REVERBAUDIOSOURCE_H_INCLUDED