At this point, we have implemented automation for several sliders. Often, it is desirable to have an opportunity to disable automation. So let's add a checkbox that toggles automation on and off:
Declare a new checkbox in the
ofApp
class:ofxToggle automate;
Set up the checkbox in
setup()
by inserting the following command after themixerGroup.add( extrude.setup...
command:mixerGroup.add( automate.setup( "automate", true ) );
Insert the following line right before all the code we added in this chapter to
update()
(except theofSoundUpdate()
command, which we placed at the beginning of the function):if ( automate ) {
And insert the following line right after that code:
}
Now, automation will work only if the automate
checkbox is checked. In the same way, you can create separate checkboxes to toggle the automation of each parameter we created.
Also, you can create sliders for the control...