void DeviceTestApp::processTap( ivec2 pos ) { // TextInput *selectedInput = false; if( mPlayButton.hitTest( pos ) ) audio::master()->setEnabled( ! audio::master()->isEnabled() ); else if( mRecordButton.hitTest( pos ) ) startRecording(); else if( mSamplerateInput.hitTest( pos ) ) { } else if( mFramesPerBlockInput.hitTest( pos ) ) { } else if( mNumInChannelsInput.hitTest( pos ) ) { } else if( mNumOutChannelsInput.hitTest( pos ) ) { } else if( mSendChannelInput.hitTest( pos ) ) { } #if defined( CINDER_COCOA_TOUCH ) TextInput *currentSelected = TextInput::getCurrentSelected(); if( currentSelected ) showKeyboard( KeyboardOptions().type( KeyboardType::NUMERICAL ).initialString( currentSelected->mInputString ) ); #endif size_t currentTestIndex = mTestSelector.mCurrentSectionIndex; if( mTestSelector.hitTest( pos ) && currentTestIndex != mTestSelector.mCurrentSectionIndex ) { string currentTest = mTestSelector.currentSection(); CI_LOG_V( "selected: " << currentTest ); setupTest( currentTest ); return; } size_t currentOutputIndex = mOutputSelector.mCurrentSectionIndex; if( mOutputSelector.hitTest( pos ) && currentOutputIndex != mOutputSelector.mCurrentSectionIndex ) { auto dev = audio::Device::findDeviceByName( mOutputSelector.mSegments[mOutputSelector.mCurrentSectionIndex] ); CI_LOG_V( "selected output device named: " << dev->getName() << ", key: " << dev->getKey() ); setOutputDevice( dev ); return; } size_t currentInputIndex = mInputSelector.mCurrentSectionIndex; if( mInputSelector.hitTest( pos ) && currentInputIndex != mInputSelector.mCurrentSectionIndex ) { auto dev = audio::Device::findDeviceByName( mInputSelector.mSegments[mInputSelector.mCurrentSectionIndex] ); CI_LOG_V( "selected input named: " << dev->getName() << ", key: " << dev->getKey() ); setInputDevice( dev ); return; } }
void VoiceTestApp::processTap( Vec2i pos ) { if( mPlayButton.hitTest( pos ) ) mVoice->start(); size_t currentIndex = mTestSelector.mCurrentSectionIndex; if( mTestSelector.hitTest( pos ) && currentIndex != mTestSelector.mCurrentSectionIndex ) { string currentTest = mTestSelector.currentSection(); CI_LOG_V( "selected: " << currentTest ); if( currentTest == "basic" ) setupBasic(); if( currentTest == "basic stereo" ) setupBasicStereo(); else if( currentTest == "scope" ) setupScope(); else if( currentTest == "file 2" ) setupDifferentFile(); PRINT_GRAPH( audio::master() ); } }
void SamplePlayerNodeTestApp::processTap( ivec2 pos ) { if( mEnableSamplePlayerNodeButton.hitTest( pos ) ) mSamplePlayerNode->setEnabled( ! mSamplePlayerNode->isEnabled() ); else if( mStartPlaybackButton.hitTest( pos ) ) triggerStartStop( true ); else if( mStopPlaybackButton.hitTest( pos ) ) triggerStartStop( false ); else if( mLoopButton.hitTest( pos ) ) mSamplePlayerNode->setLoopEnabled( ! mSamplePlayerNode->isLoopEnabled() ); else if( mRecordButton.hitTest( pos ) ) { if( mRecordButton.mEnabled ) mRecorder->start(); else mRecorder->disable(); } else if( mWriteButton.hitTest( pos ) ) writeRecordedToFile(); else if( mAutoResizeButton.hitTest( pos ) ) ; else if( mAsyncButton.hitTest( pos ) ) ; else if( pos.y > getWindowCenter().y ) seek( pos.x ); size_t currentIndex = mTestSelector.mCurrentSectionIndex; if( mTestSelector.hitTest( pos ) && currentIndex != mTestSelector.mCurrentSectionIndex ) { string currentTest = mTestSelector.currentSection(); CI_LOG_V( "selected: " << currentTest ); if( currentTest == "BufferPlayerNode" ) setupBufferPlayerNode(); if( currentTest == "FilePlayerNode" ) setupFilePlayerNode(); if( currentTest == "recorder" ) setupBufferRecorderNode(); } }