-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathConcurrentOp.h
executable file
·56 lines (37 loc) · 1.54 KB
/
ConcurrentOp.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// ConcurrentOp.h
// Concurrent_NSOperation
//
// Created by David Hoerl on 6/13/11.
// Copyright 2011 David Hoerl. All rights reserved.
//
#include "AudioStreamer.h"
#include "AudioItem.h"
#include "AudioFile.h"
@class AudioStreamer;
@interface ConcurrentOp : NSOperation
{
size_t bytesFilled;
NSData *audioItemLocalCopy;
NSString * audioFileURL;
UInt32 bufferByteSize;
UInt32 numPacketsToRead;
AudioFileID audioFileID;
AudioFile *audioFile;
SInt64 inStartingPacket;
}
@property (assign) BOOL failInSetup;
@property (readwrite) BOOL isSongChanged;
@property (nonatomic, strong) NSString * audioFileURL;
@property (readwrite) AudioFileID audioFileID;
@property (nonatomic, strong) AudioFile *audioFile;
@property (nonatomic, strong) AudioStreamer * streamer;
@property (nonatomic, strong) NSThread *thread; // only exposed to demonstrate that users of this can message it on its own thread.
@property (nonatomic, strong) NSMutableData *webData; // when the operation is over, fetch the data - no contention
- (void)setStreamer:(AudioStreamer *)audioStreamer;
+ (void)postNotification:(NSNotification *)aNotification;
//- (void)wakeUp; // should be run on the operation's thread - could create a convenience method that does this then hide thread
- (void)finish; // should be run on the operation's thread - could create a convenience method that does this then hide thread
- (void)runConnection; // convenience method - messages using proper thread
- (void)cancel; // subclassed convenience method
@end