OpenShot Library | OpenShotAudio  0.2.1
juce_ReverbAudioSource.h
1 
2 /** @weakgroup juce_audio_basics-sources
3  * @{
4  */
5 /*
6  ==============================================================================
7 
8  This file is part of the JUCE library.
9  Copyright (c) 2017 - ROLI Ltd.
10 
11  JUCE is an open source library subject to commercial or open-source
12  licensing.
13 
14  The code included in this file is provided under the terms of the ISC license
15  http://www.isc.org/downloads/software-support-policy/isc-license. Permission
16  To use, copy, modify, and/or distribute this software for any purpose with or
17  without fee is hereby granted provided that the above copyright notice and
18  this permission notice appear in all copies.
19 
20  JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21  EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22  DISCLAIMED.
23 
24  ==============================================================================
25 */
26 
27 namespace juce
28 {
29 
30 //==============================================================================
31 /**
32  An AudioSource that uses the Reverb class to apply a reverb to another AudioSource.
33 
34  @see Reverb
35 
36  @tags{Audio}
37 */
39 {
40 public:
41  /** Creates a ReverbAudioSource to process a given input source.
42 
43  @param inputSource the input source to read from - this must not be null
44  @param deleteInputWhenDeleted if true, the input source will be deleted when
45  this object is deleted
46  */
47  ReverbAudioSource (AudioSource* inputSource,
48  bool deleteInputWhenDeleted);
49 
50  /** Destructor. */
51  ~ReverbAudioSource() override;
52 
53  //==============================================================================
54  /** Returns the parameters from the reverb. */
55  const Reverb::Parameters& getParameters() const noexcept { return reverb.getParameters(); }
56 
57  /** Changes the reverb's parameters. */
58  void setParameters (const Reverb::Parameters& newParams);
59 
60  void setBypassed (bool isBypassed) noexcept;
61  bool isBypassed() const noexcept { return bypass; }
62 
63  //==============================================================================
64  void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
65  void releaseResources() override;
66  void getNextAudioBlock (const AudioSourceChannelInfo&) override;
67 
68 private:
69  //==============================================================================
70  CriticalSection lock;
72  Reverb reverb;
73  std::atomic<bool> bypass;
74 
75  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ReverbAudioSource)
76 };
77 
78 } // namespace juce
79 
80 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
const Reverb::Parameters & getParameters() const noexcept
Returns the parameters from the reverb.
Base class for objects that can produce a continuous stream of audio.
Holds a pointer to an object which can optionally be deleted when this pointer goes out of scope...
Performs a simple reverb effect on a stream of audio data.
A re-entrant mutex.
Used by AudioSource::getNextAudioBlock().
An AudioSource that uses the Reverb class to apply a reverb to another AudioSource.
Holds the parameters being used by a Reverb object.