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