Code Suggestion/help? AudioVisualiserComponent

Hey all,

I’m putting the finishing touches on a compressor that I’ve been working on and I wanted to have a component that lets you view the incoming buffer to the compressor. That being said, I figured a quick and easy solution would be to use the AudioVisualiserComponent class.

That being said, I implemented it in the following way.

ScopedPointer<AudioVisualiserComponent> audioView;

audioView->setColours(Colours::transparentWhite, Colours::dimgrey);
audioView->pushBuffer(processor.visualizeBuffer); // Copy of the processBlock buffer

audioView->setBounds(200, 400, (getWidth() / 4) + 50, 300);

The project builds so I thought it was as simple as the JUCE docs say. However, when I go to test the plugin using the Plugin host, the program crashes. Usually, this is the case if I forget to addAndMakeVisible or have some threading issue but I don’t quite know where to go from here. I have been working at this for an embarrassingly long amount of time and would appreciate any guidance.

I appreciate anyone’s time.

Have you tried the debugger?

What errors are you getting when it crashes?
Build and run the plugin host in debug and then open a debug build of your plugin with it. When it crashes, you should be able to see exactly where.

1 Like

I didn’t realize the plugin host had this feature. Thanks!

It’s not a feature of the JUCE plugin host, it’s a general feature of the IDEs like Visual Studio and XCode. To debug dlls (plugins), you can set the host program to be launched together with the debugger. So the host doesn’t even need to be built in debug mode. Any host can be used.


@Xenakios, I appreciate it. You’ve helped me yet again. I’ll get that going in XCode. Thank you. I really appreciate it.