Unsure How to Call Editor Component Method Inside Processor

gui

#1

So I’ve instantiated a waveform viewer class inside my editor which, for obvious reasons is necessary to paint and place the object in the editor. The class itself also has functions which require access to the processor’s buffer so that it can display the correct waveform in the buffer to the editor. I’m just wondering how you would go about this? I’ll post some code for reference.

editor.h

class Ring_modulatorAudioProcessorEditor  : public AudioProcessorEditor, public Slider::Listener, public ComboBox::Listener
 {
 public:
     Ring_modulatorAudioProcessorEditor (Ring_modulatorAudioProcessor&);
     ~Ring_modulatorAudioProcessorEditor();
     //==============================================================================
     void paint (Graphics& g) override;
     void resized() override;
     void sliderValueChanged (Slider* slider) override;
 
 void comboBoxChanged(juce::ComboBox* comboBox) override;
 
 Component* getComponent() { return this; };
 
 std::unique_ptr<KrotosWaveformViewer> m_waveformViewer; //instantiated waveViewer class as pointer     
 private:

processor.cpp

 void Ring_modulatorAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
 {
     const int totalNumOutputChannels = buffer.getNumChannels();

             for (int sampleNum = 0; sampleNum < buffer.getNumSamples(); ++sampleNum)
             {
                 
                 for (int channel = 0; channel < totalNumOutputChannels; ++channel)
                 {
                     ......
                     ......
                     ......
                     m_waveformViewer->updateWaveformThumbnail(buffer.getReadPointer(0));
                                     
                 }
             }

waveformViewer.cpp

void WaveformViewer::updateWaveformThumbnail(juce::AudioSampleBuffer& monoAudioBuffer)
 {
     m_waveformThumbnail->reset(1, m_wavReader->sampleRate, monoAudioBuffer.getNumSamples());
     m_waveformThumbnail->addBlock(0, monoAudioBuffer, 0, monoAudioBuffer.getNumSamples());
     
     m_currentBuffer = monoAudioBuffer;
 }