Closed zepumph closed 2 years ago
This is caused because when the state has been set on a sim, setState
is called again on reset all (for that screen only). The simplest solution I could think of was that the resetAllButton shouldn't have this enabled control Property. This makes sense since it is a one-shot sound that will NEVER have state to control its firing. Thus, it seems reasonable to opt out of a state-related enabledControlProperty.
This is highly tied to the solution that @jbphet and I worked on over in https://github.com/phetsims/phet-io/issues/1626#issuecomment-1021770433.
@jbphet how does this patch seem to you? It is working well from my testing.
@jbphet and I spoke about this, and it wasn't a 100% yes commit this. We both want to think if there is a better way to control most/all sounds save the reset one.
Okay, I've given this some thought, and it seems like a reasonable approach to me. I would suggest a different name for the phetioStateSettingControlled
option thought, since the sound generator isn't really being controlled in any way by the setting of phet-io state. How about disabledDuringPhetioStateSetting
?
I love it, thanks for thinking on it!
Alright, I committed, I went with enabledDuringPhetioStateSetting default to false, because I didn't like the double negative at the usage site:
disabledDuringPhetioStateSetting: false
I wanted to touch base about one more item I noticed while testing this. It seems like there is a bit of clipping occurring in the middle of the resetAllButton sound. I presume that it is because enabledControlProperties are turning sounds off, but the shutoff switch is set on before any changes that would cause sounds occur, so I don't quite understand why this is like this, or how we'd fix it. Perhaps it is because of ramping down to muting items. I'll investigate a bit.
I'm a bit out of my depths on this one. I may need to solicit @jbphet for some assistance. If nothing else, he can let me know how serious the problem is. @jbphet will you please reach out when you are back and we can schedule even a short 15 minute meeting to discuss. Thanks!
I met with @jbphet about this today. I created https://github.com/phetsims/tambo/issues/159, and we will take it from there. Closing
Reported in https://github.com/phetsims/phet-io/issues/1626#issuecomment-1034217060 by @Nancy-Salpepi:
I have some leads, most likely we just need the reset sound to bypass the muting that goes on during state set.