O'Reilly logo

openFrameworks Essentials by Denis Perevalov, Igor Tatarnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling automation

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:

  1. Declare a new checkbox in the ofApp class:
    ofxToggle automate;
  2. Set up the checkbox in setup() by inserting the following command after the mixerGroup.add( extrude.setup... command:
    mixerGroup.add( automate.setup( "automate", true ) );
  3. Insert the following line right before all the code we added in this chapter to update() (except the ofSoundUpdate() command, which we placed at the beginning of the function):
    if ( automate ) {
    

    And insert the following line right after that code:

    }

    Tip

    You need to re-indent that code by adding Tab before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required