Noticed something odd with the latest tip. I’m testing this on the demo audio vst plugin demo.
I’m loading an image file in the DemoEditorComponent and drawing it(This is just out of the juceDemoPlugin demo):
[code]//==============================================================================
DemoEditorComponent::DemoEditorComponent (DemoJuceFilter* const ownerFilter)
: AudioProcessorEditor (ownerFilter)
{
// create our gain slider…
addAndMakeVisible (gainSlider = new Slider (T(“gain”)));
gainSlider->addListener (this);
gainSlider->setRange (0.0, 1.0, 0.01);
gainSlider->setTooltip (T(“changes the volume of the audio that runs through the plugin…”));
// get the gain parameter from the filter and use it to set up our slider
gainSlider->setValue (ownerFilter->getParameter (0), false);
// create and add the midi keyboard component..
addAndMakeVisible (midiKeyboard
= new MidiKeyboardComponent (ownerFilter->keyboardState,
MidiKeyboardComponent::horizontalKeyboard));
// add a label that will display the current timecode and status..
addAndMakeVisible (infoLabel = new Label (String::empty, String::empty));
// add the triangular resizer component for the bottom-right of the UI
addAndMakeVisible (resizer = new ResizableCornerComponent (this, &resizeLimits));
resizeLimits.setSizeLimits (150, 150, 800, 300);
// set our component's initial size to be the last one that was stored in the filter's settings
setSize (ownerFilter->lastUIWidth,
ownerFilter->lastUIHeight);
// register ourselves with the filter - it will use its ChangeBroadcaster base
// class to tell us when something has changed, and this will call our changeListenerCallback()
// method.
ownerFilter->addChangeListener (this);
//======LOAD ALL IMAGE RESOURCES HERE========
juce::File Imagefile(T("tilewood.png"));
myimage = ImageCache::getFromFile(Imagefile);
//=====================================
}
DemoEditorComponent::~DemoEditorComponent()
{
getFilter()->removeChangeListener (this);
deleteAllChildren();
}
//==============================================================================
void DemoEditorComponent::paint (Graphics& g)
{
// just clear the window
g.fillAll (Colour::greyLevel (0.9f));
g.drawImageAt(myimage,0,0);
}[/code]
Now the image shows up ok, untill I do something in cubase like save or load a bank, then when I hide the plugin UI in cubase and show it again I get a black screen the image dissapears and have to restart cubase for it to work again! However the sliders and controls are there and no problem with sound, for some strange reason the images get lost.
I have the exact code with older version of juce, and this did not happen.
Not sure if this link is a similar problem:
http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=3990
Cheers.