From fe8aa4ce5e8eebc1c6f762f4fc40328718a13e22 Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Sat, 31 Dec 2005 01:32:12 +0000 Subject: Deleted unused (?) files svn path=/trunk/; revision=4318 --- pd/portaudio_v18/pa_common/pa_convert.c | 470 -------------------------------- 1 file changed, 470 deletions(-) delete mode 100644 pd/portaudio_v18/pa_common/pa_convert.c (limited to 'pd/portaudio_v18/pa_common/pa_convert.c') diff --git a/pd/portaudio_v18/pa_common/pa_convert.c b/pd/portaudio_v18/pa_common/pa_convert.c deleted file mode 100644 index 72e021eb..00000000 --- a/pd/portaudio_v18/pa_common/pa_convert.c +++ /dev/null @@ -1,470 +0,0 @@ -/* - * pa_conversions.c - * portaudio - * - * Created by Phil Burk on Mon Mar 18 2002. - * - */ -#include - -#include "portaudio.h" -#include "pa_host.h" - -#define CLIP( val, min, max ) { val = ((val) < (min)) ? min : (((val) < (max)) ? (max) : (val)); } - -/*************************************************************************/ -static void PaConvert_Float32_Int16( - float *sourceBuffer, int sourceStride, - short *targetBuffer, int targetStride, - int numSamples ) -{ - int i; - for( i=0; ipast_NativeInputSampleFormat = nativeInputSampleFormat; - past->past_InputConversionSourceStride = 1; - past->past_InputConversionTargetStride = 1; - - if( nativeInputSampleFormat != past->past_InputSampleFormat ) - { - int ifDither = (past->past_Flags & paDitherOff) == 0; - past->past_InputConversionProc = PaConvert_SelectProc( nativeInputSampleFormat, - past->past_InputSampleFormat, 0, ifDither ); - if( past->past_InputConversionProc == NULL ) return paSampleFormatNotSupported; - } - else - { - past->past_InputConversionProc = NULL; /* no conversion necessary */ - } - - return paNoError; -} - -/*************************************************************************/ -PaError PaConvert_SetupOutput( internalPortAudioStream *past, - PaSampleFormat nativeOutputSampleFormat ) -{ - - past->past_NativeOutputSampleFormat = nativeOutputSampleFormat; - past->past_OutputConversionSourceStride = 1; - past->past_OutputConversionTargetStride = 1; - - if( nativeOutputSampleFormat != past->past_OutputSampleFormat ) - { - int ifDither = (past->past_Flags & paDitherOff) == 0; - int ifClip = (past->past_Flags & paClipOff) == 0; - - past->past_OutputConversionProc = PaConvert_SelectProc( past->past_OutputSampleFormat, - nativeOutputSampleFormat, ifClip, ifDither ); - if( past->past_OutputConversionProc == NULL ) return paSampleFormatNotSupported; - } - else - { - past->past_OutputConversionProc = NULL; /* no conversion necessary */ - } - - return paNoError; -} - -/************************************************************************* -** Called by host code. -** Convert input from native format to user format, -** call user code, -** then convert output to native format. -** Returns result from user callback. -*/ -long PaConvert_Process( internalPortAudioStream *past, - void *nativeInputBuffer, - void *nativeOutputBuffer ) -{ - int userResult; - void *inputBuffer = NULL; - void *outputBuffer = NULL; - - /* Get native input data. */ - if( (past->past_NumInputChannels > 0) && (nativeInputBuffer != NULL) ) - { - if( past->past_InputSampleFormat == past->past_NativeInputSampleFormat ) - { - /* Already in native format so just read directly from native buffer. */ - inputBuffer = nativeInputBuffer; - } - else - { - inputBuffer = past->past_InputBuffer; - /* Convert input data to user format. */ - (*past->past_InputConversionProc)(nativeInputBuffer, past->past_InputConversionSourceStride, - inputBuffer, past->past_InputConversionTargetStride, - past->past_FramesPerUserBuffer * past->past_NumInputChannels ); - } - } - - /* Are we doing output? */ - if( (past->past_NumOutputChannels > 0) && (nativeOutputBuffer != NULL) ) - { - outputBuffer = (past->past_OutputConversionProc == NULL) ? - nativeOutputBuffer : past->past_OutputBuffer; - } - /* - AddTraceMessage("Pa_CallConvertInt16: inputBuffer = ", (int) inputBuffer ); - AddTraceMessage("Pa_CallConvertInt16: outputBuffer = ", (int) outputBuffer ); - */ - /* Call user callback routine. */ - userResult = past->past_Callback( - inputBuffer, - outputBuffer, - past->past_FramesPerUserBuffer, - past->past_FrameCount, - past->past_UserData ); - - /* Advance frame counter for timestamp. */ - past->past_FrameCount += past->past_FramesPerUserBuffer; // FIXME - should this be in here? - - /* Convert to native format if necessary. */ - if( (past->past_OutputConversionProc != NULL ) && (outputBuffer != NULL) ) - { - (*past->past_OutputConversionProc)( outputBuffer, past->past_OutputConversionSourceStride, - nativeOutputBuffer, past->past_OutputConversionTargetStride, - past->past_FramesPerUserBuffer * past->past_NumOutputChannels ); - } - - return userResult; -} -- cgit v1.2.1