-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSpookySendPatch.m
69 lines (55 loc) · 1.53 KB
/
SpookySendPatch.m
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
#import "SpookySendPatch.h"
#import "SpookyReceivePatch.h"
@implementation SpookySendPatch : QCPatch
+ (QCPatchExecutionMode)executionModeWithIdentifier:(id)fp8
{
return 1;
}
+ (BOOL)allowsSubpatchesWithIdentifier:(id)fp8
{
return NO;
}
- (id)initWithIdentifier:(id)fp8
{
if(self = [super initWithIdentifier: fp8])
{
[inputSender setStringValue:@"Sender0"];
[inputAutoClean setBooleanValue: TRUE];
[[self userInfo] setObject:@"Kineme Spooky Send" forKey:@"name"];
}
return self;
}
- (BOOL)setup:(QCOpenGLContext *)context
{
nexusManager = [DTSpookyNexus sharedNexusManager];
return YES;
}
- (void)cleanup:(QCOpenGLContext *)context
{
[nexusManager unuse];
}
- (void)disable:(QCOpenGLContext *)context
{
[prevSender release];
prevSender = nil;
}
- (BOOL)execute:(QCOpenGLContext *)context time:(double)time arguments:(NSDictionary *)arguments
{
NSString *sender = [inputSender stringValue];
id object = [inputObject rawValue];
if([inputAutoClean booleanValue] && prevSender && [sender isEqualToString:prevSender] == FALSE)
[nexusManager removeObjectForKey:prevSender];
if(object != nil)
{
// SLog(@"%@: Sending '%@'",sender,object);
[nexusManager setValue:object forKey:sender];
}
/* if(prevSender /*&& [prevSender isEqualTo:[inputSender stringValue]] == FALSE*//*)
[SpookyIndexPort removeSender:prevSender];
if([inputObject rawValue] != nil)
[SpookyIndexPort setObject:[inputObject rawValue] forSender:[inputSender stringValue]];*/
[prevSender release];
prevSender = [sender copyWithZone:NULL];
return YES;
}
@end