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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LevelMeter.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
14class LevelMeterPlugin : public Plugin,
15 private juce::Timer
16{
17public:
19 ~LevelMeterPlugin() override;
20
21 static juce::ValueTree create();
22
23 //==============================================================================
24 static const char* getPluginName() { return NEEDS_TRANS("Level Meter"); }
25 static const char* xmlTypeName;
26
27 juce::String getName() const override { return TRANS("Level Meter"); }
28 juce::String getPluginType() override { return xmlTypeName; }
29 juce::String getShortName (int) override { return "Meter"; }
30 juce::String getTooltip() override { return TRANS("Level meter plugin") + "$levelmeterplugin"; }
31 bool canBeDisabled() override { return false; }
32 bool needsConstantBufferSize() override { return false; }
33 bool shoulMeasureCpuUsage() const noexcept final { return false; }
34
35 int getNumOutputChannelsGivenInputs (int numInputChannels) override { return juce::jmin (numInputChannels, 2); }
36
37 juce::String getSelectableDescription() override { return TRANS("Level Meter Plugin"); }
38 void initialise (const PluginInitialisationInfo&) override;
40 void deinitialise() override;
41 void applyToBuffer (const PluginRenderContext&) override;
42 void timerCallback() override;
43
44 void restorePluginStateFromValueTree (const juce::ValueTree&) override;
45
46 //==============================================================================
47 LevelMeasurer measurer;
48
49 juce::CachedValue<bool> showMidiActivity;
50
51private:
52 int controllerTrack = -1;
53
55};
56
57}} // namespace tracktion { inline namespace engine
Monitors the levels of buffers that are passed in, and keeps peak values, overloads,...
void deinitialise() override
Called after play stops to release resources.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void initialiseWithoutStopping(const PluginInitialisationInfo &) override
Tells the plugin that the audio graph has changed but the plugin isn't being re-initialised - i....
juce::String getTooltip() override
default returns the name, others can return special stuff if needed
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
int getNumOutputChannelsGivenInputs(int numInputChannels) override
This must return the number of output channels that the plugin will produce, given a number of input ...
juce::String getName() const override
The name of the type, e.g.
bool shoulMeasureCpuUsage() const noexcept final
Plugins can return false if they want to avoid the overhead of measuring the CPU usage.
#define TRANS(stringLiteral)
#define NEEDS_TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
constexpr Type jmin(Type a, Type b)
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.