Forgot to add these files last night.
parent
5808b34a16
commit
85b830f76b
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// StatusImageTransformer.h
|
||||
// Cog
|
||||
//
|
||||
// Created by Vincent Spader on 2/21/08.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface StatusImageTransformer : NSObject {
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// StatusImageTransformer.m
|
||||
// Cog
|
||||
//
|
||||
// Created by Vincent Spader on 2/21/08.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "StatusImageTransformer.h"
|
||||
#import "PlaylistEntry.h"
|
||||
|
||||
|
||||
@implementation StatusImageTransformer
|
||||
|
||||
+ (Class)transformedValueClass { return [NSImage class]; }
|
||||
+ (BOOL)allowsReverseTransformation { return NO; }
|
||||
|
||||
// Convert from string to RepeatMode
|
||||
- (id)transformedValue:(id)value {
|
||||
NSLog(@"Transforming value: %@", value);
|
||||
|
||||
if (value == nil) return nil;
|
||||
|
||||
PlaylistEntryStatus status = [value integerValue];
|
||||
NSLog(@"STATUS IS %i", status);
|
||||
if (status == kCogEntryPlaying) {
|
||||
return [NSImage imageNamed:@"play"];
|
||||
}
|
||||
else if (status == kCogEntryQueued) {
|
||||
return [NSImage imageNamed:@"NSAddTemplate"];
|
||||
}
|
||||
else if (status == kCogEntryError) {
|
||||
return [NSImage imageNamed:@"NSStopProgressTemplate"];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@end
|
Loading…
Reference in New Issue