How to keep a unified format for a memory buffer

If I keep audio data in memory for processing, how can I efficiently share it for processing, display and playback?

I started out using AudioBuffer<float> since it suits the processing I want to do well.

However I’ve built upon the Draw audio waveforms tutorial to get playback, cursor and waveform draw functionality and I don’t get how I can keep the connection between these classes and the audio buffer I’m processing consistent.

When I’ve read the file into the AudioBuffer<float> I use reset and addBlock in the AudioThumbnail class to get it drawing the waveform. This seems to read the data once and whenever I’ve processed the buffer I need to reset with all parameters and re-read the whole AudioThumbnail again rather than calling some update method.

The AudioTransport class used for playback and playback cursor positioning requires a PositionableAudioSource so for that purpose I also make a MemoryAudioSource of the buffer. This also needs to get reset and read again after processing.

So when I’ve processed the buffer the code needed for updating the waveform and playback seems too complex and inefficient and it is like when the file was read into memory the first time. Or maybe I’ve missed something obvious regarding updating the view and playback?

Otherwise I was thinking maybe it’s all a matter of using a better shared storage for the audio data when three classes are supposed to use it; one processing it, one displaying it and one playing it. Something else than what I got from the tutorial.

Are there any advice how to easily share a buffer which is incrementally processed so the update of AudioThumbnail and AudioTransport is made easy and efficient?

Side note:
I was also considering using the dsp-module which requires audio wrapped in yet another way using AudioBlock and ProcessContext. This seems to add even more complexity to updating the buffer, view and playback. Or is there a way to keep things unified and effective here too?