Clean up whitespace in test/ in preparation for .editorconfig. (#417)

* Clean up whitespace in test/ in preparation for .editorconfig. Convert tabs to 4 spaces. Indent by 4 spaces. Strip trailing whitespace. Ensure EOL at EOF.
This commit is contained in:
Ross Bencina 2021-01-21 23:45:10 +11:00 committed by GitHub
commit f58b69dc36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 998 additions and 998 deletions

View file

@ -1,12 +1,12 @@
/** @file patest_leftright.c
@ingroup test_src
@brief Play different tone sine waves that
alternate between left and right channel.
@ingroup test_src
@brief Play different tone sine waves that
alternate between left and right channel.
The low tone should be on the left channel.
The low tone should be on the left channel.
@author Ross Bencina <rossb@audiomulch.com>
@author Phil Burk <philburk@softsynth.com>
@author Ross Bencina <rossb@audiomulch.com>
@author Phil Burk <philburk@softsynth.com>
*/
/*
* $Id$
@ -36,13 +36,13 @@
*/
/*
* The text above constitutes the entire PortAudio license; however,
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
@ -88,19 +88,19 @@ static int patestCallback( const void *inputBuffer,
for( i=0; i<framesPerBuffer; i++ )
{
// Smoothly pan between left and right.
if( data->currentBalance < data->targetBalance )
{
data->currentBalance += BALANCE_DELTA;
}
else if( data->currentBalance > data->targetBalance )
{
data->currentBalance -= BALANCE_DELTA;
}
// Apply left/right balance.
// Smoothly pan between left and right.
if( data->currentBalance < data->targetBalance )
{
data->currentBalance += BALANCE_DELTA;
}
else if( data->currentBalance > data->targetBalance )
{
data->currentBalance -= BALANCE_DELTA;
}
// Apply left/right balance.
*out++ = data->sine[data->left_phase] * (1.0f - data->currentBalance); /* left */
*out++ = data->sine[data->right_phase] * data->currentBalance; /* right */
*out++ = data->sine[data->right_phase] * data->currentBalance; /* right */
data->left_phase += 1;
if( data->left_phase >= TABLE_SIZE ) data->left_phase -= TABLE_SIZE;
data->right_phase += 3; /* higher pitch so we can distinguish left and right. */
@ -118,10 +118,10 @@ int main(void)
PaStreamParameters outputParameters;
PaError err;
paTestData data;
int i;
int i;
printf("Play different tone sine waves that alternate between left and right channel.\n");
printf("The low tone should be on the left channel.\n");
/* initialise sinusoidal wavetable */
for( i=0; i<TABLE_SIZE; i++ )
{
@ -136,8 +136,8 @@ int main(void)
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
if (outputParameters.device == paNoDevice) {
fprintf(stderr,"Error: No default output device.\n");
goto error;
fprintf(stderr,"Error: No default output device.\n");
goto error;
}
outputParameters.channelCount = 2; /* stereo output */
outputParameters.sampleFormat = paFloat32; /* 32 bit floating point output */
@ -153,21 +153,21 @@ int main(void)
patestCallback,
&data );
if( err != paNoError ) goto error;
err = Pa_StartStream( stream );
if( err != paNoError ) goto error;
printf("Play for several seconds.\n");
for( i=0; i<4; i++ )
{
printf("Hear low sound on left side.\n");
data.targetBalance = 0.01;
{
printf("Hear low sound on left side.\n");
data.targetBalance = 0.01;
Pa_Sleep( 1000 );
printf("Hear high sound on right side.\n");
data.targetBalance = 0.99;
Pa_Sleep( 1000 );
}
printf("Hear high sound on right side.\n");
data.targetBalance = 0.99;
Pa_Sleep( 1000 );
}
err = Pa_StopStream( stream );
if( err != paNoError ) goto error;