You can use the mOnActivate event of the subpage for this.
var yourSubPageIndex=0 // just an example
var yourSubPageName="EQ" // you can use names as well
yourSubPage.mOnActivate=function(activeDevice,activeMapping){
activeDevice.setState("subPageSelectedIndex",this.yourSubPageIndex.toString())
activeDevice.setState("subPageSelected",this.yourSubPageName)
}.bind({yourSubPageIndex,yourSubPageName})
selectedChannel.mChannelEQ.mBand1.mFreq.mOnDisplayValueChange=function(activeDevice,activeMapping,displayvalue){
if(activeDevice.getState("subPageSelectedIndex")==this.yourSubPageIndex.toString())
//or activeDevice.getState("subPageSelected")==this.yourSubPageName
{
//display the change only when it happened while you're in the correct subPage
}
}.bind({yourSubPageIndex,yourSubPageName})
Note that if your page is made purely from subPages, you have to
Thank you. I actually used this kind of workaround already. However in my optionion this doesn’t really fit into this whole subpage concept. There should be a nicer solution. This is something that could be improved.
@Peter8 Is there a reason you need to use selectedChannel.mChannelEQ.mBand1.mFreq.mOnProcessValueChange instead of surfaceElements.knob.mSurfaceValue.mOnProcessValueChange?
When subPageEQ is active, knob.mSurfaceValue.mOnProcessValueChange will be called with the value of mBand1.mFreq. Likewise, when subPageEQ1 is active, it will be called with mBand2.mFreq. This might be what you want according to
knob.mSurfaceValue.mOnProcessValueChange is also called when you switch subpages