Cog/Transformers/TotalTimeTransformer.m
Christopher Snowhill 92573ec088 [Job Queue] Overhauled long action handling
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-15 01:01:45 -07:00

32 lines
552 B
Objective-C

//
// TotalTimeTransformer.m
// Cog
//
// Created by Christopher Snowhill on 6/15/22.
//
#import "TotalTimeTransformer.h"
@implementation TotalTimeTransformer
+ (Class)transformedValueClass {
return [NSString class];
}
+ (BOOL)allowsReverseTransformation {
return NO;
}
- (id)transformedValue:(id)value {
if(value == nil) return @"";
if([value isKindOfClass:[NSString class]]) {
NSString *string = (NSString *)value;
if([string length] > 0) {
return [@"Total Duration: " stringByAppendingString:string];
}
}
return @"";
}
@end