annotate src/portaudio_20140130/include/pa_asio.h @ 81:7029a4916348

Merge build update
author Chris Cannam
date Thu, 31 Oct 2019 13:36:58 +0000
parents 7ddb4fc30dac
children
rev   line source
Chris@39 1 #ifndef PA_ASIO_H
Chris@39 2 #define PA_ASIO_H
Chris@39 3 /*
Chris@39 4 * $Id: pa_asio.h 1667 2011-05-02 15:49:20Z rossb $
Chris@39 5 * PortAudio Portable Real-Time Audio Library
Chris@39 6 * ASIO specific extensions
Chris@39 7 *
Chris@39 8 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
Chris@39 9 *
Chris@39 10 * Permission is hereby granted, free of charge, to any person obtaining
Chris@39 11 * a copy of this software and associated documentation files
Chris@39 12 * (the "Software"), to deal in the Software without restriction,
Chris@39 13 * including without limitation the rights to use, copy, modify, merge,
Chris@39 14 * publish, distribute, sublicense, and/or sell copies of the Software,
Chris@39 15 * and to permit persons to whom the Software is furnished to do so,
Chris@39 16 * subject to the following conditions:
Chris@39 17 *
Chris@39 18 * The above copyright notice and this permission notice shall be
Chris@39 19 * included in all copies or substantial portions of the Software.
Chris@39 20 *
Chris@39 21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@39 22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@39 23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Chris@39 24 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
Chris@39 25 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@39 26 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@39 27 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@39 28 */
Chris@39 29
Chris@39 30 /*
Chris@39 31 * The text above constitutes the entire PortAudio license; however,
Chris@39 32 * the PortAudio community also makes the following non-binding requests:
Chris@39 33 *
Chris@39 34 * Any person wishing to distribute modifications to the Software is
Chris@39 35 * requested to send the modifications to the original developer so that
Chris@39 36 * they can be incorporated into the canonical version. It is also
Chris@39 37 * requested that these non-binding requests be included along with the
Chris@39 38 * license above.
Chris@39 39 */
Chris@39 40
Chris@39 41
Chris@39 42 /** @file
Chris@39 43 @ingroup public_header
Chris@39 44 @brief ASIO-specific PortAudio API extension header file.
Chris@39 45 */
Chris@39 46
Chris@39 47 #include "portaudio.h"
Chris@39 48
Chris@39 49 #ifdef __cplusplus
Chris@39 50 extern "C"
Chris@39 51 {
Chris@39 52 #endif /* __cplusplus */
Chris@39 53
Chris@39 54
Chris@39 55 /** Retrieve legal native buffer sizes for the specificed device, in sample frames.
Chris@39 56
Chris@39 57 @param device The global index of the device about which the query is being made.
Chris@39 58 @param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
Chris@39 59 @param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value.
Chris@39 60 @param preferredBufferSizeFrames A pointer to the location which will receive the preferred buffer size value.
Chris@39 61 @param granularity A pointer to the location which will receive the "granularity". This value determines
Chris@39 62 the step size used to compute the legal values between minBufferSizeFrames and maxBufferSizeFrames.
Chris@39 63 If granularity is -1 then available buffer size values are powers of two.
Chris@39 64
Chris@39 65 @see ASIOGetBufferSize in the ASIO SDK.
Chris@39 66
Chris@39 67 @note: this function used to be called PaAsio_GetAvailableLatencyValues. There is a
Chris@39 68 #define that maps PaAsio_GetAvailableLatencyValues to this function for backwards compatibility.
Chris@39 69 */
Chris@39 70 PaError PaAsio_GetAvailableBufferSizes( PaDeviceIndex device,
Chris@39 71 long *minBufferSizeFrames, long *maxBufferSizeFrames, long *preferredBufferSizeFrames, long *granularity );
Chris@39 72
Chris@39 73
Chris@39 74 /** Backwards compatibility alias for PaAsio_GetAvailableBufferSizes
Chris@39 75
Chris@39 76 @see PaAsio_GetAvailableBufferSizes
Chris@39 77 */
Chris@39 78 #define PaAsio_GetAvailableLatencyValues PaAsio_GetAvailableBufferSizes
Chris@39 79
Chris@39 80
Chris@39 81 /** Display the ASIO control panel for the specified device.
Chris@39 82
Chris@39 83 @param device The global index of the device whose control panel is to be displayed.
Chris@39 84 @param systemSpecific On Windows, the calling application's main window handle,
Chris@39 85 on Macintosh this value should be zero.
Chris@39 86 */
Chris@39 87 PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific );
Chris@39 88
Chris@39 89
Chris@39 90
Chris@39 91
Chris@39 92 /** Retrieve a pointer to a string containing the name of the specified
Chris@39 93 input channel. The string is valid until Pa_Terminate is called.
Chris@39 94
Chris@39 95 The string will be no longer than 32 characters including the null terminator.
Chris@39 96 */
Chris@39 97 PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex,
Chris@39 98 const char** channelName );
Chris@39 99
Chris@39 100
Chris@39 101 /** Retrieve a pointer to a string containing the name of the specified
Chris@39 102 input channel. The string is valid until Pa_Terminate is called.
Chris@39 103
Chris@39 104 The string will be no longer than 32 characters including the null terminator.
Chris@39 105 */
Chris@39 106 PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex,
Chris@39 107 const char** channelName );
Chris@39 108
Chris@39 109
Chris@39 110 /** Set the sample rate of an open paASIO stream.
Chris@39 111
Chris@39 112 @param stream The stream to operate on.
Chris@39 113 @param sampleRate The new sample rate.
Chris@39 114
Chris@39 115 Note that this function may fail if the stream is alredy running and the
Chris@39 116 ASIO driver does not support switching the sample rate of a running stream.
Chris@39 117
Chris@39 118 Returns paIncompatibleStreamHostApi if stream is not a paASIO stream.
Chris@39 119 */
Chris@39 120 PaError PaAsio_SetStreamSampleRate( PaStream* stream, double sampleRate );
Chris@39 121
Chris@39 122
Chris@39 123 #define paAsioUseChannelSelectors (0x01)
Chris@39 124
Chris@39 125 typedef struct PaAsioStreamInfo{
Chris@39 126 unsigned long size; /**< sizeof(PaAsioStreamInfo) */
Chris@39 127 PaHostApiTypeId hostApiType; /**< paASIO */
Chris@39 128 unsigned long version; /**< 1 */
Chris@39 129
Chris@39 130 unsigned long flags;
Chris@39 131
Chris@39 132 /* Support for opening only specific channels of an ASIO device.
Chris@39 133 If the paAsioUseChannelSelectors flag is set, channelSelectors is a
Chris@39 134 pointer to an array of integers specifying the device channels to use.
Chris@39 135 When used, the length of the channelSelectors array must match the
Chris@39 136 corresponding channelCount parameter to Pa_OpenStream() otherwise a
Chris@39 137 crash may result.
Chris@39 138 The values in the selectors array must specify channels within the
Chris@39 139 range of supported channels for the device or paInvalidChannelCount will
Chris@39 140 result.
Chris@39 141 */
Chris@39 142 int *channelSelectors;
Chris@39 143 }PaAsioStreamInfo;
Chris@39 144
Chris@39 145
Chris@39 146 #ifdef __cplusplus
Chris@39 147 }
Chris@39 148 #endif /* __cplusplus */
Chris@39 149
Chris@39 150 #endif /* PA_ASIO_H */