Skip to content

Commit

Permalink
better test code for Pan2dNode::setStereoInputModeEnabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
richardeakin committed Oct 31, 2014
1 parent eefb941 commit 6661a09
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/_audio/SampleTest/src/SampleTestApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
//#define INITIAL_AUDIO_RES RES_TONE440_OGG
//#define INITIAL_AUDIO_RES RES_TONE440L220R_OGG

#define TEST_STEREO_INPUT_PANNING 0

using namespace ci;
using namespace ci::app;
using namespace std;
Expand Down Expand Up @@ -93,7 +95,9 @@ void SamplePlayerNodeTestApp::setup()
auto ctx = audio::master();

mPan = ctx->makeNode( new audio::Pan2dNode() );
// mPan->setStereoInputModeEnabled( false );
#if TEST_STEREO_INPUT_PANNING
mPan->setStereoInputModeEnabled( true );
#endif

mGain = ctx->makeNode( new audio::GainNode() );
mGain->setValue( 0.6f );
Expand Down Expand Up @@ -324,8 +328,13 @@ void SamplePlayerNodeTestApp::processDrag( Vec2i pos )
{
if( mGainSlider.hitTest( pos ) )
mGain->setValue( mGainSlider.mValueScaled );
else if( mPanSlider.hitTest( pos ) )
else if( mPanSlider.hitTest( pos ) ) {
#if TEST_STEREO_INPUT_PANNING
mPan->getParamPos()->applyRamp( mPanSlider.mValueScaled, 0.6f );
#else
mPan->setPos( mPanSlider.mValueScaled );
#endif
}
else if( mLoopBeginSlider.hitTest( pos ) )
mSamplePlayerNode->setLoopBeginTime( mLoopBeginSlider.mValueScaled );
else if( mLoopEndSlider.hitTest( pos ) )
Expand Down

0 comments on commit 6661a09

Please sign in to comment.