AudioVisualiserComponent does not need to be inherited from in order to be used. It doesn’t have any pure virtual methods that you would be forced to override. Can you show your code?
I am using a standard component template from Juce where my ‘WaveForm’ class is inheriting with ‘class WaveForm : public AudioVisualiserComponent’
In my constructor of the waveform class I have this:
’ setSize (600, 180);
setRepaintRate(100);
setSamplesPerBlock(256);
setBufferSize(256);
setColours(Colours::white,Colours::black);
setNumChannels(1);’
Thank you. Now, this is working better. No errors and a correct white background color.
Only… no waveform showing up.
I use this to push samples (where lastInputBuffer is the latest input buffer):
if (waveForm!=nullptr){
waveForm->clear();
for(int i = 0;i<256;i++){
waveForm->pushSample(&lastInputBuffer[i], 1);
}
}
Did you do addAndMakeVisible on the visualizer component and did you also set its bounds? Where in your code are you doing that sample pushing? Also, why are you constantly clearing the visualizer?
I did the addAndMakeVisible and it is showing the white background color.
I also set its bounds.
My sample pushing is in the process function in my AudioProcessor.
I’m clearing the visualizer so that I can draw a new waveform.
Still, 50% of the times, the plugin crashes when I load it in my DAW
You are probably not handling your plugin GUI correctly. Plugins should be coded so that the GUI never has to even exist and they must tolerate the GUI being destroyed without warning etc.
hey i recently streamed some experimentation with the audiovisualisercomponent. The problem initially was that the AVC worked perfectly fine for me in the audio application but didnt work when i had to share the object in the Audio Plugin version. All i had to do in the end was have an AVC in the processor to push buffers etc, and in the editor i made a copy of the object through a reference and set things like bounds and visibility.
if it helps you watching the stream you can do so here (from 0 to about 55 mins in, at 50 mins i got it working): https://www.twitch.tv/videos/139331635
initially my problem sounds the same to yours, just that the 2 components arent properly linked.