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