11namespace tracktion {
inline namespace engine
14LevelMeterPlugin::LevelMeterPlugin (PluginCreationInfo info) : Plugin (info)
16 showMidiActivity.referTo (state, IDs::showMidi, getUndoManager());
18 measurer.setShowMidi (showMidiActivity);
21LevelMeterPlugin::~LevelMeterPlugin()
23 notifyListenersOfDeletion();
29 v.setProperty (IDs::type, xmlTypeName,
nullptr);
33const char* LevelMeterPlugin::xmlTypeName =
"level";
38 initialiseWithoutStopping (info);
43 TRACKTION_ASSERT_MESSAGE_THREAD
45 if (
auto t = getOwnerTrack())
47 controllerTrack = t->getIndexInEditTrackList();
48 startTimer (1000 / 50);
56void LevelMeterPlugin::deinitialise()
71 measurer.setShowMidi (showMidiActivity);
76void LevelMeterPlugin::timerCallback()
78 if (controllerTrack >= 0)
80 auto& ecm = engine.getExternalControllerManager();
82 if (ecm.isAttachedToEdit (edit))
84 auto l = measurer.getLevelCache();
85 ecm.channelLevelChanged (controllerTrack, dbToGain (l.first), dbToGain (l.second));
90void LevelMeterPlugin::restorePluginStateFromValueTree (
const juce::ValueTree& v)
92 copyPropertiesToCachedValues (v, showMidiActivity);
94 for (
auto p : getAutomatableParameters())
95 p->updateFromAttachedValue();
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.
int bufferNumSamples
The number of samples to write into the audio buffer.
MidiMessageArray * bufferForMidiMessages
A buffer of MIDI events to process.
juce::AudioBuffer< float > * destBuffer
The target audio buffer which needs to be filled.
int bufferStartSample
The index of the start point in the audio buffer from which data must be written.