MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Process

Method Process

Source/AudioMeter.cpp:47–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void AudioMeter::Process(double time)
48{
49 PROFILER(AudioMeter);
50
51 IAudioReceiver* target = GetTarget();
52
53 if (target == nullptr)
54 return;
55
56 SyncBuffers();
57
58 mNumChannels = GetBuffer()->NumActiveChannels();
59
60 if (mEnabled)
61 {
62 ComputeSliders(0);
63
64 Clear(mAnalysisBuffer, gBufferSize);
65
66 for (int ch = 0; ch < GetBuffer()->NumActiveChannels(); ++ch)
67 {
68 Add(mAnalysisBuffer, GetBuffer()->GetChannel(ch), GetBuffer()->BufferSize());
69 mLevelMeterDisplay.Process(ch, GetBuffer()->GetChannel(ch), GetBuffer()->BufferSize());
70 }
71
72 mPeakTracker.Process(mAnalysisBuffer, gBufferSize);
73 mLevel = sqrtf(mPeakTracker.GetPeak());
74 }
75
76 for (int ch = 0; ch < GetBuffer()->NumActiveChannels(); ++ch)
77 {
78 Add(target->GetBuffer()->GetChannel(ch), GetBuffer()->GetChannel(ch), GetBuffer()->BufferSize());
79 GetVizBuffer()->WriteChunk(GetBuffer()->GetChannel(ch), GetBuffer()->BufferSize(), ch);
80 }
81
82 GetBuffer()->Reset();
83}
84
85void AudioMeter::DrawModule()
86{

Callers

nothing calls this directly

Calls 9

ClearFunction · 0.85
AddFunction · 0.85
NumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80
BufferSizeMethod · 0.80
GetPeakMethod · 0.80
GetBufferMethod · 0.80
WriteChunkMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected