PortAudio  2.0
pa_mac_core.h
Go to the documentation of this file.
1 #ifndef PA_MAC_CORE_H
2 #define PA_MAC_CORE_H
3 /*
4  * PortAudio Portable Real-Time Audio Library
5  * Macintosh Core Audio specific extensions
6  * portaudio.h should be included before this file.
7  *
8  * Copyright (c) 2005-2006 Bjorn Roche
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  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
25  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29 
30 /*
31  * The text above constitutes the entire PortAudio license; however,
32  * the PortAudio community also makes the following non-binding requests:
33  *
34  * Any person wishing to distribute modifications to the Software is
35  * requested to send the modifications to the original developer so that
36  * they can be incorporated into the canonical version. It is also
37  * requested that these non-binding requests be included along with the
38  * license above.
39  */
40 
46 #include "portaudio.h"
47 
48 #include <AudioUnit/AudioUnit.h>
49 #include <AudioToolbox/AudioToolbox.h>
50 
51 // Audio workgroups are only supported from MacOS 11 onwards.
52 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
53 #include <os/workgroup.h>
54 #endif
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 
68 typedef struct
69 {
70  unsigned long size;
72  unsigned long version;
73  unsigned long flags;
74  SInt32 const * channelMap;
75  unsigned long channelMapSize;
77 
89 void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long flags );
90 
96 void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * const channelMap, unsigned long channelMapSize );
97 
105 AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s );
106 
114 AudioDeviceID PaMacCore_GetStreamOutputDevice( PaStream* s );
115 
130 const char *PaMacCore_GetChannelName( int device, int channelIndex, bool input );
131 
132 
142  long *minBufferSizeFrames, long *maxBufferSizeFrames );
143 
144 
153 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
154 PaError PaMacCore_GetOSWorkgroup( PaDeviceIndex device, os_workgroup_t *workgroup );
155 #endif
156 
171 #define paMacCoreChangeDeviceParameters (0x01)
172 
176 #define paMacCoreFailIfConversionRequired (0x02)
177 
180 #define paMacCoreConversionQualityMin (0x0100)
181 #define paMacCoreConversionQualityMedium (0x0200)
182 #define paMacCoreConversionQualityLow (0x0300)
183 #define paMacCoreConversionQualityHigh (0x0400)
184 #define paMacCoreConversionQualityMax (0x0000)
185 
194 #define paMacCorePlayNice (0x00)
195 
197 #define paMacCorePro (0x01)
198 
199 #define paMacCoreMinimizeCPUButPlayNice (0x0100)
200 
201 #define paMacCoreMinimizeCPU (0x0101)
202 
203 
204 #ifdef __cplusplus
205 }
206 #endif
208 #endif
PaHostApiTypeId hostApiType
Definition: pa_mac_core.h:71
void PaStream
Definition: portaudio.h:644
unsigned long version
Definition: pa_mac_core.h:72
SInt32 const * channelMap
Definition: pa_mac_core.h:74
int PaDeviceIndex
Definition: portaudio.h:214
The portable PortAudio API.
const char * PaMacCore_GetChannelName(int device, int channelIndex, bool input)
AudioDeviceID PaMacCore_GetStreamOutputDevice(PaStream *s)
unsigned long flags
Definition: pa_mac_core.h:73
int PaError
Definition: portaudio.h:122
PaHostApiTypeId
Definition: portaudio.h:277
unsigned long channelMapSize
Definition: pa_mac_core.h:75
void PaMacCore_SetupChannelMap(PaMacCoreStreamInfo *data, const SInt32 *const channelMap, unsigned long channelMapSize)
AudioDeviceID PaMacCore_GetStreamInputDevice(PaStream *s)
PaError PaMacCore_GetBufferSizeRange(PaDeviceIndex device, long *minBufferSizeFrames, long *maxBufferSizeFrames)
void PaMacCore_SetupStreamInfo(PaMacCoreStreamInfo *data, unsigned long flags)