-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBitCrusherProcessor.h
37 lines (31 loc) · 1.44 KB
/
BitCrusherProcessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** Use this processor to dynamically crush the audio's bits. */
class BitCrusherProcessor final : public InternalProcessor
{
public:
/** Constructor. */
BitCrusherProcessor();
//==============================================================================
/** */
void setBitDepth (int newBitDepth);
/** */
[[nodiscard]] int getBitDepth() const noexcept;
//==============================================================================
/** @internal */
const String getName() const override { return NEEDS_TRANS ("Bit Crusher"); }
/** @internal */
Identifier getIdentifier() const override { return "bitCrusher"; }
/** @internal */
bool supportsDoublePrecisionProcessing() const override { return true; }
/** @internal */
void processBlock (juce::AudioBuffer<float>&, MidiBuffer&) override;
/** @internal */
void processBlock (juce::AudioBuffer<double>&, MidiBuffer&) override;
private:
//==============================================================================
AudioParameterInt* bitDepth = new AudioParameterInt ("bitDepth", "Bit-Depth", 1, 16, 8);
//==============================================================================
template<typename FloatType>
void process (juce::AudioBuffer<FloatType>&);
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BitCrusherProcessor)
};