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