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