Hello, I am doing a plugin with sliders and next to it there is a visualiser (in the red rectangle). I set the visualiser background colour to be transparent like so :
addAndMakeVisible(audioProcessor.waveVisualiser);
Colour transparent(0.0f, 0.0f, 0.0f, 0.0f);
audioProcessor.waveVisualiser.setColours(transparent, Colours::green);
The green traces are recorded audio from the standalone app.
The alpha value is 0 so it should be transparent. But it appear to be duplicating the left side instead. Any ideas on how to fix this ?
Other code that I don’t think is related but just in case :
void MyPluginAudioProcessorEditor::resized()
{
float h = getHeight();
float w = getWidth()/2;
float m = (w+h)/50;
float L2 = (w - 3 * m)/2;
float L1 = (L2-2*m)/3;
// slider and check box positioning
audioProcessor.waveVisualiser.setBounds(w+m, m, w-2*m, h-2*m);
}
void MyPluginAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
{
waveVisualiser.clear();
}
void MyPluginAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
waveVisualiser.pushBuffer(buffer);
}
Neat bug. Got OPENGL enabled? This looks like a texture pipeline issue …
I don’t know how to see if openGL is enabled. Is it something I have to to in projucer ?
Also when built the vst3 plugin and run it in reaper, the background colour is black, it is not even the same as the standalone plugin.
The goal of making the background transparent is to superimpose several AudioVisualiserComponent so I can plot several traces on top of each others.
But if you know another way to plot several curves with AudioVisualiserComponent, it can be as helpful as solving the transparent issue.
So I updated juce to the last version and it still produce the same. Also I looked under the paint function of the AudioVisualiserComponent and commented the
g.fillAll (backgroundColour);
void AudioVisualiserComponent::paint (Graphics& g)
{
//g.fillAll (backgroundColour);
auto r = getLocalBounds().toFloat();
auto channelHeight = r.getHeight() / (float) channels.size();
g.setColour (waveformColour);
for (auto* c : channels)
paintChannel (g, r.removeFromTop (channelHeight),
c->levels.begin(), c->levels.size(), c->nextSample);
}
So normally it should not display any background. But still the error persits.
call setOpaque (false) on the widget
It’s on by default in this class
1 Like
Oh thanks a lot ! It works fine now. I thought this parameter would have all the component transparent but I understand now.