this repo has no description
1/*
2This file is part of Darling.
3
4Copyright (C) 2020 Lubos Dolezel
5
6Darling is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11Darling is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with Darling. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef _AT_AUDIO_COMPONENT_H
21#define _AT_AUDIO_COMPONENT_H
22#include <CoreFoundation/CFString.h>
23#include <CoreFoundation/CFDictionary.h>
24#include <CoreServices/MacTypes.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30enum {
31 kAudioComponentFlag_Unsearchable = 1,
32 kAudioComponentFlag_SandboxSafe = 2,
33 kAudioComponentFlag_IsV3AudioUnit = 3,
34 kAudioComponentFlag_RequiresAsyncInstantiation = 4,
35 kAudioComponentFlag_CanLoadInProcess = 8,
36};
37typedef UInt32 AudioComponentFlags;
38
39enum {
40 kAudioComponentInstantiation_LoadOutOfProcess = 1,
41 kAudioComponentInstantiation_LoadInProcess = 2,
42};
43typedef UInt32 AudioComponentInstantiationOptions;
44
45#pragma pack(push, 4)
46typedef struct {
47 OSType componentType;
48 OSType componentSubType;
49 OSType componentManufacturer;
50 UInt32 componentFlags;
51 UInt32 componentFlagsMask;
52} AudioComponentDescription;
53#pragma pack(pop)
54
55typedef struct OpaqueAudioComponent* AudioComponent;
56typedef struct ComponentInstanceRecord* AudioComponentInstance;
57
58typedef OSStatus (*AudioComponentMethod)(void* self, ...);
59
60typedef struct AudioComponentPlugInInterface {
61 OSStatus (*Open)(void* self, AudioComponentInstance inst);
62 OSStatus (*Close)(void* self);
63 AudioComponentMethod (*Lookup)(SInt16 sel);
64 void* reserved;
65} AudioComponentPlugInInterface;
66
67typedef AudioComponentPlugInInterface * (*AudioComponentFactoryFunction)(const AudioComponentDescription*);
68
69AudioComponent AudioComponentRegister(const AudioComponentDescription *inDesc, CFStringRef inName,
70 UInt32 inVersion, AudioComponentFactoryFunction inFactory);
71
72AudioComponent AudioComponentFindNext(AudioComponent inComponent, const AudioComponentDescription* desc);
73
74UInt32 AudioComponentCount(const AudioComponentDescription* desc);
75
76OSStatus AudioComponentCopyName(AudioComponent component, CFStringRef* outName);
77
78OSStatus AudioComponentGetDescription(AudioComponent component, AudioComponentDescription* outDesc);
79
80OSStatus AudioComponentGetVersion(AudioComponent component, UInt32* outVersion);
81
82#if defined(__OBJC__)
83#if !TARGET_OS_IPHONE
84
85@class NSImage;
86NSImage* AudioComponentGetIcon(AudioComponent component);
87
88#else
89
90@class UIImage;
91UIImage* AudioComponentGetIcon(AudioComponent component, float desiredPointSize);
92
93#endif
94#endif
95
96OSStatus AudioComponentInstanceNew(AudioComponent component, AudioComponentInstance* outInstance);
97void AudioComponentInstantiate(AudioComponent component, AudioComponentInstantiationOptions opts, void(^handler)(AudioComponentInstance, OSStatus));
98
99OSStatus AudioComponentInstanceDispose(AudioComponentInstance inst);
100AudioComponent AudioComponentInstanceGetComponent(AudioComponentInstance inst);
101
102Boolean AudioComponentInstanceCanDo(AudioComponentInstance inst, SInt16 sel);
103
104OSStatus AudioComponentCopyConfigurationInfo(AudioComponent component, CFDictionaryRef* outInfo);
105
106enum {
107 kAudioComponentValidationResult_Unknown = 0,
108 kAudioComponentValidationResult_Passed,
109 kAudioComponentValidationResult_Failed,
110 kAudioComponentValidationResult_TimedOut,
111 kAudioComponentValidationResult_UnauthorizedError_Open,
112 kAudioComponentValidationResult_UnauthorizedError_Init,
113};
114typedef UInt32 AudioComponentValidationResult;
115
116#define kAudioComponentConfigurationInfo_ValidationResult "ValidationResult"
117#define kAudioComponentValidationParameter_TimeOut "TimeOut"
118#define kAudioComponentValidationParameter_ForceValidation "ForceValidation"
119
120OSStatus AudioComponentValidate(AudioComponent component, CFDictionaryRef validationParams, AudioComponentValidationResult* result);
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif