cannam@124: #ifndef PA_ASIO_H cannam@124: #define PA_ASIO_H cannam@124: /* cannam@124: * $Id: pa_asio.h 1667 2011-05-02 15:49:20Z rossb $ cannam@124: * PortAudio Portable Real-Time Audio Library cannam@124: * ASIO specific extensions cannam@124: * cannam@124: * Copyright (c) 1999-2000 Ross Bencina and Phil Burk cannam@124: * cannam@124: * Permission is hereby granted, free of charge, to any person obtaining cannam@124: * a copy of this software and associated documentation files cannam@124: * (the "Software"), to deal in the Software without restriction, cannam@124: * including without limitation the rights to use, copy, modify, merge, cannam@124: * publish, distribute, sublicense, and/or sell copies of the Software, cannam@124: * and to permit persons to whom the Software is furnished to do so, cannam@124: * subject to the following conditions: cannam@124: * cannam@124: * The above copyright notice and this permission notice shall be cannam@124: * included in all copies or substantial portions of the Software. cannam@124: * cannam@124: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, cannam@124: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF cannam@124: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. cannam@124: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR cannam@124: * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF cannam@124: * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION cannam@124: * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cannam@124: */ cannam@124: cannam@124: /* cannam@124: * The text above constitutes the entire PortAudio license; however, cannam@124: * the PortAudio community also makes the following non-binding requests: cannam@124: * cannam@124: * Any person wishing to distribute modifications to the Software is cannam@124: * requested to send the modifications to the original developer so that cannam@124: * they can be incorporated into the canonical version. It is also cannam@124: * requested that these non-binding requests be included along with the cannam@124: * license above. cannam@124: */ cannam@124: cannam@124: cannam@124: /** @file cannam@124: @ingroup public_header cannam@124: @brief ASIO-specific PortAudio API extension header file. cannam@124: */ cannam@124: cannam@124: #include "portaudio.h" cannam@124: cannam@124: #ifdef __cplusplus cannam@124: extern "C" cannam@124: { cannam@124: #endif /* __cplusplus */ cannam@124: cannam@124: cannam@124: /** Retrieve legal native buffer sizes for the specificed device, in sample frames. cannam@124: cannam@124: @param device The global index of the device about which the query is being made. cannam@124: @param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value. cannam@124: @param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value. cannam@124: @param preferredBufferSizeFrames A pointer to the location which will receive the preferred buffer size value. cannam@124: @param granularity A pointer to the location which will receive the "granularity". This value determines cannam@124: the step size used to compute the legal values between minBufferSizeFrames and maxBufferSizeFrames. cannam@124: If granularity is -1 then available buffer size values are powers of two. cannam@124: cannam@124: @see ASIOGetBufferSize in the ASIO SDK. cannam@124: cannam@124: @note: this function used to be called PaAsio_GetAvailableLatencyValues. There is a cannam@124: #define that maps PaAsio_GetAvailableLatencyValues to this function for backwards compatibility. cannam@124: */ cannam@124: PaError PaAsio_GetAvailableBufferSizes( PaDeviceIndex device, cannam@124: long *minBufferSizeFrames, long *maxBufferSizeFrames, long *preferredBufferSizeFrames, long *granularity ); cannam@124: cannam@124: cannam@124: /** Backwards compatibility alias for PaAsio_GetAvailableBufferSizes cannam@124: cannam@124: @see PaAsio_GetAvailableBufferSizes cannam@124: */ cannam@124: #define PaAsio_GetAvailableLatencyValues PaAsio_GetAvailableBufferSizes cannam@124: cannam@124: cannam@124: /** Display the ASIO control panel for the specified device. cannam@124: cannam@124: @param device The global index of the device whose control panel is to be displayed. cannam@124: @param systemSpecific On Windows, the calling application's main window handle, cannam@124: on Macintosh this value should be zero. cannam@124: */ cannam@124: PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ); cannam@124: cannam@124: cannam@124: cannam@124: cannam@124: /** Retrieve a pointer to a string containing the name of the specified cannam@124: input channel. The string is valid until Pa_Terminate is called. cannam@124: cannam@124: The string will be no longer than 32 characters including the null terminator. cannam@124: */ cannam@124: PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, cannam@124: const char** channelName ); cannam@124: cannam@124: cannam@124: /** Retrieve a pointer to a string containing the name of the specified cannam@124: input channel. The string is valid until Pa_Terminate is called. cannam@124: cannam@124: The string will be no longer than 32 characters including the null terminator. cannam@124: */ cannam@124: PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, cannam@124: const char** channelName ); cannam@124: cannam@124: cannam@124: /** Set the sample rate of an open paASIO stream. cannam@124: cannam@124: @param stream The stream to operate on. cannam@124: @param sampleRate The new sample rate. cannam@124: cannam@124: Note that this function may fail if the stream is alredy running and the cannam@124: ASIO driver does not support switching the sample rate of a running stream. cannam@124: cannam@124: Returns paIncompatibleStreamHostApi if stream is not a paASIO stream. cannam@124: */ cannam@124: PaError PaAsio_SetStreamSampleRate( PaStream* stream, double sampleRate ); cannam@124: cannam@124: cannam@124: #define paAsioUseChannelSelectors (0x01) cannam@124: cannam@124: typedef struct PaAsioStreamInfo{ cannam@124: unsigned long size; /**< sizeof(PaAsioStreamInfo) */ cannam@124: PaHostApiTypeId hostApiType; /**< paASIO */ cannam@124: unsigned long version; /**< 1 */ cannam@124: cannam@124: unsigned long flags; cannam@124: cannam@124: /* Support for opening only specific channels of an ASIO device. cannam@124: If the paAsioUseChannelSelectors flag is set, channelSelectors is a cannam@124: pointer to an array of integers specifying the device channels to use. cannam@124: When used, the length of the channelSelectors array must match the cannam@124: corresponding channelCount parameter to Pa_OpenStream() otherwise a cannam@124: crash may result. cannam@124: The values in the selectors array must specify channels within the cannam@124: range of supported channels for the device or paInvalidChannelCount will cannam@124: result. cannam@124: */ cannam@124: int *channelSelectors; cannam@124: }PaAsioStreamInfo; cannam@124: cannam@124: cannam@124: #ifdef __cplusplus cannam@124: } cannam@124: #endif /* __cplusplus */ cannam@124: cannam@124: #endif /* PA_ASIO_H */