SOLVED: AU only gives sound after opening GUI


#1

I seem to have a bug in my plugin where the AU version only gives sound after the GUI is opened. Anyone had this problem before? Any hint where to look?

Harrie


#2

Hi,

Hard to say without seeing your code, but most probably you are doing some initialisation of our filter in the editor’s constructor, or inside some kind of sliderChanged() function;
Start by looking in in editor’s constructor for obvious things like :
getprocessor()->setOutputVolume(1);
or anywhere you’re accessing the filter thru getprocessor()-> or similar.
btw this should be avoided of course, as the filter should be able to process sound even without editor, just by parameters change (i.e. automation)

Salvator


#3

Maybe there are some obvious mistakes?? Big parts of the editor code:

#include "EMT250Editor.h"


//==============================================================================
EMT250Editor::EMT250Editor (EMT250Filter* const ownerFilter)
    : AudioProcessorEditor (ownerFilter),
      DecaySlider ("DecaySlider"),
      LowSlider ("LowSlider"),
      HighSlider ("HighSlider"),
    
 
     

{
	MyLookAndFeel = new EMT250LookAndFeel();
	this->setLookAndFeel(MyLookAndFeel);
   
    setSize (xxxxxx);
	
	ImageCache *IC;
	Image DecaySliderImage,FourHandleAImage,DelaySliderImage;
	DecaySliderImage=IC->getFromMemory(decayhandle::emt250_decay0_png,decayhandle::emt250_decay0_pngSize);
	FourHandleAImage=IC->getFromMemory(four_handle_a::emt250_l1_4_png,four_handle_a::emt250_l1_4_pngSize);
	DelaySliderImage=IC->getFromMemory(four_handle_b::emt250_l2_7_png,four_handle_b::emt250_l2_7_pngSize);


	
	addAndMakeVisible(&DecaySlider);
	DecaySlider.addListener(this);
	DecaySlider.setRange(0,1,0.01);
	DecaySlider.setSliderStyle(Slider::RotaryVerticalDrag);
	DecaySlider.setTextBoxStyle(Slider::NoTextBox,true,0,0);
	DecaySlider.setBounds(141,12,DecaySliderImage.getWidth(),DecaySliderImage.getHeight());
	

	
	addAndMakeVisible(&LowSlider);
	LowSlider.setRange(0,1,0.01);
	LowSlider.setSliderStyle(Slider::RotaryVerticalDrag);
	LowSlider.setTextBoxStyle(Slider::NoTextBox,true,0,0);
	LowSlider.setBounds(271,0,FourHandleAImage.getWidth(),FourHandleAImage.getHeight());
    
startTimer(50);
     
}
		


EMT250Editor::~EMT250Editor()
{
	

}

//==============================================================================
void EMT250Editor::paint (Graphics& g)
{
	if (!BackButton.getToggleState())
		BG=ImageCache::getFromMemory(background::emt250_panel_png,background::emt250_panel_pngSize);
	else
		BG=ImageCache::getFromMemory(backside::emt250_backside_png,backside::emt250_backside_pngSize);
	g.drawImage(BG,0,0,getWidth(),getHeight(),0,0,BG.getWidth(),BG.getHeight());
}


//==============================================================================
void EMT250Editor::timerCallback()
{
    // this is the filter telling us that it's changed, so we'll update our
    // display of the time, midi message, etc.
    EMT250Filter* filter= getFilter();
    
	DecaySlider.setValue (filter->decay,dontSendNotification);
	LowSlider.setValue (filter->low,dontSendNotification);
	HighSlider.setValue (filter->high,dontSendNotification);
	
    
}

void EMT250Editor::sliderValueChanged (Slider* S)
{
	if (S==&DecaySlider)
	{
		getFilter()->setParameterNotifyingHost (kdecay,
                                                   (float) S->getValue());
        
	}
    
	else if (S==&LowSlider)
	{
		getFilter()->setParameterNotifyingHost(klow,S->getValue());
		
	}
	else if (S==&HighSlider)
	{
		getFilter()->setParameterNotifyingHost(khigh,S->getValue());
		
	
     
}

void EMT250Editor::buttonClicked(Button* B)
{
	if (B == &SurroundButton) getFilter()->setParameterNotifyingHost(ksurroundswitch,B->getToggleState());
	if (B == &ERSButton)
	{
	
          #if JUCE_MODAL_LOOPS_PERMITTED
            AlertWindow w ("Empty Room Systems", "EMpTy 250 v2.0.6", AlertWindow::NoIcon, &MixSlider);
			w.addTextBlock ("Name: " + naam);
			

            StringArray options;
            
			
			w.addButton ("ok", 1, KeyPress (KeyPress::returnKey, 0, 0));

			 if (w.runModalLoop() != 0) // is they picked 'ok'
			 {
                // this is the item they chose in the drop-down list..
				
             
				File myFile = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile ("xxxxx").getChildFile("xxxxxx");
				myFile.replaceWithText (text, false, false);

				}
            #endif
	
	}
}


void EMT250Editor::sliderDragStarted(Slider *S)
{
	if (S==&DecaySlider)
	{
		getFilter()->beginParameterChangeGesture(kdecay);
		
	}
	
	else if (S==&LeftSLevelSlider)
	{
		getFilter()->beginParameterChangeGesture(kleftslevel);
		
	}
	else if (S==&RightSLevelSlider)
	{
		getFilter()->beginParameterChangeGesture(krightslevel);
		//return;
	}
}

void EMT250Editor::sliderDragEnded(Slider *S)
{
	if (S==&DecaySlider)
	{
		getFilter()->endParameterChangeGesture(kdecay);
		
	}
	else if (S==&LowSlider)
	{
		getFilter()->endParameterChangeGesture(klow);
		
	}
	else if (S==&HighSlider)
	{
		getFilter()->endParameterChangeGesture(khigh);
		
	}
	
}

#4

Fixed it. You pointed me in the right direction. After disabling the callbacks from the plugin editor I could figure out my mistakes withing the pluginprocessor. Thanks!