Thread: Cairo in WDL-OL
View Single Post
Old 03-03-2017, 10:46 AM   #27
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 341
Default

Personally I'd have it so that whenever a control is changed, it updates the mThreshold value in your simplecomp.cpp, and passes the value to the mycairocontrol.h, which then copies it to its own mThreshold variable.

The mycairocontrol draw() method will be automatically called when it needs to be called, and that uses its own variables of mThreshold, mRatio etc.

processReplacing() in simplecomp.cpp will be using its own Threshold variable.

and in simplecomp.cpp's onParamChange, you'd have
Code:
	case kThresh:
		mGain = GetParam(kThresh)->Value() / 100.;
		pMyControl->setThresh(GetParam(kThresh)->Value());
		break;
Now, similar things can be achieved using pointers, but I'm not fully sure on dealing with those. It's along the same lines as what I was asking in this thread, but I never got a clear answer to my question!

http://forum.cockos.com/showthread.php?t=186243
Bobflip is offline   Reply With Quote