annotate src/portaudio_20161030/pablio/pablio.h @ 167:bd3cc4d1df30

Add FFTW 3.3.8 source, and a Linux build
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Nov 2019 14:52:55 +0000
parents 59a8758c56b1
children
rev   line source
cannam@140 1 #ifndef _PABLIO_H
cannam@140 2 #define _PABLIO_H
cannam@140 3
cannam@140 4 #ifdef __cplusplus
cannam@140 5 extern "C"
cannam@140 6 {
cannam@140 7 #endif /* __cplusplus */
cannam@140 8
cannam@140 9 /*
cannam@140 10 * $Id$
cannam@140 11 * PABLIO.h
cannam@140 12 * Portable Audio Blocking read/write utility.
cannam@140 13 *
cannam@140 14 * Author: Phil Burk, http://www.softsynth.com/portaudio/
cannam@140 15 *
cannam@140 16 * Include file for PABLIO, the Portable Audio Blocking I/O Library.
cannam@140 17 * PABLIO is built on top of PortAudio, the Portable Audio Library.
cannam@140 18 * For more information see: http://www.portaudio.com
cannam@140 19 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
cannam@140 20 *
cannam@140 21 * Permission is hereby granted, free of charge, to any person obtaining
cannam@140 22 * a copy of this software and associated documentation files
cannam@140 23 * (the "Software"), to deal in the Software without restriction,
cannam@140 24 * including without limitation the rights to use, copy, modify, merge,
cannam@140 25 * publish, distribute, sublicense, and/or sell copies of the Software,
cannam@140 26 * and to permit persons to whom the Software is furnished to do so,
cannam@140 27 * subject to the following conditions:
cannam@140 28 *
cannam@140 29 * The above copyright notice and this permission notice shall be
cannam@140 30 * included in all copies or substantial portions of the Software.
cannam@140 31 *
cannam@140 32 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
cannam@140 33 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
cannam@140 34 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
cannam@140 35 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
cannam@140 36 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
cannam@140 37 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
cannam@140 38 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cannam@140 39 */
cannam@140 40
cannam@140 41 /*
cannam@140 42 * The text above constitutes the entire PortAudio license; however,
cannam@140 43 * the PortAudio community also makes the following non-binding requests:
cannam@140 44 *
cannam@140 45 * Any person wishing to distribute modifications to the Software is
cannam@140 46 * requested to send the modifications to the original developer so that
cannam@140 47 * they can be incorporated into the canonical version. It is also
cannam@140 48 * requested that these non-binding requests be included along with the
cannam@140 49 * license above.
cannam@140 50 */
cannam@140 51
cannam@140 52 #include <stdio.h>
cannam@140 53 #include <stdlib.h>
cannam@140 54 #include <math.h>
cannam@140 55 #include "portaudio.h"
cannam@140 56 #include "pa_ringbuffer.h"
cannam@140 57 #include <string.h>
cannam@140 58
cannam@140 59 typedef struct
cannam@140 60 {
cannam@140 61 RingBuffer inFIFO;
cannam@140 62 RingBuffer outFIFO;
cannam@140 63 PortAudioStream *stream;
cannam@140 64 int bytesPerFrame;
cannam@140 65 int samplesPerFrame;
cannam@140 66 }
cannam@140 67 PABLIO_Stream;
cannam@140 68
cannam@140 69 /* Values for flags for OpenAudioStream(). */
cannam@140 70 #define PABLIO_READ (1<<0)
cannam@140 71 #define PABLIO_WRITE (1<<1)
cannam@140 72 #define PABLIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE)
cannam@140 73 #define PABLIO_MONO (1<<2)
cannam@140 74 #define PABLIO_STEREO (1<<3)
cannam@140 75
cannam@140 76 /************************************************************
cannam@140 77 * Write data to ring buffer.
cannam@140 78 * Will not return until all the data has been written.
cannam@140 79 */
cannam@140 80 long WriteAudioStream( PABLIO_Stream *aStream, void *data, long numFrames );
cannam@140 81
cannam@140 82 /************************************************************
cannam@140 83 * Read data from ring buffer.
cannam@140 84 * Will not return until all the data has been read.
cannam@140 85 */
cannam@140 86 long ReadAudioStream( PABLIO_Stream *aStream, void *data, long numFrames );
cannam@140 87
cannam@140 88 /************************************************************
cannam@140 89 * Return the number of frames that could be written to the stream without
cannam@140 90 * having to wait.
cannam@140 91 */
cannam@140 92 long GetAudioStreamWriteable( PABLIO_Stream *aStream );
cannam@140 93
cannam@140 94 /************************************************************
cannam@140 95 * Return the number of frames that are available to be read from the
cannam@140 96 * stream without having to wait.
cannam@140 97 */
cannam@140 98 long GetAudioStreamReadable( PABLIO_Stream *aStream );
cannam@140 99
cannam@140 100 /************************************************************
cannam@140 101 * Opens a PortAudio stream with default characteristics.
cannam@140 102 * Allocates PABLIO_Stream structure.
cannam@140 103 *
cannam@140 104 * flags parameter can be an ORed combination of:
cannam@140 105 * PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE,
cannam@140 106 * and either PABLIO_MONO or PABLIO_STEREO
cannam@140 107 */
cannam@140 108 PaError OpenAudioStream( PABLIO_Stream **aStreamPtr, double sampleRate,
cannam@140 109 PaSampleFormat format, long flags );
cannam@140 110
cannam@140 111 PaError CloseAudioStream( PABLIO_Stream *aStream );
cannam@140 112
cannam@140 113 #ifdef __cplusplus
cannam@140 114 }
cannam@140 115 #endif /* __cplusplus */
cannam@140 116 #endif /* _PABLIO_H */