OpenShot Library | OpenShotAudio  0.2.2
juce_IIRFilterAudioSource.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 performs an IIR filter on another source.
33 
34  @tags{Audio}
35 */
37 {
38 public:
39  //==============================================================================
40  /** Creates a IIRFilterAudioSource for a given input source.
41 
42  @param inputSource the input source to read from - this must not be null
43  @param deleteInputWhenDeleted if true, the input source will be deleted when
44  this object is deleted
45  */
46  IIRFilterAudioSource (AudioSource* inputSource,
47  bool deleteInputWhenDeleted);
48 
49  /** Destructor. */
50  ~IIRFilterAudioSource() override;
51 
52  //==============================================================================
53  /** Changes the filter to use the same parameters as the one being passed in. */
54  void setCoefficients (const IIRCoefficients& newCoefficients);
55 
56  /** Calls IIRFilter::makeInactive() on all the filters being used internally. */
57  void makeInactive();
58 
59  //==============================================================================
60  void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override;
61  void releaseResources() override;
62  void getNextAudioBlock (const AudioSourceChannelInfo&) override;
63 
64 private:
65  //==============================================================================
67  OwnedArray<IIRFilter> iirFilters;
68 
69  JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (IIRFilterAudioSource)
70 };
71 
72 } // namespace juce
73 
74 /** @}*/
#define JUCE_API
This macro is added to all JUCE public class declarations.
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...
A set of coefficients for use in an IIRFilter object.
An AudioSource that performs an IIR filter on another source.
An array designed for holding objects.
Used by AudioSource::getNextAudioBlock().