-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathiOSapi.CoreAudioKit.pas
184 lines (144 loc) · 5.08 KB
/
iOSapi.CoreAudioKit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{ *********************************************************** }
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 2012-2014 Embarcadero Technologies, Inc. }
{ }
{ *********************************************************** }
//
// Delphi-Objective-C Bridge
// Interfaces for Cocoa framework CoreAudioKit
//
unit iOSapi.CoreAudioKit;
interface
uses
Macapi.CoreFoundation,
Macapi.CoreServices,
Macapi.Dispatch,
Macapi.Foundation,
Macapi.Mach,
Macapi.ObjCRuntime,
Macapi.ObjectiveC,
Macapi.QuartzCore,
iOSapi.AudioUnit,
iOSapi.CocoaTypes,
iOSapi.CoreGraphics,
iOSapi.Foundation,
iOSapi.UIKit;
type
// ===== Forward declarations =====
{$M+}
AUViewController = interface;
AUAudioUnit_ViewController = interface;
CABTMIDICentralViewController = interface;
CABTMIDILocalPeripheralViewController = interface;
CAInterAppAudioSwitcherView = interface;
CAInterAppAudioTransportView = interface;
// ===== Framework typedefs =====
{$M+}
AUViewControllerBase = UIViewController;
TCoreAudioKitCompletionHandler = procedure(param1: AUViewControllerBase)
of object;
AudioComponentInstance = Pointer;
AudioUnit = AudioComponentInstance;
CGFloat = Single;
// ===== Interface declarations =====
AUViewControllerClass = interface(UIViewControllerClass)
['{C07A29AC-CE9C-4F66-8FB1-53F71344CABA}']
end;
AUViewController = interface(UIViewController)
['{99F17CA7-0F72-4B77-80FD-5914F77E971E}']
end;
TAUViewController = class(TOCGenericImport<AUViewControllerClass,
AUViewController>)
end;
PAUViewController = Pointer;
AUAudioUnit_ViewController = interface(IObjectiveC)
['{145AA248-0948-4E04-A0C1-B6A50A89B685}']
procedure requestViewControllerWithCompletionHandler(completionHandler
: TCoreAudioKitCompletionHandler); cdecl;
end;
CABTMIDICentralViewControllerClass = interface(UITableViewControllerClass)
['{6536170A-ECFE-4F06-9DCF-F734E2BECE00}']
end;
CABTMIDICentralViewController = interface(UITableViewController)
['{D4A5A069-4BBD-4D79-9965-286A4F5339E3}']
end;
TCABTMIDICentralViewController = class
(TOCGenericImport<CABTMIDICentralViewControllerClass,
CABTMIDICentralViewController>)
end;
PCABTMIDICentralViewController = Pointer;
CABTMIDILocalPeripheralViewControllerClass = interface(UIViewControllerClass)
['{44EE236B-E60B-471B-9BCA-042F3DCE70FC}']
end;
CABTMIDILocalPeripheralViewController = interface(UIViewController)
['{DF96F955-8A63-4AC2-8ACC-CB4D8116AB78}']
end;
TCABTMIDILocalPeripheralViewController = class
(TOCGenericImport<CABTMIDILocalPeripheralViewControllerClass,
CABTMIDILocalPeripheralViewController>)
end;
PCABTMIDILocalPeripheralViewController = Pointer;
CAInterAppAudioSwitcherViewClass = interface(UIViewClass)
['{2A26C9C9-402C-4E01-BE34-CA8C99ADBB8A}']
end;
CAInterAppAudioSwitcherView = interface(UIView)
['{EBFBD867-415C-471F-B381-DCA32134AD16}']
procedure setShowingAppNames(showingAppNames: Boolean); cdecl;
function isShowingAppNames: Boolean; cdecl;
procedure setOutputAudioUnit(au: AudioUnit); cdecl;
function contentWidth: CGFloat; cdecl;
end;
TCAInterAppAudioSwitcherView = class
(TOCGenericImport<CAInterAppAudioSwitcherViewClass,
CAInterAppAudioSwitcherView>)
end;
PCAInterAppAudioSwitcherView = Pointer;
CAInterAppAudioTransportViewClass = interface(UIViewClass)
['{B59AA9A5-3AF0-44BC-AC19-284A7EF9E0B3}']
end;
CAInterAppAudioTransportView = interface(UIView)
['{D64FA21F-1BDA-4CA1-B211-6CC71970B509}']
procedure setEnabled(enabled: Boolean); cdecl;
function isEnabled: Boolean; cdecl;
function isPlaying: Boolean; cdecl;
function isRecording: Boolean; cdecl;
function isConnected: Boolean; cdecl;
procedure setLabelColor(labelColor: UIColor); cdecl;
function labelColor: UIColor; cdecl;
procedure setCurrentTimeLabelFont(currentTimeLabelFont: UIFont); cdecl;
function currentTimeLabelFont: UIFont; cdecl;
procedure setRewindButtonColor(rewindButtonColor: UIColor); cdecl;
function rewindButtonColor: UIColor; cdecl;
procedure setPlayButtonColor(playButtonColor: UIColor); cdecl;
function playButtonColor: UIColor; cdecl;
procedure setPauseButtonColor(pauseButtonColor: UIColor); cdecl;
function pauseButtonColor: UIColor; cdecl;
procedure setRecordButtonColor(recordButtonColor: UIColor); cdecl;
function recordButtonColor: UIColor; cdecl;
procedure setOutputAudioUnit(au: AudioUnit); cdecl;
end;
TCAInterAppAudioTransportView = class
(TOCGenericImport<CAInterAppAudioTransportViewClass,
CAInterAppAudioTransportView>)
end;
PCAInterAppAudioTransportView = Pointer;
// ===== External functions =====
const
libCoreAudioKit =
'/System/Library/Frameworks/CoreAudioKit.framework/CoreAudioKit';
implementation
{$IF defined(IOS) and NOT defined(CPUARM)}
uses
Posix.Dlfcn;
var
CoreAudioKitModule: THandle;
{$ENDIF IOS}
{$IF defined(IOS) and NOT defined(CPUARM)}
initialization
CoreAudioKitModule := dlopen(MarshaledAString(libCoreAudioKit), RTLD_LAZY);
finalization
dlclose(CoreAudioKitModule);
{$ENDIF IOS}
end.