| 1 | #ifndef PA_ASIO_H |
| 2 | #define PA_ASIO_H |
| 3 | /* |
| 4 | * $Id: pa_asio.h,v 1.1 2006/06/10 21:30:51 dmazzoni Exp $ |
| 5 | * PortAudio Portable Real-Time Audio Library |
| 6 | * ASIO specific extensions |
| 7 | * |
| 8 | * Copyright (c) 1999-2000 Ross Bencina and Phil Burk |
| 9 | * |
| 10 | * Permission is hereby granted, free of charge, to any person obtaining |
| 11 | * a copy of this software and associated documentation files |
| 12 | * (the "Software"), to deal in the Software without restriction, |
| 13 | * including without limitation the rights to use, copy, modify, merge, |
| 14 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 15 | * and to permit persons to whom the Software is furnished to do so, |
| 16 | * subject to the following conditions: |
| 17 | * |
| 18 | * The above copyright notice and this permission notice shall be |
| 19 | * included in all copies or substantial portions of the Software. |
| 20 | * |
| 21 | * Any person wishing to distribute modifications to the Software is |
| 22 | * requested to send the modifications to the original developer so that |
| 23 | * they can be incorporated into the canonical version. |
| 24 | * |
| 25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 28 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR |
| 29 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 30 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 31 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 32 | * |
| 33 | */ |
| 34 | |
| 35 | /** @file |
| 36 | @brief ASIO-specific PortAudio API extension header file. |
| 37 | */ |
| 38 | |
| 39 | |
| 40 | #include "portaudio.h" |
| 41 | |
| 42 | #ifdef __cplusplus |
| 43 | extern "C" |
| 44 | { |
| 45 | #endif /* __cplusplus */ |
| 46 | |
| 47 | |
| 48 | /** Retrieve legal latency settings for the specificed device, in samples. |
| 49 | |
| 50 | @param device The global index of the device about which the query is being made. |
| 51 | @param minLatency A pointer to the location which will recieve the minimum latency value. |
| 52 | @param maxLatency A pointer to the location which will recieve the maximum latency value. |
| 53 | @param preferredLatency A pointer to the location which will recieve the preferred latency value. |
| 54 | @param granularity A pointer to the location which will recieve the granularity. This value |
| 55 | determines which values between minLatency and maxLatency are available. ie the step size, |
| 56 | if granularity is -1 then available latency settings are powers of two. |
| 57 | |
| 58 | @see ASIOGetBufferSize in the ASIO SDK. |
| 59 | |
| 60 | @todo This function should have a better name, any suggestions? |
| 61 | */ |
| 62 | PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, |
| 63 | long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ); |
| 64 | |
| 65 | |
| 66 | /** Display the ASIO control panel for the specified device. |
| 67 | |
| 68 | @param device The global index of the device whose control panel is to be displayed. |
| 69 | @param systemSpecific On Windows, the calling application's main window handle, |
| 70 | on Macintosh this value should be zero. |
| 71 | */ |
| 72 | PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ); |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | /** Retrieve a pointer to a string containing the name of the specified |
| 78 | input channel. The string is valid until Pa_Terminate is called. |
| 79 | |
| 80 | The string will be no longer than 32 characters including the null terminator. |
| 81 | */ |
| 82 | PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, |
| 83 | const char** channelName ); |
| 84 | |
| 85 | |
| 86 | /** Retrieve a pointer to a string containing the name of the specified |
| 87 | input channel. The string is valid until Pa_Terminate is called. |
| 88 | |
| 89 | The string will be no longer than 32 characters including the null terminator. |
| 90 | */ |
| 91 | PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, |
| 92 | const char** channelName ); |
| 93 | |
| 94 | |
| 95 | #define paAsioUseChannelSelectors (0x01) |
| 96 | |
| 97 | typedef struct PaAsioStreamInfo{ |
| 98 | unsigned long size; /**< sizeof(PaAsioStreamInfo) */ |
| 99 | PaHostApiTypeId hostApiType; /**< paASIO */ |
| 100 | unsigned long version; /**< 1 */ |
| 101 | |
| 102 | unsigned long flags; |
| 103 | |
| 104 | /* Support for opening only specific channels of an ASIO device. |
| 105 | If the paAsioUseChannelSelectors flag is set, channelSelectors is a |
| 106 | pointer to an array of integers specifying the device channels to use. |
| 107 | When used, the length of the channelSelectors array must match the |
| 108 | corresponding channelCount parameter to Pa_OpenStream() otherwise a |
| 109 | crash may result. |
| 110 | The values in the selectors array must specify channels within the |
| 111 | range of supported channels for the device or paInvalidChannelCount will |
| 112 | result. |
| 113 | */ |
| 114 | int *channelSelectors; |
| 115 | }PaAsioStreamInfo; |
| 116 | |
| 117 | |
| 118 | #ifdef __cplusplus |
| 119 | } |
| 120 | #endif /* __cplusplus */ |
| 121 | |
| 122 | #endif /* PA_ASIO_H */ |