AEBufferStack.h
Go to the documentation of this file.
1 //
2 // AEBufferStack.h
3 // TheAmazingAudioEngine
4 //
5 // Created by Michael Tyson on 23/03/2016.
6 // Copyright © 2016 A Tasty Pixel. All rights reserved.
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source distribution.
25 //
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #import <Foundation/Foundation.h>
32 #import <AudioToolbox/AudioToolbox.h>
33 #import "AETypes.h"
34 
35 extern const UInt32 AEBufferStackMaxFramesPerSlice;
36 
38 
45 AEBufferStack * AEBufferStackNew(int poolSize);
46 
55 AEBufferStack * AEBufferStackNewWithOptions(int poolSize, int maxChannelsPerBuffer, int numberOfSingleChannelBuffers);
56 
62 void AEBufferStackFree(AEBufferStack * stack);
63 
70 void AEBufferStackSetFrameCount(AEBufferStack * stack, UInt32 frameCount);
71 
78 UInt32 AEBufferStackGetFrameCount(const AEBufferStack * stack);
79 
86 void AEBufferStackSetTimeStamp(AEBufferStack * stack, const AudioTimeStamp * timestamp);
87 
94 const AudioTimeStamp * AEBufferStackGetTimeStamp(const AEBufferStack * stack);
95 
102 int AEBufferStackGetPoolSize(const AEBufferStack * stack);
103 
111 
118 int AEBufferStackCount(const AEBufferStack * stack);
119 
127 const AudioBufferList * AEBufferStackGet(const AEBufferStack * stack, int index);
128 
141 const AudioBufferList * AEBufferStackPush(AEBufferStack * stack, int count);
142 
156 const AudioBufferList * AEBufferStackPushWithChannels(AEBufferStack * stack, int count, int channelCount);
157 
173 const AudioBufferList * AEBufferStackPushExternal(AEBufferStack * stack, const AudioBufferList * buffer);
174 
183 const AudioBufferList * AEBufferStackDuplicate(AEBufferStack * stack);
184 
190 void AEBufferStackSwap(AEBufferStack * stack);
191 
202 void AEBufferStackPop(AEBufferStack * stack, int count);
203 
213 void AEBufferStackRemove(AEBufferStack * stack, int index);
214 
226 const AudioBufferList * AEBufferStackMix(AEBufferStack * stack, int count);
227 
236 const AudioBufferList * AEBufferStackMixWithGain(AEBufferStack * stack, int count, const float * gains);
237 
254  float targetVolume, float * currentVolume,
255  float targetBalance, float * currentBalance);
256 
264 void AEBufferStackSilence(AEBufferStack * stack);
265 
275 void AEBufferStackMixToBufferList(AEBufferStack * stack, int bufferCount, const AudioBufferList * output);
276 
289  int bufferCount,
290  AEChannelSet channels,
291  const AudioBufferList * output);
292 
304 AudioTimeStamp * AEBufferStackGetTimeStampForBuffer(AEBufferStack * stack, int index);
305 
313 void AEBufferStackReset(AEBufferStack * stack);
314 #ifdef __cplusplus
315 }
316 #endif