Slider,Combo, and ToggleButton on...Change() source of change indication?


#1

I would like to know whether instances of these components have changed state/value due to:

  • SetValue() notification,

  • User has adjusted the control

potentially it may be useful to know if something else caused the control to change it’s value/state such as loading the plugin or loading a preset into the plugin.
I’m wondering how folks manage what must be a basic requirement?
Thanks for any comments


#2

Ok so basically at times I need to set the controls values without them changing whatever they are controlling.
It seems that this is what the notification argument of the applicable set function call is for

void MyController::set(int x, NotificationType notify) 
{
	switch (controlType) {
	case on_off:
		myToggle->setToggleState((bool)x, notify);
		break;	
	case slidercont:	
		mySlider->setValue(x, notify);
		break;
    case selector:	
        default:
		myCombo->setSelectedItemIndex(x, notify);
		break;		
	}
}

Call with sendNotification usually but dontSendNotification when we don’t want output to be affected.