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