Code Suggestion/help? AudioVisualiserComponent

gui

#1

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->setNumChannels(2);
audioView->setColours(Colours::transparentWhite, Colours::dimgrey);
audioView->setRepaintRate(30);
audioView->pushBuffer(processor.visualizeBuffer); // Copy of the processBlock buffer
addAndMakeVisible(audioView);

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.


#2

Have you tried the debugger?


#3

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.


#4

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


#5

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.


#6

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