-
Notifications
You must be signed in to change notification settings - Fork 1
/
FTURLToPathPatch.m
59 lines (49 loc) · 1.27 KB
/
FTURLToPathPatch.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
#import "FTURLToPathPatch.h"
@implementation FTURLToPathPatch
+(BOOL)isSafe
{
// defaults to NO.
// delete this method if using default.
return YES;
}
+(BOOL)allowsSubpatchesWithIdentifier:(id)identifier
{
// defaults to YES.
// delete this method if using default.
return NO;
}
+(QCPatchExecutionMode)executionModeWithIdentifier:(id)identifier
{
// defaults to kQCPatchExecutionModeProcessor.
// delete this method if using default.
return kQCPatchExecutionModeProcessor;
}
+(QCPatchTimeMode)timeModeWithIdentifier:(id)identifier
{
// defaults to kQCPatchTimeModeNone.
// delete this method if using default.
return kQCPatchTimeModeNone;
}
-(id)initWithIdentifier:(id)identifier
{
if(self = [super initWithIdentifier:identifier])
{
[[self userInfo] setObject:@"Kineme URL to Path" forKey:@"name"];
[inputURL setStringValue:@"file:///Library/Desktop%20Pictures/"];
}
return self;
}
-(BOOL)execute:(QCOpenGLContext*)context time:(double)time arguments:(NSDictionary*)arguments
{
NSURL *u = [[NSURL alloc] initWithString:[inputURL stringValue]];
NSString *p = @"";
if([u isFileURL])
{
p = (NSString *)CFURLCopyPath((CFURLRef)u);
p = [p stringByReplacingOccurrencesOfString:@"%20" withString:@" "];
}
[outputPath setStringValue:p];
[u release];
return YES;
}
@end