Revision 6:4c0e82b725d9 CollidoscopeApp/src

View differences:

CollidoscopeApp/src/CollidoscopeApp.cpp
19 19
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
*/
21 21

  
22

  
22 23
#include "cinder/app/App.h"
23 24
#include "cinder/app/RendererGl.h"
24 25
#include "cinder/gl/gl.h"
25 26
#include "cinder/Exception.h"
27
#include <stdexcept>
26 28

  
27 29

  
28 30
#include "Config.h"
......
46 48
    void setup() override;
47 49
    void setupGraphics();
48 50

  
51
    /** Receives MIDI command messages from MIDI thread */
49 52
    void receiveCommands();
53
    /** Prints command line usage */
54
    void usage();
50 55

  
51 56
    void keyDown( KeyEvent event ) override;
52 57
    void update() override;
......
122 127
    switch (c){
123 128
    case 'r' : 
124 129
        mAudioEngine.record( 0 );
125
        mAudioEngine.record( 1 );
126 130
        break;
127 131

  
128 132
    case 'w': {
133

  
129 134
        mWaves[0]->getSelection().setSize(mWaves[0]->getSelection().getSize() + 1);
130 135

  
131 136
        size_t numSelectionChunks = mWaves[0]->getSelection().getSize();
......
467 472
    }
468 473
}
469 474

  
475

  
470 476
CINDER_APP( CollidoscopeApp, RendererGl, [] ( App::Settings *settings) {
471
        settings->setWindowSize( 1920, 1080 );
472
        settings->setMultiTouchEnabled( false );
473
        settings->disableFrameRate();
477

  
478
    const std::vector< string > args = settings->getCommandLineArgs();
479

  
480
    int width = 0;
481
    int height = 0;
482

  
483
    try {
484
        if( args.size() != 3 )
485
            throw std::invalid_argument("");
486

  
487
        width  = std::stoi( args[1] );
488
        height = std::stoi( args[2] );
489

  
490
    }
491
    catch( std::invalid_argument & e ){
492
        console() << "Error: invalid arguments" << std::endl;
493
        console() << "Usage: ./Collidoscope window_width window_height" << std::endl;  
494
        console() << "For example: ./Collidoscope 1024 768 " << std::endl;  
495

  
496
        settings->setShouldQuit( true );
497
        return;
498
    }
499

  
500
    settings->setWindowSize( width, height );
501
    settings->setMultiTouchEnabled( false );
502
    settings->disableFrameRate();
474 503

  
475 504
} )

Also available in: Unified diff