forked from quicksilver/Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MTBuffer.h
37 lines (26 loc) · 1013 Bytes
/
MTBuffer.h
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
//
// MTBuffer.h
// MTCoreAudio.framework
//
// Created by Michael Thornburgh on Mon Mar 22 2004.
// Copyright (c) 2004 Michael Thornburgh. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MTBuffer : NSObject {
NSConditionLock * readLock, * writeLock;
NSLock * generalLock;
unsigned bufferHead, framesInBuffer;
unsigned bufferSize;
}
- initWithCapacity:(unsigned)capacity;
- (void) flush;
- (unsigned) capacity;
- (unsigned) count;
- (unsigned) writeFromContext:(void *)theContext count:(unsigned)count waitForRoom:(Boolean)wait;
- (unsigned) readToContext: (void *)theContext count:(unsigned)count waitForData:(Boolean)wait;
// the following methods are intended to be overridden by subclasses.
// MTBuffer's implementation does nothing
- (void) bufferDidEmpty;
- (void) performWriteFromContext:(void *)theContext offset:(unsigned)theOffset count:(unsigned)count;
- (void) performReadToContext: (void *)theContext offset:(unsigned)theOffset count:(unsigned)count;
@end