tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LatencyPlugin.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
18class LatencyPlugin : public Plugin
19{
20public:
22 ~LatencyPlugin() override;
23
24 //==============================================================================
25 static const char* getPluginName() { return NEEDS_TRANS("Latency Tester"); }
26 static const char* xmlTypeName;
27 static juce::ValueTree create();
28
29 juce::String getName() const override { return getPluginName(); }
30 juce::String getPluginType() override { return xmlTypeName; }
32
33 void initialise (const PluginInitialisationInfo&) override;
34 void deinitialise() override;
35 void applyToBuffer (const PluginRenderContext&) override;
36
37 double getLatencySeconds() override { return latencyTimeSeconds.get(); }
38 bool needsConstantBufferSize() override { return false; }
39
40 void restorePluginStateFromValueTree (const juce::ValueTree&) override;
41
42 //==============================================================================
43 ConstrainedCachedValue<float> latencyTimeSeconds;
44 juce::CachedValue<bool> applyLatency;
45
46private:
47 class DelayRegister;
48 std::unique_ptr<DelayRegister> delayCompensator[2];
49 LambdaTimer playbackRestartTimer;
50
51 void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override;
52
54};
55
56}} // namespace tracktion { inline namespace engine
Type get() const noexcept
Returns the current value of the property.
A test plugin that introduces latency to the incomming signal.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
void deinitialise() override
Called after play stops to release resources.
juce::String getName() const override
The name of the type, e.g.
#define NEEDS_TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
The context passed to plugin render methods to provide it with buffers to fill.