annotate src/portaudio_20140130/include/pa_asio.h @ 124:e3d5853d5918

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