How to control idle() call interval for a specific platform

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

I implemented tooltips in my gui which depend on the idle() function of the editor.

In windows they are running just fine!

Now that i brought the project to osx, it doest seem to be running.

But without any reasonable action, a tooltip appeared and it seems to be working but none in the way i designed them.

It seems that the idle function is not being called like it should.

Is there any difference between the implementation of idle cal interval in windows and osx implementation?

Where can i find those implementions in the VSTGUI files?

Cheers,

Nuno
Imagining the future

Post

you'll find the implementation for that stuff in aeffguieditor.cpp, i think. you can do nothing about how often the host calls the main idle function though.

if you find many hosts are not calling the idle function as regularly as you need, you might want to consider creating your own timing thread to do that for you.

Post

If you need to do this, then you should use preprocessor defines like so:

Code: Select all

#if WINDOWS
.... stuff ....
#elif MACX
... other stuff ...
#endif
However, as aciddose noted, this method should behave roughly the same on OSX and windows.

Post

aciddose wrote:you'll find the implementation for that stuff in aeffguieditor.cpp, i think. you can do nothing about how often the host calls the main idle function though.

if you find many hosts are not calling the idle function as regularly as you need, you might want to consider creating your own timing thread to do that for you.
Hummm, i need to give a look to that.

In my quest for tooltips, i have been thru several issues.

First i made it in osx, with sdk 2.3 and vstgui files from source forge, but that version in windows had a problem.

Then i jumped to sdk 2.4 and vstgui files from sdk 2.4 (because i cant use the other files, the ones from vstgui from sourceforge) and the tooltips werent working on osx (the issue that i have now)

Now, i corrected the windows version, and i'm trying to put it working on osx.

Do you think this differente behaviour can becaused by differences in aeffguieditor.cpp

The header of that file is precisly the file that causes me a lof of confusion when compiling the sdk 2.4 files with vstgui files from sourceforge.

But... you don't work with this files, right? You have your own gui manager...

Cheers,

Nuno
Imagining the future

Post

I've been looking for differences in both files (from the different releases) and the only difference i found was basicly a header inclusion...

The intervals were the same...

Humm... maybe thats not the problem at all
Imagining the future

Post

well, there should be no difference in the headers. have you tried using many different hosts on osx to verify this is a problem with the osx implementation and not just the specific host you're using?

when i mentioned aeffguieditor.cpp i was only pointing you to where the idle function is located. i dont suggest that you modify the code there, it works fine for ordinary purposes the way it is.

i think the way in which the loop is constructed is silly, but that is another reason i wrote my own gui. you should leave vstgui working the way it is designed.

Post

aciddose wrote:well, there should be no difference in the headers. have you tried using many different hosts on osx to verify this is a problem with the osx implementation and not just the specific host you're using?
well, i'm only using ableton live. its the only host i have for vst at the moment. it the only one i'm using for windows as well. that's not very inteligent, test only in one host, right? :)

is there any vst tester for osx around?
Imagining the future

Post

Plogue Bidule is one that is affordable for the Mac.

Post

are there no free hosts for mac? it isnt exactly complicated to write one for only testing purposes.

Post

grab a load of demos and test the plugins in those. You don't need to save projects just to test your plugin.

Post

After some debugging i found two issues!

Maybe you can help me out solving this...

1º I discover that in OSX, the idle function is only being called when i actually click in a control. In windows, it always calling idle(). I found this, putting a CParamDisplay, displaying a temp variable that is incresead in each idle call. In my case, it messes with the tooltip because it will only appear when i click in the control, and not when i put the mouse above it. Do you guys think this is a bug of VSTGUI? i still need to test it out on another host.

2º In OSX this call, (!myContext->getMouseButtons()), which i use to avoid the tooltip dissapear when i'm not above the control which i'm currently moving (this is, clicking in the control), doesnt work!!

This is my code in idle() function, just to give you the context because this is working perfectly on windows.

Code: Select all

void MyVSTEditor::idle() {
	temp++;
	CDrawContext* myContext = frame->createDrawContext();
	CPoint myMouseLoc;
	frame->getMouseLocation(myContext, myMouseLoc);

	long   myViewCount = frame->getNbViews();
	CView* myView      = 0;
	CView* myNewView   = 0;
	CRect  myViewSize;

	
	for (long i = 0; i < myViewCount; i++) {
		myView = frame->getView(i);
		myView->getViewSize(myViewSize);
		if (myMouseLoc.isInside(myViewSize)) {
			myNewView = myView;
			break;
		}
	}

	if (myNewView != myOldView) {
		if (attached && !myContext->getMouseButtons()) {
			frame->removeView(label, false);
			frame->drawRect(myContext, tooltip);
			attached = 0;
			myOldView = 0;
			frame->setDirty(); 
		}

		myControl = dynamic_cast <CKnob*> (myNewView);
		if (myControl && !myContext->getMouseButtons()) {
			display->setValue(temp);
			mySelectedControl = myControl;
			attach(myControl->getTag(), myViewSize, myContext);
			myOldView = myNewView;
		}
	}

	myContext->forget();
	AEffGUIEditor::idle();
} 
Cheers,

Nuno
Imagining the future

Post

Kingston wrote:grab a load of demos and test the plugins in those. You don't need to save projects just to test your plugin.
Tell me some demo names with vst support for mac please.

Cheers,

Nuno
Imagining the future

Post

Hey guys,

It seems that i have just found two bugs in Live 5.2

I just tested the plugin with vsti host for osx from defective records and it works perfectly!!

I'm going to try with ableton 6 demo now.

Cheers,

Nuno
Imagining the future

Post Reply

Return to “DSP and Plugin Development”