TonicAudio / Tonic

Easy and efficient audio synthesis in C++
The Unlicense
522 stars 63 forks source link

ControlValue and ControlTrigger do exactly the same thing #230

Open ndonald2 opened 11 years ago

ndonald2 commented 11 years ago

I just noticed this. The only difference is the interface - both will output a particular value with a "triggered" status when you either call setValue() or trigger().

ControlValue also responds to forceNewOutput but I want to phase that out when I refactor the synthesis context stuff.

Maybe ControlTrigger just wraps ControlValue_ but the output value is limited to 1 when it's triggered and 0 when it's not?

morganpackard commented 11 years ago

Sounds good. I like the clarity of the name ControlTrigger, and the trigger method, but see that's it's totally redundant. I'd be ok with just removing it if you felt that's the way to go, but I'm inclined to keep the class, just turn it in to a wrapper as you suggest.

ndonald2 commented 11 years ago

I think keeping it as a wrapper definitely has value, and having it output a float value of 0 or 1 depending on the triggered state may prove useful.